aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-06-14 19:38:19 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-06-14 19:40:02 +0200
commitcc7cbd756acd79623230f7a1b0b0e40c772a82e1 (patch)
tree2b145481e06ef3e837d2cf443bdad9a780160eda /src/validation.h
parent4a7e64fc85461a205f2b51da52d1455795d43b91 (diff)
parent86edf4a2a502416ba8d6cebbce61030992f7ff6f (diff)
downloadbitcoin-cc7cbd756acd79623230f7a1b0b0e40c772a82e1.tar.xz
Merge #13451: rpc: expose CBlockIndex::nTx in getblock(header)
86edf4a2a502416ba8d6cebbce61030992f7ff6f expose CBlockIndex::nTx in getblock(header) (Gregory Sanders) Pull request description: Recent publication of a weakness in Bitcoin's merkle tree construction demonstrates many SPV applications vulnerable to an expensive to pull off yet still plausible attack: https://bitslog.wordpress.com/2018/06/09/leaf-node-weakness-in-bitcoin-merkle-tree-design/ Including the coinbase in the txoutproof seems the most effective fix, however results in a significant efficiency downgrade. Transactors will not even know a priori what the size of their proof will be within a couple orders of magnitude, unless they use the mid-state of SHA2 as detailed in the blog post. Some applications, like Elements blockchain platform that take SPV-style proofs have optional access to a bitcoind to verify these proofs of inclusion and check depth in the chain. Returning `CBlockIndex::nTx` would allow an extremely easy and compact way of checking the depth of the tree, with no additional overhead to the codebase, and works with pruned nodes. `getblockheader` is arguably not the place for it, but as mentioned before, is a natural workflow for us checking depth of a block in a possibly pruned node. We should also ensure that `verifytxoutproof` ends up validating this depth fact as well, but left this for another PR. Tree-SHA512: af4cf48e704c6088f8da06a477fda1aaa6f8770cee9b876c4465d1075966d6a95831a88817673fe5a0d6bbcdc1ffcbc1892e2be0d838c60fc6958d33eacdcc14
Diffstat (limited to 'src/validation.h')
0 files changed, 0 insertions, 0 deletions