Bitcoin QT source
Just took my first look at the Bitcoin-qt source: . I was mainly interested in how it does things like key-generation but also got into a bit of the more network-protocol related code.
It seems that there is a little room for improvement in terms of quality: I could not find an overall design document and the code doesn’t make it easy to determine overall architecture at a glance either (e.g. no one-class-per-file separation). Explicit block structure is missing in places and there are some goto statements(!) — wouldn’t it suck if there some control flow logic bugs. Also, there are no annotations to facilitate static analysis for things like buffer-overflows (people are probably passing arbitrary input into this thing).
It’s also interesting that a lot of the protocol rules depend on a large portion of the network using the same software, or software that is in agreement (look at all the macro-constants near the top of main.h).
Does anyone have any recommendation for any other open source client whose source code I might enjoy reading more? I’m open to reading any programming language. It seems like a managed language may be better for general clients going forwards though: I’m assuming all miners have forked into something dedicated for mining, so performance is not critical. Managed code makes it much easier to reason about the security of the software.