Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.1 KB

README.md

File metadata and controls

29 lines (18 loc) · 1.1 KB

A simplified Bitcoin implemented in Go, which is good for beginner to learn how Bitcoin work.

Transaction

UTXO Set

  • 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

Network

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:

  1. Central node which all nodes will connect to.
  2. Miner node which will store transactions in mempool and mine blocks.
  3. Wallet node which will be used to send coins between wallets. Unlike SPV nodes though, it’ll store a full copy of blockchain.