UTXO Management Contract
utxomng.xsat
utxomng.xsat
This contract stores Bitcoin UTXO data and keep it updated, allowing developers to retrieve UTXO data by reading the contract's table.
Actions
Initialize configuration
Add UTXO
Delete UTXO
Add block header
Delete block header
Parse UTXO
ENUM parsing_status
parsing_status
TABLE chainstate
chainstate
scope
utxomng.xsat
params
{uint64_t} num_utxos
- total number of UTXOs{uint64_t} head_height
- header block height for consensus success{uint64_t} irreversible_height
- irreversible block height{uint64_t} irreversible_hash
- irreversible block hash{uint64_t} migrating_height
- block height in migration{uint64_t} migrating_hash
- block hash in migration{uint64_t} migrating_num_utxos
- the total number of UTXOs in the migration{uint64_t} migrated_num_utxos
- number of UTXOs that have been migrated{uint32_t} num_provider_validators
- the number of validators that have endorsed the current parsed block{uint32_t} num_validators_assigned
- the number of validators that have been allocated rewards{name} miner
- block miner account{name} synchronizer
- block synchronizer account{name} parser
- the account number of the parsing block{uint64_t} parsed_height
- parsed block height{uint64_t} parsing_height
- the current height being parsed{map<checksum256, parsing_progress_row>} parsing_progress_of
- parsing progress @seeparsing_progress_row
{uint8_t} status
- parsing status @seeparsing_status
example
TABLE config
config
scope
utxomng.xsat
params
{uint16_t} parse_timeout_seconds
- parsing timeout duration{uint16_t} num_validators_per_distribution
- number of endorsing users each time rewards are distributed{uint16_t} num_retain_data_blocks
- number of blocks to retain data{uint16_t} retained_spent_utxo_blocks
- number of blocks to retained spent utxo{uint16_t} num_txs_per_verification
- the number of tx for each verification (2^n){uint8_t} num_merkle_layer
- verify the number of merkle levels (log(num_txs_per_verification)){uint16_t} num_miner_priority_blocks
- miners who produce blocks give priority to verifying the number of blocks
example
TABLE utxos
utxos
scope
utxomng.xsat
params
{uint64_t} id
- primary key{checksum256} txid
- transaction id{uint32_t} index
- vout index{std::vector<uint8_t>} scriptpubkey
- vout's script public key{uint32_t} value
- utxo quantity
example
TABLE pendingutxos
pendingutxos
scope
utxomng.xsat
params
{uint64_t} id
- primary key{uint64_t} height
- block height{checksum256} hash
- block hash{checksum256} txid
- transaction id{uint32_t} index
- vout index{std::vector<uint8_t>} scriptpubkey
- script public key{uint32_t} value
- utxo quantity{name} type
- utxo type (vin
orvout
)
example
TABLE spentutxos
spentutxos
scope
utxomng.xsat
params
{uint64_t} id
- primary key{uint64_t} height
- block height{checksum256} txid
- transaction id{uint32_t} index
- vout index{std::vector<uint8_t>} scriptpubkey
- script public key{uint32_t} value
- utxo quantity
example
TABLE blocks
blocks
scope
utxomng.xsat
params
{uint64_t} height
- block height{checksum256} hash
- block hash{checksum256} cumulative_work
- the cumulative workload of the block{uint32_t} version
- block version{checksum256} previous_block_hash
- hash in internal byte order of the previous blockβs header{checksum256} merkle
- the merkle root is derived from the hashes of all transactions included in this block{uint32_t} timestamp
- the block time is a Unix epoch time{uint32_t} bits
- an encoded version of the target threshold this blockβs header hash must be less than or equal to{uint32_t} nonce
- an arbitrary number miners change to modify the header hash in order to produce a hash less than or
example
TABLE block.extra
block.extra
scope
utxomng.xsat
params
{uint64_t} height
- block height{uint64_t} bucket_id
- the associated bucket number is used to obtain block data
example
TABLE consensusblk
consensusblk
scope
utxomng.xsat
params
{uint64_t} bucket_id
- the associated bucket number is used to obtain block data{uint64_t} height
- block height{checksum256} hash
- block hash{checksum256} cumulative_work
- the cumulative workload of the block{uint32_t} version
- block version{checksum256} previous_block_hash
- hash in internal byte order of the previous blockβs header{checksum256} merkle
- the merkle root is derived from the hashes of all transactions included in this block{uint32_t} timestamp
- the block time is a Unix epoch time{uint32_t} bits
- an encoded version of the target threshold this blockβs header hash must be less than or equal to{uint32_t} nonce
- an arbitrary number miners change to modify the header hash in order to produce a hash less than or{name} miner
- block miner account{name} synchronizer
- block synchronizer account{name} parser
- the last parser of the parsing block{uint64_t} num_utxos
- the total number of vin and vout of the block{bool} parse
- is it an parsed block{bool} irreversible
- is it an irreversible block{time_point_sec} created_at
- created at time
example
STRUCT parsing_progress_row
parsing_progress_row
params
{uint64_t} bucket_id
- the bucket_id currently being parsed{uint64_t} num_transactions
- the number of transactions currently parsing the block{uint64_t} parsed_transactions
- number of transactions currently resolved{uint64_t} parsed_position
- the position of the currently parsed block{uint64_t} parsed_vin
- the current transaction has been resolved to the vin index{uint64_t} parsed_vout
- the current transaction has been resolved to the vout index{name} parser
- the account number of the parsing block{time_point_sec} parsed_expiration_time
- timeout for parsing chunks
example
STRUCT process_block_result
process_block_result
params
{string} status
- current parsing status (waiting, migrating, deleting_data, distributing_rewards, parsing, parsing_completed){uint64_t} height
- block height{checksum256} block_hash
- block hash
example
ACTION init
init
authority: utxomng.xsat
Initialize block information to start parsing.
params
{uint64_t} height
- block height{checksum256} hash
- block hash{checksum256} cumulative_work
- the cumulative workload of the block
ACTION config
config
authority: utxomng.xsat
Setting parameters.
params
{uint16_t} parse_timeout_seconds
- parsing timeout duration{uint16_t} num_validators_per_distribution
- number of endorsing users each time rewards are distributed{uint16_t} retained_spent_utxo_blocks
- number of blocks to retain utxo{uint16_t} num_retain_data_blocks
- number of blocks to retain data{uint8_t} num_merkle_layer
- verify the number of merkle levels (log(num_txs_per_verification)){uint16_t} num_miner_priority_blocks
- miners who produce blocks give priority to verifying the number of blocks
ACTION addutxo
addutxo
authority: utxomng.xsat
Add utxo data.
params
{uint64_t} id
- primary id{checksum256} txid
- transaction id{uint32_t} index
- vout index{vector<uint8_t>} scriptpubkey
- script public key{uint64_t} value
- utxo quantity
ACTION delutxo
delutxo
authority: utxomng.xsat
Delete utxo data.
params
{uint64_t} id
- utxo id
ACTION addblock
addblock
authority: utxomng.xsat
Add history block header.
params
{uint64_t} height
- block height{checksum256} hash
- block hash{checksum256} cumulative_work
- the cumulative workload of the block{uint32_t} version
- block version{checksum256} previous_block_hash
- hash in internal byte order of the previous blockβs header{checksum256} merkle
- the merkle root is derived from the hashes of all transactions included in this block{uint32_t} timestamp
- the block time is a Unix epoch time{uint32_t} bits
- an encoded version of the target threshold this blockβs header hash must be less than or equal to{uint32_t} nonce
- an arbitrary number miners change to modify the header hash in order to produce a hash less than or
ACTION delblock
delblock
authority: utxomng.xsat
Delete block header.
params
{uint64_t} height
- block height
ACTION delspentutxo
delspentutxo
authority: utxomng.xsat
Delete spent utxo.
params
{uint64_t} row
- number of rows to delete utxo{uint64_t} nonce
- unique value for each call to prevent duplicate transactions
ACTION delblockdata
delblockdata
authority: utxomng.xsat
Delete block data.
params
{uint64_t} row
- number of rows of block data to delete{uint64_t} nonce
- unique value for each call to prevent duplicate transactions
ACTION processblock
processblock
authority:
synchronizer
Parse utxo
params
{name} synchronizer
- synchronizer account{uint64_t} process_rows
- number of vins and vouts to be parsed{uint64_t} nonce
- unique value for each call to prevent duplicate transactions
ACTION consensus
consensus
authority:
blksync.xsat
orblkendt.xsat
Reach consensus logic
params
{uint64_t} height
- block height{checksum256} hash
- block hash
Last updated