3 ms·
No problem - I wasn't sure if this is something you're currently working on or just a demonstration. The script interpreter is a tricky beast that looks easy bu
by VMG 12y ago
No problem - I wasn't sure if this is something you're currently working on or just a demonstration. The script interpreter is a tricky beast that looks easy but has a lot of edge cases. If one client behaves slightly different, a blockchain fork could happen: https://bitcoin.org/en/alert/2013-03-11-chain-fork https://bitcoin.org/en/alert/2013-03-11-chain-fork
- Theyeard 12y agoYes, exactly. And there are a lot of tricky corner cases like SIGHASH_SINGLE when number of inputs != number of outputs with hash 0x01 [0]. Actually the entire implementation (Bitcoin Core) is the specification :) It's interesting from the software design point of view - an extreme case of backwards compatibility. It's hard even within Bitcoin Core as some changes already caused forks [1]. The article is just a demonstration but it won't hurt if it was as accurate as possible (while still being readable) :) [0] https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_SINGLE https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtyp... [1] http://bitcoinmagazine.com/3668/bitcoin-network-shaken-by-blockchain-fork/ http://bitcoinmagazine.com/3668/bitcoin-network-shaken-by-bl...