You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
transaction_from_serialized (convert serialized protobuf into transaction struct)
verify_txin (verifies txin is valid, that it points to an unspent txout)
blocks
block_to_proto (convert block struct into proto struct)
block_to_serialized (convert block struct into serialized)
block_from_serialized (convert serialized protobuf into block struct)
add mempool (pool of verified TXs waiting to be put into block)
compute_merkle_root (computes merkle root)
insert TXs from mempool into currently mined block
verify_merkle_root (verifies merkle root)
verify_block (verify entire block, its txin, merkle root, whole boi)
blockchain
insert_block_into_blockchain (serializes block, puts serialized block into blockchain db)
get number of blocks in the database
fetch_block_from_db (fetches block struct, deserializing from db using passed in hash)
get_block_from_tx (fetches block struct from a TX struct)
get_block_height_for_block (gets the block height to a certain block hash, used for determining best blockchain)
remove_block_from_db
undo_block (must go through blocks if new branch is valid, undo old blocks, apply new branch)
insert_tx_into_index (if block is inserted into chain, add index for those block's txs to point to the block hash)
remove tx from index
leveldb transaction index. TX hash as key, value points to block key where TX is located
get_blocks_since_hash gets future blocks from a given start hash, returns a set size (iterates over all blocks to find start hash, while buffering blocks)
keeps track of unspent transactions and their unspent txouts (UTXOs)
Block insertion marks unspent UTXOs as spent
api
protobuf RPC for local client (elevated operations, wallet management, etc.)
list all dynamic mem allocs // ensure memory hygiene
ensure proto -> struct bytearray sizes are correct, or bail
setup CI (need to install dependencies on CI environment)
Conscious decisions:
no raw append-only block storage like bitcoin, using leveldb as the entire storage of the chain rather than only block headers (slower access, more size, faster to develop)
transactions
transaction_from_serialized(convert serialized protobuf into transaction struct)verify_txin(verifies txin is valid, that it points to an unspent txout)blocks
block_to_proto(convert block struct into proto struct)block_to_serialized(convert block struct into serialized)block_from_serialized(convert serialized protobuf into block struct)compute_merkle_root(computes merkle root)verify_merkle_root(verifies merkle root)verify_block(verify entire block, its txin, merkle root, whole boi)blockchain
insert_block_into_blockchain(serializes block, puts serialized block into blockchain db)fetch_block_from_db(fetches block struct, deserializing from db using passed in hash)get_block_from_tx(fetches block struct from a TX struct)get_block_height_for_block(gets the block height to a certain block hash, used for determining best blockchain)remove_block_from_dbundo_block(must go through blocks if new branch is valid, undo old blocks, apply new branch)insert_tx_into_index(if block is inserted into chain, add index for those block's txs to point to the block hash)transaction index. TX hash as key, value points to block key where TX is locatedget_blocks_since_hashgets future blocks from a given start hash, returns a set size (iterates over all blocks to find start hash, while buffering blocks)api