Post
Topic
Board Development & Technical Discussion
Re: Anyone has a minimalistic, C++ Implementation of the original bitcoin protocol?
by
NotATether
on 28/11/2024, 13:01:58 UTC
I searched for it for sometime in github with no luck. any implementation i find is either something like btcd, with more advanced non-minimalistic features or a miniature blockchain.

Have you come across https://github.com/piotrnar/gocoin? The newest version have wallet, CLI and web UI, but the older version only have CLI and wallet where the wallet's code is separated from full node client. In addition, gocoin is created by only one person, so i expect he make things as simple as possible to make it easier to maintain.

But take note that gocoin simply load entire UTXO into RAM.

That's something quite close to what I was looking for. Thank you so much!

There is also a similar client written in Python called pycoin, but it's no longer maintained.

https://pypi.org/project/pycoin/

Quote
only what is necessary to form a working bitcoin chain
Then, just take version 0.1.0, and remove things, which you don't need. For example: instead of "scriptSig" and "scriptPubKey", you only need "sig" and "pubKey", and ECDSA implementation. I guess the bare minimum is hashing, so you can start from SHA-256 implementation (because then, you can form a chain). The next thing is public key cryptography, which means secp256k1 implementation. If you have those two, then you can form the basic chain. If you ignore everything else, then you will have "downgraded soft-fork", where your version will only check P2PK, and accept everything else as valid.

Actually, not even 0.1.0. In fact even versions like 0.2 - 0.6 would be suitable as well, not to mention OP will be able to see things like P2PKH and even be able to sync it to the chain fully (at least 0.4.something and up [I forgot exactly which version is the minimum but achow wrote it somewhere]).