A simplified Bitcoin implemented in Go, which is good for beginner to learn how Bitcoin work.
- From
- tutorial Building Blockchain in Go - Ivan Kuznetsov
- repository Jeiwan/blockchain_go
- Usage:
go build
and./blockchain-go
- Block are stored in
block
database - UTXOs are stored in
chainstate
database
chainstate
structure
'c' + 32-byte transaction hash -> UTXOs record for that transaction
'B' -> 32-byte block hash: the block hash up to which the database represents the unspent transaction outputs
In Bitcoin Core, there are DNS seeds hardcoded which help node find other nodes to connect Bitcoin network for the first time.
We have three nodes:
- Central node which all nodes will connect to.
- Miner node which will store transactions in mempool and mine blocks.
- Wallet node which will be used to send coins between wallets. Unlike SPV nodes though, it’ll store a full copy of blockchain.