public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] Quadratic Hashing in BIP 134
@ 2017-04-28 20:53 Russell O'Connor
  0 siblings, 0 replies; only message in thread
From: Russell O'Connor @ 2017-04-28 20:53 UTC (permalink / raw)
  To: Bitcoin Protocol Discussion

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

I noticed that the the latest BIP 134
<https://github.com/bitcoin/bips/blob/959fecc15bdad070afa63455468b1dba54655fa6/bip-0134.mediawiki>
now supports SIGHASH_SINGLE and friends.  However, this support seems to
reintroduce some quadratic hashing behavior because it calls
<https://github.com/zander/bitcoinclassic/blob/9c688c6d3866890f16a36aaea453e8bdd43c1266/src/script/interpreter.cpp#L1186>SerializePartialTransactionv4
per non-SIGHASH_ALL input
<https://github.com/bitcoinclassic/bitcoinclassic/blob/9c688c6d3866890f16a36aaea453e8bdd43c1266/src/script/interpreter.cpp#L1186>.
In particular, if each input in a transaction has one SIGHASH_SINGLE
CHECKSIG operation then the total amount of hashing done for the
transaction will be quadratic in the number of inputs.  While amount of
hashing is not as severe as with the SIGHASH_ALL case, the amount of
hashing done is still non-linear.

[-- Attachment #2: Type: text/html, Size: 1134 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-28 20:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28 20:53 [bitcoin-dev] Quadratic Hashing in BIP 134 Russell O'Connor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox