Get desktop application:
View/edit binary Protocol Buffers messages
bchrpc contains a set of RPCs that can be exposed publicly via the command line options. This service could be authenticated or unauthenticated.
GetMempoolInfo returns the state of the current mempool.
(message has no fields)
The count of transactions in the mempool
The size in bytes of all transactions in the mempool
GetMempool returns information about all transactions currently in the memory pool. Offers an option to return full transactions or just transactions hashes.
When `full_transactions` is true, full transaction data is provided instead of just transaction hashes. Default is false.
List of unconfirmed transactions.
GetBlockchainInfo returns data about the blockchain including the most recent block hash and height.
(message has no fields)
Which network the node is operating on.
The current number of blocks on the longest chain.
The hash of the best (tip) block in the most-work fully-validated chain, little-endian.
Threshold for adding new blocks.
Median time of the last 11 blocks.
When `tx_index` is true, the node has full transaction index enabled.
When `addr_index` is true, the node has address index enabled and may be used with call related by address.
When `slp_index` is true, the node has the slp index enabled and may be used with slp related rpc methods and also causes slp metadata to be added in some of the existing rpc methods.
When `slp_graphsearch` is true, the node is able to handle calls to slp graph search
GetBlockInfo returns metadata and info for a specified block.
The block hash as a byte array or base64 encoded string, little-endian.
The block number.
Marshaled block header data, as well as metadata.
GetBlock returns detailed data for a block.
The block hash as a byte array or base64 encoded string, little-endian.
The block number.
When `full_transactions` is true, full transactions are returned instead of just hashes. Default is false.
A marshaled block.
GetRawBlock returns a block in a serialized format.
The block hash as a byte array or base64 encoded string, little-endian.
The block number.
Raw block data (with header) serialized according the the bitcoin block protocol.
GetBlockFilter returns the compact filter (cf) of a block as a Golomb-Rice encoded set. **Requires CfIndex**
The block hash as a byte array or base64 encoded string, little-endian.
The block number.
A compact filter matching input outpoints and public key scripts contained in a block (encoded according to BIP158).
GetHeaders takes a block locator object and returns a batch of no more than 2000 headers. Upon parsing the block locator, if the server concludes there has been a fork, it will send headers starting at the fork point, or genesis if no blocks in the locator are in the best chain. If the locator is already at the tip no headers will be returned. see: bchd/bchrpc/documentation/wallet_operation.md
Request headers using a list of known block hashes.
A list of block hashes known to the client (most recent first) which is exponentially sparser toward the genesis block (0), little-endian. Common practice is to include all of the last 10 blocks, and then 9 blocks for each order of ten thereafter.
hash of the latest desired block header, little-endian; only blocks occurring before the stop will be returned.
List of block headers.
GetTransaction returns a transaction given a transaction hash. **Requires TxIndex** **Requires SlpIndex for slp related information **
Get a transaction from a transaction hash.
A transaction hash, little-endian.
A marshaled transaction.
GetRawTransaction returns a serialized transaction given a transaction hash. **Requires TxIndex**
Get an encoded transaction from a transaction hash.
A transaction hash, little-endian.
Raw transaction in bytes.
GetAddressTransactions returns the transactions for the given address. Offers offset, limit, and from block options. **Requires AddressIndex** **Requires SlpIndex for slp related information **
Get marshaled transactions related to a specific address. RECOMMENDED: Parameters have been provided to query without creating performance issues on the node or client. - The number of transactions to skip and fetch allow for iterating over a large set of transactions, if necessary. - A starting block parameter (either `hash` or `height`) may then be used to filter results to those occurring after a certain time. This approach will reduce network traffic and response processing for the client, as well as reduce workload on the node.
The address to query transactions, in lowercase cashaddr format. The network prefix is optional (i.e. "cashaddress:").
The number of confirmed transactions to skip, starting with the oldest first. Does not affect results of unconfirmed transactions.
Specify the number of transactions to fetch.
Recommended. Only get transactions after (or within) a starting block identified by hash, little-endian.
Recommended. Only get transactions after (or within) a starting block identified by block number.
Transactions that have been included in a block.
Transactions in mempool which have not been included in a block.
GetRawAddressTransactions returns the serialized raw transactions for the given address. Offers offset, limit, and from block options. **Requires AddressIndex**
Get encoded transactions related to a specific address. RECOMMENDED: Parameters have been provided to query without creating performance issues on the node or client. - The number of transactions to skip and fetch allow for iterating over a large set of transactions, if necessary. - A starting block parameter (either `hash` or `height`) may then be used to filter results to those occurring after a certain time. This approach will reduce network traffic and response processing for the client, as well as reduce workload on the node.
The address to query transactions, in lowercase cashaddr format. The network prefix is optional (i.e. "cashaddress:").
The number of confirmed transactions to skip, starting with the oldest first. Does not affect results of unconfirmed transactions.
Specify the number of transactions to fetch.
Recommended. Only return transactions after some starting block identified by hash, little-endian.
Recommended. Only return transactions after some starting block identified by block number.
Transactions that have been included in a block.
Transactions in mempool which have not been included in a block.
GetAddressUnspentOutputs returns all the unspent transaction outputs for the given address. **Requires AddressIndex** **Requires SlpIndex for slp related information **
The address to query transactions, in lowercase cashaddr format. The network identifier is optional (i.e. "cashaddress:").
When `include_mempool` is true, unconfirmed transactions from mempool are returned. Default is false.
List of unspent outputs.
GetUnspentOutput takes an unspent output in the utxo set and returns the utxo metadata or not found. **Requires SlpIndex for slp related information **
The hash of the transaction, little-endian.
The number of the output, starting from zero.
When include_mempool is true, unconfirmed transactions from mempool are returned. Default is false.
A reference to the related input.
Locking script dictating how funds can be spent in the future
Amount in satoshi.
When is_coinbase is true, the transaction was the first in a block, created by a miner, and used to pay the block reward
The index number of the block containing the transaction creating the output.
GetMerkleProof returns a Merkle (SPV) proof for a specific transaction in the provided block. **Requires TxIndex**
A transaction hash, little-endian.
Block header information for the corresponding transaction
A list containing the transaction hash, the adjacent leaf transaction hash and the hashes of the highest nodes in the merkle tree not built with the transaction. Proof hashes are ordered following transaction order, or left to right on the merkle tree
Binary representing the location of the matching transaction in the full merkle tree, starting with the root (`1`) at position/level 0, where `1` corresponds to a left branch and `01` is a right branch.
GetSlpTokenMetadata return slp token metadata for one or more tokens. **Requires SlpIndex**
GetSlpParsedScript returns marshalled object from parsing an slp pubKeyScript using goslp package. This endpoint does not require SlpIndex.
NFT1 Group also uses this
NFT1 Group also uses this
NFT1 Group also uses this
GetSlpTrustedValidation returns slp validity related information for one or more transactions. **Requires SlpIndex**
GraphSearch returns all the transactions needed for a client to validate an SLP graph **Requires SlpIndex and SlpGraphSearch**
CheckSlpTransaction checks the validity of a supposed slp transaction before it is broadcasted.
Using the slp specification as a basis for validity judgement can lead to confusion for new users and result in accidental token burns. use_spec_validity_judgement will cause the response's is_valid property to be returned according to the slp specification. Therefore, use_spec_validity_judgement is false by default in order to avoid accidental token burns. When use_spec_validity_judgement is false we return invalid in any case which would result in a burned token, unless the burn is explicitly included as an item in required_slp_burns property. When use_spec_validity_judgement is true, there are three cases where the is_valid response property will be returned as valid, instead of invalid, as per the slp specification. 1) inputs > outputs 2) missing transaction outputs 3) burned inputs from other tokens required_slp_burns is not used when use_spec_validity_judgement is set to true.
Submit a transaction to all connected peers.
The encoded transaction.
Transaction hash, little-endian.
SubscribeTransactions creates subscription to all relevant transactions based on the subscription filter. This RPC does not use bidirectional streams and therefore can be used with grpc-web. You will need to close and reopen the stream whenever you want to update the subscription filter. If you are not using grpc-web then SubscribeTransactionStream is more appropriate. **Requires TxIndex to receive input metadata** **Requires SlpIndex to receive slp input/output metadata, or SlpTokenMetadata**
SubscribeTransactionStream subscribes to relevant transactions based on the subscription requests. The parameters to filter transactions on can be updated by sending new SubscribeTransactionsRequest objects on the stream. NOTE: Because this RPC is using bi-directional streaming it cannot be used with grpc-web. **Requires TxIndex to receive input metadata**
SubscribeBlocks creates a subscription for notifications of new blocks being connected to the blockchain or blocks being disconnected.
Options to define data structure to be sent by SubscribeBlock stream: - BlockInfo (block metadata): `BlockInfo` - SubscribeBlocksRequest {} - Marshaled Block (with transaction hashes): `Block` - SubscribeBlocksRequest { full_block = true } - Marshaled Block (with full transaction data): `Block` - SubscribeBlocksRequest { full_block = true full_transactions = true } - Serialized Block acccording to bitcoin protocol encoding: `bytes` - SubscribeBlocksRequest { serialize_block = true }
When full_block is true, a complete marshaled block is sent. See `Block`. Default is false, block metadata is sent. See `BlockInfo`.
When full_transactions is true, provide full transaction info for a marshaled block. Default is false, only the transaction hashes are included for a marshaled block. See `TransactionData`.
When serialize_block is true, blocks are serialized using bitcoin protocol encoding. Default is false, block will be Marshaled (see `BlockInfo` and `BlockNotification`)
Whether the block is connected to the chain.
Marshaled block header data, as well as metadata stored by the node.
A Block.
Binary block, serialized using bitcoin protocol encoding.
Used in:
,Block header data, as well as metadata stored by the node.
List of transactions or transaction hashes.
Used in:
Just the transaction hash, little-endian.
A marshaled transaction.
Metadata for identifying and validating a block
Identification.
Used in:
, , , ,The double sha256 hash of the six header fields in the first 80 bytes of the block, when encoded according the bitcoin protocol, little-endian. sha256(sha256(encoded_header))
The block number, an incremental index for each block mined.
A version number to track software/protocol upgrades.
Hash of the previous block, little-endian.
The root of the Merkle Tree built from all transactions in the block, little-endian.
When mining of the block started, expressed in seconds since 1970-01-01.
Difficulty in Compressed Target Format.
A random value that was generated during block mining which happened to result in a computed block hash below the difficulty target at the time.
Number of blocks in a chain, including the block itself upon creation.
Difficulty target at time of creation.
Hash of the next block in this chain, little-endian.
Size of the block in bytes.
The median block time of the latest 11 block timestamps.
State of the block in relation to the chain.
Used in:
CashToken info used in transaction inputs / outputs WARNING: Some languages (e.g., JavaScript) may not properly handle the 'uint64' for large amounts. For this reason, an annotation has been added for JS to return a string for the amount field instead of casting uint64 to the JS 'number' type. Other languages may require similar treatment.
Used in:
, , ,Bitcoin network types
Used in:
Live public network with monetary value.
An isolated environment for automated testing.
A public environment where monetary value is agreed to be zero, and some checks for transaction conformity are disabled.
Private testnets for large scale simulations (or stress testing), where a specified list of nodes is used, rather than node discovery.
Latest Testnet.
Used in:
Either one of the two following is provided, depending on the request.
The transaction hash, little-endian.
The transaction data.
Used in:
Used in:
Used in:
,The time when the transaction was added too the pool.
The block height when the transaction was added to the pool.
The total fee in satoshi the transaction pays.
The fee in satoshi per kilobyte the transaction pays.
The priority of the transaction when it was added to the pool.
SlpAction is used to allow clients to identify the type of slp transaction from this single field. NOTE: All enum types except for "NON_SLP" may be annotated with one or more BurnFlags.
Used in:
, , ,SlpRequiredBurn is used by clients to allow token burning
Used in:
,SlpToken info used in transaction inputs / outputs WARNING: Some languages (e.g., JavaScript) may not properly handle the 'uint64' for large amounts. For this reason, an annotation has been added for JS to return a string for the amount field instead of casting uint64 to the JS 'number' type. Other languages may require similar treatment.
Used in:
, , ,SlpTokenMetadata is used to marshal metadata about a specific TokenID
Used in:
, , ,V1Fungible is used to marshal metadata specific to Type 1 token IDs
Used in:
V1NFT1Child is used to marshal metadata specific to NFT1 Child token IDs
Used in:
V1NFT1Group is used to marshal metadata specific to NFT1 Group token IDs
Used in:
Used in:
, , , ,SlpTransactionInfo is used inside the Transaction message type.
Used in:
NFT1 Group also uses this
NFT1 Group also uses this
NFT1 Group also uses this
Used in:
Used in:
SlpV1GenesisMetadata is used to marshal type 1 and NFT1 Group GENESIS OP_RETURN scriptPubKey
Used in:
,SlpV1MintMetadata is used to marshal type 1 MINT OP_RETURN scriptPubKey
Used in:
,SlpV1Nft1ChildGenesisMetadata is used to marshal NFT1 Child GENESIS OP_RETURN scriptPubKey
Used in:
,SlpV1Nft1ChildSendMetadata is used to marshal NFT1 Child SEND OP_RETURN scriptPubKey
Used in:
,SlpV1SendMetadata is used to marshal type 1 and NFT1 Group SEND OP_RETURN scriptPubKey
Used in:
,Request to subscribe or unsubscribe from a stream of transactions.
Used as request type in: bchrpc.SubscribeTransactionStream, bchrpc.SubscribeTransactions
Subscribe to a filter. add items to a filter
Unsubscribe to a filter, remove items from a filter
When include_mempool is true, new unconfirmed transactions from mempool are included apart from the ones confirmed in a block.
When include_in_block is true, transactions are included when they are confirmed. This notification is sent in addition to any requested mempool notifications.
When serialize_tx is true, transactions are serialized using bitcoin protocol encoding. Default is false, transaction will be Marshaled (see `Transaction`, `MempoolTransaction` and `TransactionNotification`)
Used in:
, , , , ,The double sha256 hash of the encoded transaction, little-endian. sha256(sha256(encoded_transaction))
The version of the transaction format.
List of inputs.
List of outputs.
The block height or timestamp after which this transaction is allowed. If value is greater than 500 million, it is assumed to be an epoch timestamp, otherwise it is treated as a block-height. Default is zero, or lock.
The size of the transaction in bytes.
When the transaction was included in a block, in epoch time.
Number of blocks including proof of the transaction, including the block it appeared.
Number of the block containing the transaction.
Hash of the block the transaction was recorded in, little-endian.
Used in:
The number of the input, starting from zero.
The related outpoint.
An unlocking script asserting a transaction is permitted to spend the Outpoint (UTXO)
As of BIP-68, the sequence number is interpreted as a relative lock-time for the input.
Amount in satoshi.
The pubkey_script of the previous output that is being spent.
The bitcoin addresses associated with this input.
Used in:
, , , ,The hash of the transaction containing the output to be spent, little-endian
The index of specific output on the transaction.
Used in:
The number of the output, starting from zero.
The number of satoshis to be transferred.
The public key script used to pay coins.
The bitcoin addresses associated with this output.
The type of script.
The script expressed in Bitcoin Cash Script.
Used in:
Filter by address(es)
Filter by output hash and index.
Filter by data elements contained in pubkey scripts.
Subscribed/Unsubscribe to everything. Other filters will be ignored.
Subscribed/Unsubscribe to everything slp. Other filters will be ignored, except this filter will be overriden by all_transactions=true
only transactions associated with the included tokenIds
Used as response type in: bchrpc.SubscribeTransactionStream, bchrpc.SubscribeTransactions
Whether or not the transaction has been included in a block.
A transaction included in a block.
A transaction in mempool.
Binary transaction, serialized using bitcoin protocol encoding.
State of the transaction acceptance.
Used in:
A transaction in mempool.
A transaction in a block.
Used in:
A reference to the output given by transaction hash and index.
The public key script used to pay coins.
The amount in satoshis
When is_coinbase is true, the output is the first in the block, a generation transaction, the result of mining.
The block number containing the UXTO.