OCF System Functions
Compos Protocol, through its CVM, has innovatively developed a set of system functions specifically designed to facilitate access to the Bitcoin blockchain's data for developers. Developers can seamlessly invoke these functions within OCF.
We have outlined a strategic plan to implement system functions progressively, categorized into seven distinct types, aligning with our roadmap for gradual deployment:
Global:
get_block_number, get_tx_id, get_ord_id, get_ord_owner
Block related:
get_block_hash, get_block_timestamp, get_block_merkleroot, get_nonce get_block_brc20a_len,
get_block_brc20a_len
: retrieve the total number of BRC-20A inscriptions issued by a specific address in a given block, considering both separate-outputs and same-sats scenarios.
get_block_difficulty, get_block_size, get_block_total_input, get_block_total_output, get_block_reward_btc, get_block_fee_reward_btc, get_block_stripped_size
TX related:
get_tx_block_number, get_tx_ord_len, txo_exist
get_tx_ord_len
: get the number of inscriptions within the transaction, noting that multiple bodies are possible for batch inscriptions.txo_exist
: used to verify the existence of a transaction output in the transaction that sends a specific amount of BTC value to a particular address.
get_tx_input_btc, get_tx_output_btc, get_tx_fee_price, get_tx_hash, get_tx_virtual_size, get_tx_index, get_tx_value, get_tx_lock_time
Ordinals layer related:
get_ord_number, get_ord_owner, get_ord_genesis_tx_id, get_ord_metadata, get_ord_metaprotocol, get_ord_content_body, get_ord_ref_by, ord_ref_byself
get_ord_content_body
: parse the body of this inscription as a string. This body refers tocontent_type
with a tag of1
.get_ord_ref_by
: retrieve the inscriptions that recursively reference this specific inscription.ord_ref_byself
: returns if a particular inscription has been referenced by its owner
get_ord_by_field, get_ord_p, get_ord_genesis_block_number, get_ord_genesis_fee, get_ord_from_address, get_ord_location, get_ord_offset, get_ord_value, get_ord_content_type, get_ord_sat_ordinal, get_ord_sat_rarity, get_ord_satributes, get_ord_provenance
OCF layer related:
get_ocf_params
: retrieve the parameters of a specific OCF inscription
BRC-20 layer related:
get_brc20_op, get_brc20_tick, get_brc20_max_supply, get_brc20_current_supply, get_brc20_amt
Address related:
get_balance, get_brc20_balance, get_brc20_transferable_balance, get_brc20_available_balance
In OCF version
= 0.1, we have implemented the following system functions:
Last updated