3 ms·
Because of bugs like this, the bitcoin developers strongly discourage using reimplementations of consensus code. Consensus code is complex, and a reimplementati
by Taek 12y ago
Because of bugs like this, the bitcoin developers strongly discourage using reimplementations of consensus code. Consensus code is complex, and a reimplementation cannot reject any blocks that the majority implementation (the implementation used by the most hashing power) would accept.
To be safe for mining, the behavior must match exactly. This includes bugs in the code, errors introduced by compiler optimization, bugs in any libraries, and quirks of the programming language.
This is the reason they created libbitcoinconsensus. The library allows you to innovate around non consensus-critical features of bitcoin without introducing forking risks.
- petertodd 12y agoI wrote an article talking about this a few months ago: http://www.mail-archive.com/bitcoin-development@lists.sourceforge.net/msg06466.html http://www.mail-archive.com/bitcoin-development@lists.source... "The difficulty of writing consensus critical code: the SIGHASH_SINGLE bug" Five pages of detail about a single bug^H^H^H feature, and just the other day I found yet another edge case in the implementation that I hadn't noticed before.
- nicklerj 12y agoI don't believe that you are really Peter Todd, can you please sign the challenge "1" with one of your known bitcoin addresses? Joking aside, I used some of your scripts to seed the fuzzer: https://github.com/jonasnick/bitcoinconsensus_testcases/tree/master/examples https://github.com/jonasnick/bitcoinconsensus_testcases/tree.... If you come up with more scripts I'd love to feed them to the fuzzer. I'm still surprised that a javascript implementation (bitcore) is withstanding so far.
- petertodd 12y ago-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 https://news.ycombinator.com/item?id=9526884 > I don't believe that you are really Peter Todd, can you please sign the > challenge "1" with one of your known bitcoin addresses? Pff, PGP all the way. > Joking aside, I used some of your scripts to seed the fuzzer: > https://github.com/jonasnick/bitcoinconsensus_testcases/tree.... If you come > up with more scripts I'd love to feed them to the fuzzer. I'm still surprised > that a javascript implementation (bitcore) is withstanding so far. Oh, by scripts you mean the test cases I've added in Bitcoin Core? Thanks! -----BEGIN PGP SIGNATURE----- iQGrBAEBCACVBQJVUP6SXhSAAAAAABUAQGJsb2NraGFzaEBiaXRjb2luLm9yZzAw MDAwMDAwMDAwMDAwMDAwMjE5MjMyYzdkYTRjMTk2NjllMjY1NTc3ODkzMDVlODE0 MzQ2OWQyMGZiZGRjODYvFIAAAAAAFQARcGthLWFkZHJlc3NAZ251cGcub3JncGV0 ZUBwZXRlcnRvZC5vcmcACgkQJIFAPaXwkfv+tAf/WDq99I+Sn54//hEzmX21WV6d A1OvMhfQ2xalf6O8l5gwzQkcvADcjlN00emc09GI2s4iQE2U85mkFhH/s+LWB8q6 K0qLTZjUvZMlSEpf6kGSGiClJpWt/K6vHewwWRZr6gJ/iqYper87SUpDqaV71QjU cXdFFNx2tCoqSHuLRddLaYhP3p30bu/LWdcawG16hKCWiKp/it5dqPsMT1bm6QAQ aRoGPAgx8xB/g9Jw1dXZOmtEjLCrBimq7TdDY58RgRlqQk8oyox5T8Ypsro+uPg/ 7v5U9lA5SS2ggXURpQpBwRAtDNEFMMHr2r0pu913Cea/wAG1iOPlUwvVpgnHRQ== =ETM3 -----END PGP SIGNATURE-----