tapyrus-core
tapyrus-core copied to clipboard
Add UTXO snapshot creation
Introducing the dumptxoutset RPC added to Bitcoin Core.
https://github.com/bitcoin/bitcoin/pull/16899
In bitcoin the snapshot metadata contains base_blockhash and coins_count. In Tapyrus it would be necessary to store networkid and whether it is prod or dev mode.
So these are the meta data stored:
- networkid - tapyrus network id. It is necessary to verify that the snapshot is from the correct network.
- mode - prod/dev
- snapshot_time - median tome of the node when snapshot was created. This data is stored with the hope that it would be useful when loading the snapshot.
- base_blockhash - block hash of the last confirmed block in the snapshot
- coins_count
mode - prod/dev
This would be unnecessary. Even in Bitcoin, snapshots do not include data that distinguishes between mainnet and testnet.
snapshot_time
Since base_blockhash
is present, this is also unnecessary.
In PR #29612 from bitcoin-core ( Optimize serialization and enhance metadata of dumptxoutset output) utxo snapshot metadata is enhanced to include
- version
- network magic bytes
- block height
In Tapyrus version is added. Network magic bytes depend on network id. So we use network mode instead. Block height can be deduced from block hash. This is not added.