This is a list of JSON2.0 RPC calls to be used with Oxen Service Nodes, along with examples of each.
Get the quorum state which is the list of public keys of the nodes who are voting, and the list of public keys of the nodes who are being tested.
Testnet Example
Result
Nodes have been omitted with “...” for brevity in nodes_to_test and quorum_nodes.
Inputs
Int height
The height to query the quorum state for
Outputs
String[] nodes_to_test
An array of public keys identifying service nodes which are being tested for the queried height.
String[] quorum_state
An array of public keys identifying service nodes which are responsible for voting on the queried height.
Get the required amount of $OXEN to become an Oxen Service Node at the queried height. For stagenet and testnet values, ensure the daemon is started with the --stagenet or --testnet flags respectively.
Testnet Example
Result
Inputs
Int height
The height to query the staking requirement for
Outputs
Uint64 staking_requirement
The staking requirement in Oxen atomic units for the queried height
Get the service node public key of the queried daemon. The daemon must be started in --service-node mode otherwise this RPC command will fail.
Testnet Example
Result
Inputs
N/A
Outputs
String service_node_pubkey
The public key identifying the queried service node
get_service_nodes
Get the metadata currently associated with the queried service node public keys such as, registration height and contributors, etc. If no public key is specified, this returns all the metadata for every service node the queried daemon currently knows about.
Testnet Example
Result
Inputs
String[] service_node_pubkeys
An array of service node public keys in strings that you wish to query metadata for. If an empty array is given, this RPC command returns all service nodes it knows about.
Outputs
Entry[] service_node_states
The array of metadata for the queried service node(s)
String service_node_pubkey
The queried service node’s identifying public key
Uint64 registration_height
The height at which the registration transaction arrived on the blockchain
Uint64 last_reward_block_height
The last block height this service node received a reward. Rewards are sent to service nodes whom have been waiting longest since their last reward and are then sent to the back of the queue.
Uint64 last_reward_transaction_index
The position in the queue to receive a reward for the service nodes grouped in the last_reward_block_height.
Uint64 last_uptime_proof
Unix epoch timestamp of the last time this daemon has received a ping from the queried service node.
Contribution[] contributors
An array consisting of all the addresses that have contributed to the queried service node.
Uint64 Contribution.amount
The amount of $OXEN in atomic units the contributor has staked.
Uint64 Contribution.reserved
The amount of $OXEN in atomic units the contributor has reserved and must fulfill to completely contribute their part to the service node. Amount is equal to reserved once the contributor has fully contributed their part.
String Contribution.address
The $OXEN address that funds must come from to fulfill the contribution requirement.
Uint64 total_contributed
The total $OXEN currently contributed going towards the staking requirement.
Uint64 total_reserved
The total $OXEN that has been reserved by all contributors. The remaining $OXEN is open for other contributors to increase their stake towards the service node.
Uint64 portions_for_operator
The operator cut expressed as a value from 0 -> STAKING_PORTIONS (defined in oxen/src/cryptonote_config.h) which is the fee taken from the service node reward and given to the operator address before rewards are distributed to the contributors.
Uint64 operator_address
The wallet address which is the primary owner of the service node and also the address which the operator cut is sent to.
This is a list of the oxen-wallet-rpc calls, their inputs and outputs, and examples of each. The program oxen-wallet-rpc replaced the rpc interface that was in simplewallet and then oxen-wallet-cli.
All oxen-wallet-rpc methods use the same JSON RPC interface. For example:
If the oxen-wallet-rpc was executed with the --rpc-login
argument as username:password
, then follow this example:
Note: "atomic units" refer to the smallest fraction of 1 $OXEN according to the oxend implementation. 1 $OXEN = 1e9 atomic units.
get_balance
get_address
get_address_index
create_address
label_address
get_accounts
create_account
label_account
get_account_tags
tag_accounts
untag_accounts
set_account_tag_description
get_height
transfer
transfer_split
sign_transfer
submit_transfer
sweep_dust
sweep_all
sweep_single
relay_tx
store
get_payments
get_bulk_payments
incoming_transfers
query_key
make_integrated_address
split_integrated_address
stop_wallet
rescan_blockchain
set_tx_notes
get_tx_notes
set_attribute
get_attribute
get_tx_key
check_tx_key
get_tx_proof
check_tx_proof
get_spend_proof
check_spend_proof
get_reserve_proof
check_reserve_proof
get_transfers
get_transfer_by_txid
sign
verify
export_outputs
import_outputs
export_key_images
import_key_images
make_uri
parse_uri
get_address_book
add_address_book
delete_address_book
refresh
rescan_spent
start_mining
stop_mining
get_languages
create_wallet
open_wallet
close_wallet
change_wallet_password
is_multisig
prepare_multisig
make_multisig
export_multisig_info
import_multisig_info
finalize_multisig
sign_multisig
submit_multisig
get_version
Return the wallet's balance.
Alias: getbalance.
Inputs:
account_index - unsigned int; Return balance for this account.
address_indices - array of unsigned int; (Optional) Return balance detail for those subaddresses.
Outputs:
balance - unsigned int; The total balance of the current Oxen-wallet-rpc in session.
unlocked_balance - unsigned int; Unlocked funds are those funds that are sufficiently deep enough in the Oxen blockchain to be considered safe to spend.
multisig_import_needed - boolean; True if importing multisig data is needed for returning a correct balance.
per_subaddress - array of subaddress information; Balance information for each subaddress in an account.
address_index - unsigned int; Index of the subaddress in the account.
address - string; Address at this index. Base58 representation of the public keys.
balance - unsigned int; Balance for the subaddress (locked or unlocked).
unlocked_balance - unsigned int; Unlocked balance for the subaddress.
label - string; Label for the subaddress.
num_unspent_outputs - unsigned int; Number of unspent outputs available for the subaddress.
Example:
Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses.
Alias: getaddress.
Inputs:
account_index - unsigned int; Return subaddresses for this account.
address_index - array of unsigned int; (Optional) List of subaddresses to return from an account.
Outputs:
address - string; The 95-character hex address string of the oxen-wallet-rpc in session.
addresses array of addresses informations
address string; The 95-character hex (sub)address string.
label string; Label of the (sub)address
address_index unsigned int; index of the subaddress
used boolean; states if the (sub)address has already received funds
Example:
Get account and address indexes from a specific (sub)address
Alias: None.
Inputs:
address - String; (sub)address to look for.
Outputs:
index - subaddress informations
major unsigned int; Account index.
minor unsigned int; Address index.
Example:
Create a new address for an account. Optionally, label the new address.
Alias: None.
Inputs:
account_index - unsigned int; Create a new address for this account.
label - string; (Optional) Label for the new address.
Outputs:
address - string; Newly created address. Base58 representation of the public keys.
address_index - unsigned int; Index of the new address under the input account.
Example:
Label an address.
Alias: None.
Inputs:
index - subaddress index; JSON Object containing the major & minor address index:
major - unsigned int; Account index for the subaddress.
minor - unsigned int; Index of the subaddress in the account.
label - string; Label for the address.
Outputs: None.
Example:
Get all accounts for a wallet. Optionally filter accounts by tag.
Alias: None.
Inputs:
tag - string; (Optional) Tag for filtering accounts.
Outputs:
subaddress_accounts - array of subaddress account information:
account_index - unsigned int; Index of the account.
balance - unsigned int; Balance of the account (locked or unlocked).
base_address - string; Base64 representation of the first subaddress in the account.
label - string; (Optional) Label of the account.
tag - string; (Optional) Tag for filtering accounts.
unlocked_balance - unsigned int; Unlocked balance for the account.
total_balance - unsigned int; Total balance of the selected accounts (locked or unlocked).
total_unlocked_balance - unsigned int; Total unlocked balance of the selected accounts.
Example:
Create a new account with an optional label.
Alias: None.
Inputs:
label - string; (Optional) Label for the account.
Outputs:
account_index - unsigned int; Index of the new account.
address - string; Address for this account. Base58 representation of the public keys.
Example:
Label an account.
Alias: None.
Inputs:
account_index - unsigned int; Apply label to account at this index.
label - string; Label for the account.
Outputs: None.
Example:
Get a list of user-defined account tags.
Alias: None.
Inputs: None.
Outputs:
account_tags - array of account tag information:
tag - string; Filter tag.
label - string; Label for the tag.
accounts - array of int; List of tagged account indices.
Example:
Apply a filtering tag to a list of accounts.
Alias: None.
Inputs:
tag - string; Tag for the accounts.
accounts - array of unsigned int; Tag this list of accounts.
Outputs: None.
Example:
Remove filtering tag from a list of accounts.
Alias: None.
Inputs:
accounts - array of unsigned int; Remove tag from this list of accounts.
Outputs: None.
Example:
Set description for an account tag.
Alias: None.
Inputs:
tag - string; Set a description for this tag.
description - string; Description for the tag.
Outputs: None.
Example:
Returns the wallet's current block height.
Alias: getheight.
Inputs: None.
Outputs:
height - unsigned int; The current oxen-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon.
Example:
Send $OXEN to a number of recipients.
Alias: None.
Inputs:
destinations - array of destinations to receive $OXEN:
amount - unsigned int; Amount to send to each destination, in atomic units.
address - string; Destination public address.
account_index - unsigned int; (Optional) Transfer from this account index. (Defaults to 0)
subaddr_indices - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to 0)
priority - unsigned int; Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority.
mixin - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing).
ring_size - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain).
unlock_time - unsigned int; Number of blocks before the $OXEN can be spent (0 to not add a lock).
payment_id - string; (Optional) Random 32-byte/64-character hex string to identify a transaction.
get_tx_key - boolean; (Optional) Return the transaction key after sending.
do_not_relay - boolean; (Optional) If true, the newly created transaction will not be relayed to the Oxen network. (Defaults to false)
get_tx_hex - boolean; Return the transaction as hex string after sending (Defaults to false)
get_tx_metadata - boolean; Return the metadata needed to relay the transaction. (Defaults to false)
Outputs:
amount - Amount transferred for the transaction.
fee - Integer value of the fee charged for the txn.
multisig_txset - Set of multisig transactions in the process of being signed (empty for non-multisig).
tx_blob - Raw transaction represented as hex string, if get_tx_hex is true.
tx_hash - String for the publically searchable transaction hash.
tx_key - String for the transaction key if get_tx_key is true, otherwise, blank string.
tx_metadata - Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true.
unsigned_txset - String. Set of unsigned tx for cold-signing purposes.
Example:
Same as transfer, but can split into more than one tx if necessary.
Alias: None.
Inputs:
destinations - array of destinations to receive $OXEN:
amount - unsigned int; Amount to send to each destination, in atomic units.
address - string; Destination public address.
account_index - unsigned int; (Optional) Transfer from this account index. (Defaults to 0)
subaddr_indices - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to 0)
mixin - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing).
ring_size - unsigned int; Sets ringsize to n (mixin + 1).
unlock_time - unsigned int; Number of blocks before the $OXEN can be spent (0 to not add a lock).
payment_id - string; (Optional) Random 32-byte/64-character hex string to identify a transaction.
get_tx_keys - boolean; (Optional) Return the transaction keys after sending.
priority - unsigned int; Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority.
do_not_relay - boolean; (Optional) If true, the newly created transaction will not be relayed to the Oxen network. (Defaults to false)
get_tx_hex - boolean; Return the transactions as hex string after sending
new_algorithm - boolean; True to use the new transaction construction algorithm, defaults to false.
get_tx_metadata - boolean; Return list of transaction metadata needed to relay the transfer later.
Outputs:
tx_hash_list - array of: string. The tx hashes of every transaction.
tx_key_list - array of: string. The transaction keys for every transaction.
amount_list - array of: integer. The amount transferred for every transaction.
fee_list - array of: integer. The amount of fees paid for every transaction.
tx_blob_list - array of: string. The tx as hex string for every transaction.
tx_metadata_list - array of: string. List of transaction metadata needed to relay the transactions later.
multisig_txset - string. The set of signing keys used in a multisig transaction (empty for non-multisig).
unsigned_txset - string. Set of unsigned tx for cold-signing purposes.
Example:
Sign a transaction created on a read-only wallet (in cold-signing process)
Alias: None.
Inputs:
unsigned_txset - string. Set of unsigned tx returned by "transfer" or "transfer_split" methods.
export_raw - boolean; (Optional) If true, return the raw transaction data. (Defaults to false)
Outputs:
signed_txset - string. Set of signed tx to be used for submitting transfer.
tx_hash_list - array of: string. The tx hashes of every transaction.
tx_raw_list - array of: string. The tx raw data of every transaction.
In the example below, we first generate an unsigned_txset on a read only wallet before signing it:
Generate unsigned_txset using the above "transfer" method on read-only wallet:
Sign tx using the previously generated unsigned_txset
Submit a previously signed transaction on a read-only wallet (in cold-signing process).
Alias: None.
Inputs:
tx_data_hex - string; Set of signed tx returned by "sign_transfer"
Outputs:
tx_hash_list - array of: string. The tx hashes of every transaction.
In the example below, we submit the transfer using the signed_txset generated above:
Send all dust outputs back to the wallet's, to make them easier to spend (and mix).
Alias: sweep_unmixable.
Inputs:
get_tx_keys - boolean; (Optional) Return the transaction keys after sending.
do_not_relay - boolean; (Optional) If true, the newly created transaction will not be relayed to the Oxen network. (Defaults to false)
get_tx_hex - boolean; (Optional) Return the transactions as hex string after sending. (Defaults to false)
get_tx_metadata - boolean; (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false)
Outputs:
tx_hash_list - array of: string. The tx hashes of every transaction.
tx_key_list - array of: string. The transaction keys for every transaction.
amount_list - array of: integer. The amount transferred for every transaction.
fee_list - array of: integer. The amount of fees paid for every transaction.
tx_blob_list - array of: string. The tx as hex string for every transaction.
tx_metadata_list - array of: string. List of transaction metadata needed to relay the transactions later.
multisig_txset - string. The set of signing keys used in a multisig transaction (empty for non-multisig).
unsigned_txset - string. Set of unsigned tx for cold-signing purposes.
Example (In this example, sweep_dust
returns nothing because there are no funds to sweep):
Send all unlocked balance to an address.
Alias: None.
Inputs:
address - string; Destination public address.
account_index - unsigned int; Sweep transactions from this account.
subaddr_indices - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account.
priority - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee.
mixin - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing).
ring_size - unsigned int; Sets ringsize to n (mixin + 1).
unlock_time - unsigned int; Number of blocks before the $OXEN can be spent (0 to not add a lock).
payment_id - string; (Optional) Random 32-byte/64-character hex string to identify a transaction.
get_tx_keys - boolean; (Optional) Return the transaction keys after sending.
below_amount - unsigned int; (Optional) Include outputs below this amount.
do_not_relay - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false)
get_tx_hex - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false)
get_tx_metadata - boolean; (Optional) return the transaction metadata as a string. (Defaults to false)
Outputs:
tx_hash_list - array of: string. The tx hashes of every transaction.
tx_key_list - array of: string. The transaction keys for every transaction.
amount_list - array of: integer. The amount transferred for every transaction.
fee_list - array of: integer. The amount of fees paid for every transaction.
tx_blob_list - array of: string. The tx as hex string for every transaction.
tx_metadata_list - array of: string. List of transaction metadata needed to relay the transactions later.
multisig_txset - string. The set of signing keys used in a multisig transaction (empty for non-multisig).
unsigned_txset - string. Set of unsigned tx for cold-signing purposes.
Example:
Send all of a specific unlocked output to an address.
Alias: None.
Inputs:
address - string; Destination public address.
account_index - unsigned int; Sweep transactions from this account.
subaddr_indices - array of unsigned int; (Optional) Sweep from this set of subaddresses in the account.
priority - unsigned int; (Optional) Priority for sending the sweep transfer, partially determines fee.
mixin - unsigned int; Number of outputs from the blockchain to mix with (0 means no mixing).
ring_size - unsigned int; Sets ringsize to n (mixin + 1).
unlock_time - unsigned int; Number of blocks before the $OXEN can be spent (0 to not add a lock).
payment_id - string; (Optional) Random 32-byte/64-character hex string to identify a transaction.
get_tx_keys - boolean; (Optional) Return the transaction keys after sending.
key_image - string; Key image of specific output to sweep.
below_amount - unsigned int; (Optional) Include outputs below this amount.
do_not_relay - boolean; (Optional) If true, do not relay this sweep transfer. (Defaults to false)
get_tx_hex - boolean; (Optional) return the transactions as hex encoded string. (Defaults to false)
get_tx_metadata - boolean; (Optional) return the transaction metadata as a string. (Defaults to false)
Outputs:
tx_hash_list - array of: string. The tx hashes of every transaction.
tx_key_list - array of: string. The transaction keys for every transaction.
amount_list - array of: integer. The amount transferred for every transaction.
fee_list - array of: integer. The amount of fees paid for every transaction.
tx_blob_list - array of: string. The tx as hex string for every transaction.
tx_metadata_list - array of: string. List of transaction metadata needed to relay the transactions later.
multisig_txset - string. The set of signing keys used in a multisig transaction (empty for non-multisig).
unsigned_txset - string. Set of unsigned tx for cold-signing purposes.
Example:
Relay a transaction previously created with "do_not_relay":true
.
Alias: None.
Inputs:
hex - string; transaction metadata returned from a transfer
method with get_tx_metadata
set to true
.
Outputs:
tx_hash - String for the publically searchable transaction hash.
Example:
Save the wallet file.
Alias: None.
Inputs: None.
Outputs: None.
Example:
Get a list of incoming payments using a given payment id.
Alias: None.
Inputs:
payment_id - string; Payment ID used to find the payments (16 characters hex).
Outputs:
payments - list of:
payment_id - string; Payment ID matching the input parameter.
tx_hash - string; Transaction hash used as the transaction ID.
amount - unsigned int; Amount for this payment.
block_height - unsigned int; Height of the block that first confirmed this payment.
unlock_time - unsigned int; Time (in block height) until this payment is safe to spend.
subaddr_index - subaddress index:
major - unsigned int; Account index for the subaddress.
minor - unsigned int; Index of the subaddress in the account.
address - string; Address receiving the payment; Base58 representation of the public keys.
Example:
Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over get_payments
because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID.
Alias: None.
Inputs:
payment_ids - array of: string; Payment IDs used to find the payments (16 characters hex).
min_block_height - unsigned int; The block height at which to start looking for payments.
Outputs:
payments - list of:
payment_id - string; Payment ID matching one of the input IDs.
tx_hash - string; Transaction hash used as the transaction ID.
amount - unsigned int; Amount for this payment.
block_height - unsigned int; Height of the block that first confirmed this payment.
unlock_time - unsigned int; Time (in block height) until this payment is safe to spend.
subaddr_index - subaddress index:
major - unsigned int; Account index for the subaddress.
minor - unsigned int; Index of the subaddress in the account.
address - string; Address receiving the payment; Base58 representation of the public keys.
Example:
Return a list of incoming transfers to the wallet.
Inputs:
transfer_type - string; "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent.
account_index - unsigned int; (Optional) Return transfers for this account. (defaults to 0)
subaddr_indices - array of unsigned int; (Optional) Return transfers sent to these subaddresses.
verbose - boolean; (Optional) Enable verbose output, return key image if true.
Outputs:
transfers - list of:
amount - unsigned int; Amount of this transfer.
global_index - unsigned int; Mostly internal use, can be ignored by most users.
key_image - string; Key image for the incoming transfer's unspent output (empty unless verbose is true).
spent - boolean; Indicates if this transfer has been spent.
subaddr_index - unsigned int; Subaddress index for incoming transfer.
tx_hash - string; Several incoming transfers may share the same hash if they were in the same transaction.
tx_size - unsigned int; Size of transaction in bytes.
Example, get all transfers:
Example, get available transfers:
Example, get unavailable transfers:
Return the spend or view private key.
Alias: None.
Inputs:
key_type - string; Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets do not have one) OR "view_key" - the view key
Outputs:
key - string; The view key will be hex encoded, while the mnemonic will be a string of words.
Example (Query view key):
Example (Query mnemonic key):
Make an integrated address from the wallet address and a payment id.
Alias: None.
Inputs:
standard_address - string; (Optional, defaults to primary address) Destination public address.
payment_id - string; (Optional, defaults to a random ID) 16 characters hex encoded.
Outputs:
integrated_address - string
payment_id - string; hex encoded;
Example (Payment ID is empty, use a random ID):
Retrieve the standard address and payment id corresponding to an integrated address.
Alias: None.
Inputs:
integrated_address - string
Outputs:
is_subaddress - boolean; States if the address is a subaddress
payment - string; hex encoded
standard_address - string
Example:
Stops the wallet, storing the current state.
Alias: None.
Inputs: None.
Outputs: None.
Example:
Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself. This includes destination addresses, tx secret keys, tx notes, etc.
Alias: None.
Inputs: None.
Outputs: None.
Example:
Set arbitrary string notes for transactions.
Alias: None.
Inputs:
txids - array of string; transaction ids
notes - array of string; notes for the transactions
Outputs: None.
Example:
Get string notes for transactions.
Alias: None.
Inputs:
txids - array of string; transaction ids
Outputs:
notes - array of string; notes for the transactions
Example:
Set arbitrary attribute.
Alias: None.
Inputs:
key - string; attribute name
value - string; attribute value
Outputs: None.
Example:
Get attribute value by name.
Alias: None.
Inputs:
key - string; attribute name
Outputs:
value - string; attribute value
Example:
Get transaction secret key from transaction id.
Alias: None.
Inputs:
txid - string; transaction id.
Outputs:
tx_key - string; transaction secret key.
Example:
Check a transaction in the blockchain with its secret key.
Alias: None.
Inputs:
txid - string; transaction id.
tx_key - string; transaction secret key.
address - string; destination public address of the transaction.
Outputs:
confirmations - unsigned int; Number of block mined after the one with the transaction.
in_pool - boolean; States if the transaction is still in pool or has been added to a block.
received - unsigned int; Amount of the transaction.
Example:
Get transaction signature to prove it.
Alias: None.
Inputs:
txid - string; transaction id.
address - string; destination public address of the transaction.
message - string; (Optional) add a message to the signature to further authenticate the prooving process.
Outputs:
signature - string; transaction signature.
Example:
Prove a transaction by checking its signature.
Alias: None.
Inputs:
txid - string; transaction id.
address - string; destination public address of the transaction.
message - string; (Optional) Should be the same message used in get_tx_proof
.
signature - string; transaction signature to confirm.
Outputs:
confirmations - unsigned int; Number of block mined after the one with the transaction.
good - boolean; States if the inputs proves the transaction.
in_pool - boolean; States if the transaction is still in pool or has been added to a block.
received - unsigned int; Amount of the transaction.
In the example below, the transaction has been proven:
In the example below, the wrong message is used, avoiding the transaction to be proved:
Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address.
Alias: None.
Inputs:
txid - string; transaction id.
message - string; (Optional) add a message to the signature to further authenticate the prooving process.
Outputs:
signature - string; spend signature.
Example:
Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address.
Alias: None.
Inputs:
txid - string; transaction id.
message - string; (Optional) Should be the same message used in get_spend_proof
.
signature - string; spend signature to confirm.
Outputs:
good - boolean; States if the inputs proves the spend.
In the example below, the spend has been proven:
In the example below, the wrong message is used, avoiding the spend to be proved:
Generate a signature to prove of an available amount in a wallet.
Alias: None.
Inputs:
all - boolean; Proves all wallet balance to be disposable.
account_index - unsigned int; Specify the account from witch to prove reserve. (ignored if all
is set to true)
amount - unsigned int; Amount (in atomic units) to prove the account has for reserve. (ignored if all
is set to true)
message - string; (Optional) add a message to the signature to further authenticate the prooving process.
Outputs:
signature - string; reserve signature.
Example:
Proves a wallet has a disposable reserve using a signature.
Alias: None.
Inputs:
address - string; Public address of the wallet.
message - string; (Optional) Should be the same message used in get_reserve_proof
.
signature - string; reserve signature to confirm.
Outputs:
good - boolean; States if the inputs proves the reserve.
In the example below, the reserve has been proven:
In the example below, all wallet reserve has been proven:
In the example below, the wrong message is used, avoiding the reserve to be proved:
Returns a list of transfers.
Alias: None.
Inputs:
in - boolean; (Optional) Include incoming transfers.
out - boolean; (Optional) Include outgoing transfers.
pending - boolean; (Optional) Include pending transfers.
failed - boolean; (Optional) Include failed transfers.
pool - boolean; (Optional) Include transfers from the daemon's transaction pool.
filter_by_height - boolean; (Optional) Filter transfers by block height.
min_height - unsigned int; (Optional) Minimum block height to scan for transfers, if filtering by height is enabled.
max_height - unsigned int; (Opional) Maximum block height to scan for transfers, if filtering by height is enabled (defaults to max block height).
account_index - unsigned int; (Optional) Index of the account to query for transfers. (defaults to 0)
subaddr_indices - array of unsigned int; (Optional) List of subaddress indices to query for transfers. (defaults to 0)
Outputs:
in array of transfers:
address - string; Public address of the transfer.
amount - unsigned int; Amount transferred.
confirmations - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed).
double_spend_seen - boolean; True if the key image(s) for the transfer have been seen before.
fee - unsigned int; Transaction fee for this transfer.
height - unsigned int; Height of the first block that confirmed this transfer (0 if not mined yet).
note - string; Note about this transfer.
payment_id - string; Payment ID for this transfer.
subaddr_index - JSON object containing the major & minor subaddress index:
major - unsigned int; Account index for the subaddress.
minor - unsigned int; Index of the subaddress under the account.
suggested_confirmations_threshold - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block.
timestamp - unsigned int; POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet).
txid - string; Transaction ID for this transfer.
type - string; Transfer type: "in"
unlock_time - unsigned int; Number of blocks until transfer is safely spendable.
out array of transfers (see above).
pending array of transfers (see above).
failed array of transfers (see above).
pool array of transfers (see above).
Example:
Show information about a transfer to/from this address.
Alias: None.
Inputs:
txid - string; Transaction ID used to find the transfer.
account_index - unsigned int; (Optional) Index of the account to query for the transfer.
Outputs:
transfer - JSON object containing payment information:
address - string; Address that transferred the funds. Base58 representation of the public keys.
amount - unsigned int; Amount of this transfer.
confirmations - unsigned int; Number of block mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed).
destinations - array of JSON objects containing transfer destinations:
amount - unsigned int; Amount transferred to this destination.
address - string; Address for this destination. Base58 representation of the public keys.
double_spend_seen - boolean; True if the key image(s) for the transfer have been seen before.
fee - unsigned int; Transaction fee for this transfer.
height - unsigned int; Height of the first block that confirmed this transfer.
note - string; Note about this transfer.
payment_id - string; Payment ID for this transfer.
subaddr_index - JSON object containing the major & minor subaddress index:
major - unsigned int; Account index for the subaddress.
minor - unsigned int; Index of the subaddress under the account.
suggested_confirmations_threshold - unsigned int; Estimation of the confirmations needed for the transaction to be included in a block.
timestamp - unsigned int; POSIX timestamp for the block that confirmed this transfer (or timestamp submission if not mined yet).
txid - string; Transaction ID of this transfer (same as input TXID).
type - string; Type of transfer, one of the following: "in", "out", "pending", "failed", "pool"
unlock_time - unsigned int; Number of blocks until transfer is safely spendable.
Example:
Sign a string.
Alias: None.
Inputs:
data - string; Anything you need to sign.
Outputs:
signature - string; Signature generated against the "data" and the account public address.
Example:
Verify a signature on a string.
Alias: None.
Inputs:
data - string; What should have been signed.
address - string; Public address of the wallet used to sign
the data.
signature - string; signature generated by sign
method.
Outputs:
good - boolean;
Example:
Export all outputs in hex format.
Alias: None.
Inputs: None.
Outputs:
outputs_data_hex - string; wallet outputs in hex format.
Example:
Import outputs in hex format.
Alias: None.
Inputs:
outputs_data_hex - string; wallet outputs in hex format.
Outputs:
num_imported - unsigned int; number of outputs imported.
Example:
Export a signed set of key images.
Alias: None.
Inputs: None.
Outputs:
signed_key_images - array of signed key images:
key_image - string;
signature - string;
Example:
Import signed key images list and verify their spent status.
Alias: None.
Inputs:
signed_key_images - array of signed key images:
key_image - string;
signature - string;
Outputs:
height - unsigned int;
spent - unsigned int; Amount (in atomic units) spent from those key images.
unspent - unsigned int; Amount (in atomic units) still available from those key images.
Example:
Create a payment URI using the official URI spec.
Alias: None.
Inputs:
address - string; Wallet address
amount - unsigned int; (optional) the integer amount to receive, in atomicunits
payment_id - string; (optional) 16 or 64 character hexadecimal payment id
recipient_name - string; (optional) name of the payment recipient
tx_description - string; (optional) Description of the reason for the tx
Outputs:
uri - string; This contains all the payment input information as a properly formatted payment URI
Example:
Parse a payment URI to get payment information.
Alias: None.
Inputs:
uri - string; This contains all the payment input information as a properly formatted payment URI
Outputs:
uri - JSON object containing payment information:
address - string; Wallet address
amount - unsigned int; Decimal amount to receive, in coin units (0 if not provided)
payment_id - string; 16 or 64 character hexadecimal payment id (empty if not provided)
recipient_name - string; Name of the payment recipient (empty if not provided)
tx_description - string; Description of the reason for the tx (empty if not provided)
Example:
Retrieves entries from the address book.
Alias: None.
Inputs:
entries - array of unsigned int; indices of the requested address book entries
Outputs:
entries - array of entries:
address - string; Public address of the entry
description - string; Description of this address entry
index - unsigned int;
payment_id - string;
Example:
Add an entry to the address book.
Alias: None.
Inputs:
address - string;
payment_id - (optional) string, defaults to "0000000000000000000000000000000000000000000000000000000000000000";
description - (optional) string, defaults to "";
Outputs:
index - unsigned int; The index of the address book entry.
Example:
Delete an entry from the address book.
Alias: None.
Inputs:
index - unsigned int; The index of the address book entry.
Outputs: None.
Example:
Refresh a wallet after opening.
Alias: None.
Inputs:
start_height - unsigned int; (Optional) The block height from which to start refreshing.
Outputs:
blocks_fetched - unsigned int; Number of new blocks scanned.
received_money - boolean; States if transactions to the wallet have been found in the blocks.
Example:
Rescan the blockchain for spent outputs.
Alias: None.
Inputs: None.
Outputs: None.
Example:
Get a list of available languages for your wallet's seed.
Alias: None.
Inputs: None.
Outputs:
languages - array of string; List of available languages
Example:
Create a new wallet. You need to have set the argument "–wallet-dir" when launching oxen-wallet-rpc to make this work.
Alias: None.
Inputs:
filename - string; Wallet file name.
password - string; (Optional) password to protect the wallet.
language - string; Language for your wallets' seed.
Outputs: None.
Example:
Open a wallet. You need to have set the argument "–wallet-dir" when launching oxen-wallet-rpc to make this work.
Alias: None.
Inputs:
filename - string; wallet name stored in –wallet-dir.
password - string; (Optional) only needed if the wallet has a password defined.
Outputs: None.
Example:
Close the currently opened wallet, after trying to save it.
Alias: None.
Inputs: None.
Outputs: None.
Example:
Change a wallet password.
Alias: None.
Inputs:
old_password - string; (Optional) Current wallet password, if defined.
new_password - string; (Optional) New wallet password, if not blank.
Outputs: None.
Example:
Check if a wallet is a multisig one.
Alias: None.
Inputs: None.
Outputs:
multisig - boolean; States if the wallet is multisig
ready - boolean;
threshold - unsigned int; Amount of signature needed to sign a transfer.
total - unsigned int; Total amount of signature in the multisig wallet.
Example for a non-multisig wallet:
Example for a multisig wallet:
Prepare a wallet for multisig by generating a multisig string to share with peers.
Alias: None.
Inputs: None.
Outputs:
multisig_info - string; Multisig string to share with peers to create the multisig wallet.
Example:
Make a wallet multisig by importing peers multisig string.
Alias: None.
Inputs:
multisig_info - array of string; List of multisig string from peers.
threshold - unsigned int; Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in multisig_info
.
password - string; Wallet password
Outputs:
address - string; multisig wallet address.
multisig_info - string; Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets).
Example for 2/2 Multisig Wallet:
Example for 2/3 Multisig Wallet:
Export multisig info for other participants.
Alias: None.
Inputs: None.
Outputs:
info - string; Multisig info in hex format for other participants.
Example:
Import multisig info from other participants.
Alias: None.
Inputs:
info - array of string; List of multisig info in hex format from other participants.
Outputs:
n_outputs - unsigned int; Number of outputs signed with those multisig info.
Example:
Turn this wallet into a multisig wallet, extra step for N-1/N wallets.
Alias: None.
Inputs:
multisig_info - array of string; List of multisig string from peers.
password - string; Wallet password
Outputs:
address - string; multisig wallet address.
Example:
Sign a transaction in multisig.
Alias: None.
Inputs:
tx_data_hex - string; Multisig transaction in hex format, as returned by transfer
under multisig_txset
.
Outputs:
tx_data_hex - string; Multisig transaction in hex format.
tx_hash_list - array of string; List of transaction Hash.
Example:
Submit a signed multisig transaction.
Alias: None.
Inputs:
tx_data_hex - string; Multisig transaction in hex format, as returned by sign_multisig
under tx_data_hex
.
Outputs:
tx_hash_list - array of string; List of transaction Hash.
Example:
Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits.
Alias: None.
Inputs: None.
Outputs:
version - unsigned int; RPC version, formatted with Major * 2^16 + Minor
(Major encoded over the first 16 bits, and Minor over the last 16 bits).
Example:
This is a list of the oxend daemon RPC calls, their inputs and outputs, and examples of each.
Many RPC calls use the daemon's JSON RPC interface while others use their own interfaces, as demonstrated below.
Note: "atomic units" refer to the smallest fraction of 1 $OXEN according to the oxend implementation. 1 $OXEN = 1e12 atomic units.
The majority of oxend RPC calls use the daemon's json_rpc
interface to request various bits of information. These methods all follow a similar structure, for example:
Some methods include parameters, while others do not. Examples of each JSON RPC method follow.
Look up how many blocks are in the longest chain known to the node.
Alias: getblockcount.
Inputs: None.
Outputs:
count - unsigned int; Number of blocks in longest chain seen by the node.
status - string; General RPC error code. "OK" means everything looks good.
Example:
Look up a block's hash by its height.
Alias: on_getblockhash.
Inputs:
block height (int array of length 1)
Outputs:
block hash (string)
Example:
Get a block template on which mining a new block.
Alias: getblocktemplate.
Inputs:
wallet_address - string; Address of wallet to receive coinbase transactions if block is successfully mined.
reserve_size - unsigned int; Reserve size.
Outputs:
blocktemplate_blob - string; Blob on which to try to mine a new block.
blockhashing_blob - string; Blob on which to try to find a valid nonce.
difficulty - unsigned int; Difficulty of next block.
expected_reward - unsigned int; Coinbase reward expected to be received if block is successfully mined.
height - unsigned int; Height on which to mine.
prev_hash - string; Hash of the most recent block on which to mine the next block.
reserved_offset - unsigned int; Reserved offset.
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Submit a mined block to the network.
Alias: submitblock.
Inputs:
Outputs:
status - string; Block submit status.
In this example, a block blob which has not been mined is submitted:
Block header information for the most recent block is easily retrieved with this method. No inputs are needed.
Alias: getlastblockheader.
Inputs: None.
Outputs:
block_header - A structure containing block header information.
block_size - unsigned int; The block size in bytes.
depth - unsigned int; The number of blocks succeeding this block on the blockchain. A larger number means an older block.
difficulty - unsigned int; The strength of the Oxen network
hash - string; The hash of this block.
height - unsigned int; The number of blocks preceding this block on the blockchain.
major_version - unsigned int; The major version of the Oxen protocol at this block height.
minor_version - unsigned int; The minor version of the Oxen protocol at this block height.
nonce - unsigned int; a cryptographic random one-time number used in mining a $OXEN block.
num_txes - unsigned int; Number of transactions in the block, not counting the coinbase tx.
orphan_status - boolean; Usually false
. If true
, this block is not part of the longest chain.
prev_hash - string; The hash of the block immediately preceding this block in the chain.
reward - unsigned int; The amount of new generated in this block and rewarded to the miner. Note: 1 $OXEN = 1e12 atomic units.
timestamp - unsigned int; The unix time at which the block was recorded into the blockchain.
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
In this example, the most recent block (1562023 at the time) is returned:
Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block.
Alias: getblockheaderbyhash.
Inputs:
hash - string; The block's sha256 hash.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
In this example, block 912345 is looked up by its hash:
Alias: getblockheaderbyheight.
Inputs:
height - unsigned int; The block's height.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
In this example, block 912345 is looked up by its height (notice that the returned information is the same as in the previous example):
Alias: getblockheadersrange.
Inputs:
start_height - unsigned int; The starting block's height.
end_height - unsigned int; The ending block's height.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
In this example, blocks range from height 1545999 to 1546000 is looked up (notice that the returned informations are ascending order and that it is at the April 2018 network upgrade time):
Full block information can be retrieved by either block height or hash, like with the above block header calls. For full block information, both lookups use the same method, but with different input parameters.
Alias: getblock.
Inputs (pick one of the following):
height - unsigned int; The block's height.
hash - string; The block's hash.
Outputs:
blob - string; Hexadecimal blob of block information.
json - json string; JSON formatted block details:
major_version - Same as in block header.
minor_version - Same as in block header.
timestamp - Same as in block header.
prev_id - Same as prev_hash
in block header.
nonce - Same as in block header.
miner_tx - Miner transaction information
version - Transaction version number.
unlock_time - The block height when the coinbase transaction becomes spendable.
vin - List of transaction inputs:
gen - Miner txs are coinbase txs, or "gen".
height - This block height, a.k.a. when the coinbase is generated.
vout - List of transaction outputs. Each output contains:
amount - The amount of the output, in atomic units.
target -
key -
extra - Usually called the "transaction ID" but can be used to include any random 32 byte/64 character hex string.
signatures - Contain signatures of tx signers. Coinbased txs do not have signatures.
tx_hashes - List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list.
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Look up by height:
In the following example, block 912345 is looked up by its height. Note that block 912345 does not have any non-coinbase transactions. (See the next example for a block with extra transactions):
Look up by hash:
In the following example, block 993056 is looked up by its hash. Note that block 993056 has 3 non-coinbase transactions:
Retrieve information about incoming and outgoing connections to your node.
Alias: None.
Inputs: None.
Outputs:
connections - List of all connections and their info:
address - string; The peer's address, actually IPv4 & port
avg_download - unsigned int; Average bytes of data downloaded by node.
avg_upload - unsigned int; Average bytes of data uploaded by node.
connection_id - string; The connection ID
current_download - unsigned int; Current bytes downloaded by node.
current_upload - unsigned int; Current bytes uploaded by node.
height- unsigned int; The peer height
host - string; The peer host
incoming - boolean; Is the node getting information from your node?
ip - string; The node's IP address.
live_time - unsigned int
local_ip - boolean
localhost - boolean
peer_id - string; The node's ID on the network.
port - string; The port that the node is using to connect to the network.
recv_count - unsigned int
recv_idle_time - unsigned int
send_count - unsigned int
send_idle_time - unsigned int
state - string
support_flags - unsigned int
Following is an example of get_connections
and it's return:
Retrieve general information about the state of your node and the network.
Alias:
/get_info
/getinfo
Inputs: None.
Outputs:
alt_blocks_count - unsigned int; Number of alternative blocks to main chain.
block_size_limit - unsigned int; Maximum allowed block size
block_size_median - unsigned int; Median block size of latest 100 blocks
cumulative_difficulty - unsigned int; Cumulative difficulty of all blocks in the blockchain.
difficulty - unsigned int; Network difficulty (analogous to the strength of the network)
free_space - unsigned int; Available disk space on the node.
grey_peerlist_size - unsigned int; Grey Peerlist Size
height - unsigned int; Current length of longest chain known to daemon.
height_without_bootstrap - unsigned int; Current length of the local chain of the daemon.
incoming_connections_count - unsigned int; Number of peers connected to and pulling from your node.
mainnet - boolean; States if the node is on the mainnet (true
) or not (false
).
offline - boolean; States if the node is offline (true
) or online (false
).
outgoing_connections_count - unsigned int; Number of peers that you are connected to and getting information from.
rpc_connections_count - unsigned int; Number of RPC client connected to the daemon (Including this RPC request).
stagenet - boolean; States if the node is on the stagenet (true
) or not (false
).
start_time - unsigned int; Start time of the daemon, as UNIX time.
status - string; General RPC error code. "OK" means everything looks good.
target - unsigned int; Current target for next proof of work.
target_height - unsigned int; The height of the next block in the chain.
testnet - boolean; States if the node is on the testnet (true
) or not (false
).
top_block_hash - string; Hash of the highest block in the chain.
tx_count - unsigned int; Total number of non-coinbase transaction in the chain.
tx_pool_size - unsigned int; Number of transactions that have been broadcast but not included in a block.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
was_bootstrap_ever_used - boolean; States if a bootstrap node has ever been used since the daemon started.
white_peerlist_size - unsigned int; White Peerlist Size
Following is an example get_info
call and its return:
Look up information regarding hard fork voting and readiness.
Alias: None.
Inputs: None.
Outputs:
earliest_height - unsigned int; Block height at which hard fork would be enabled if voted in.
enabled - boolean; Tells if hard fork is enforced.
state - unsigned int; Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good).
status - string; General RPC error code. "OK" means everything looks good.
threshold - unsigned int; Minimum percent of votes to trigger hard fork. Default is 80.
version - unsigned int; The major block version for the fork.
votes - unsigned int; Number of votes towards hard fork.
voting - unsigned int; Hard fork voting status.
window - unsigned int; Number of blocks over which current votes are cast. Default is 10080 blocks.
Example:
Ban another node by IP.
Alias: None.
Inputs:
bans - A list of nodes to ban:
host - string; Host to ban (IP in A.B.C.D form - will support I2P address in the future).
ip - unsigned int; IP address to ban, in Int format.
ban - boolean; Set true
to ban.
seconds - unsigned int; Number of seconds to ban node.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Examples:
banning by host
In the following example, host is banned with its IP address string-formatted as A.B.C.D:
banning by ip
In the following example, integer-formatted IP is banned:
Get list of banned IPs.
Alias: None.
Inputs: None.
Outputs:
bans - List of banned nodes:
host - string; Banned host (IP in A.B.C.D form).
ip - unsigned int; Banned IP address, in Int format.
seconds - unsigned int; Local Unix time that IP is banned until.
status - string; General RPC error code. "OK" means everything looks good.
Example:
Flush tx ids from transaction pool
Alias: None.
Inputs:
txids - array of strings; Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty).
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Example:
Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. RingCT outputs counts as 0 amount.
Inputs:
amounts - list of unsigned int
min_count - unsigned int
max_count - unsigned int
unlocked - boolean
recent_cutoff - unsigned int
Outputs:
histogram - list of histogram entries, in the following structure:
amount - unsigned int; Output amount in atomic units
total_instances - unsigned int;
unlocked_instances - unsigned int;
recent_instances - unsigned int;
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Get the coinbase ammount and the fees ammount for n last blocks starting at particular height
Alias: None.
Inputs:
height - unsigned int; Block height from which getting the amounts
count - unsigned int; number of blocks to include in the sum
Outputs:
emission_amount - unsigned int; amount of coinbase reward in atomic units
fee_amount - unsigned int; amount of fees in atomic units
status - string; General RPC error code. "OK" means everything looks good.
Example:
Give the node current version
Alias: None.
Inputs: None.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
version - unsigned int;
Example:
Gives an estimation on fees per kB.
Alias: None.
Inputs:
grace_blocks - unsigned int; Optional
Outputs:
fee - unsigned int; Amount of fees estimated per kB in atomic units
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Display alternative chains seen by the node.
Alias: None.
Inputs: None.
Outputs:
chains - array of chains, the following structure:
block_hash - string; the block hash of the first diverging block of this alternative chain.
difficulty - unsigned int; the cumulative difficulty of all blocks in the alternative chain.
height - unsigned int; the block height of the first diverging block of this alternative chain.
length - unsigned int; the length in blocks of this alternative chain, after divergence.
status - string; General RPC error code. "OK" means everything looks good.
Example:
Relay a list of transaction IDs.
Alias: None.
Inputs:
txids - array of string; list of transaction IDs to relay
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Example:
Get synchronisation informations
Alias: None.
Inputs: None.
Outputs:
height - unsigned int;
peers - array of peer structure, defined as follows:
spans - array of span structure, defined as follows (optional, absent if node is fully synced):
connection_id - string; Id of connection
nblocks - unsigned int; number of blocks in that span
rate - unsigned int; connection rate
remote_address - string; peer address the node is downloading (or has downloaded) than span from
size - unsigned int; total number of bytes in that span's blocks (including txes)
speed - unsigned int; connection speed
start_block_height - unsigned int; block height of the first block in that span
status - string; General RPC error code. "OK" means everything looks good.
target_height - unsigned int; target height the node is syncing from (optional, absent if node is fully synced)
Example:
Get all transaction pool backlog
Alias: None.
Inputs: None.
Outputs:
backlog: array of structures tx_backlog_entry (in binary form):
blob_size - unsigned int (in binary form)
fee - unsigned int (in binary form)
time_in_pool - unsigned int (in binary form)
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Alias: None.
Inputs:
amounts - array of unsigned int; amounts to look for
cumulative - boolean; (optional, default is false
) States if the result should be cumulative (true
) or not (false
)
from_height - unsigned int; (optional, default is 0) starting height to check from
to_height - unsigned int; (optional, default is 0) ending height to check up to
Outputs:
distributions - array of structure distribution as follows:
amount - unsigned int
base - unsigned int
distribution - array of unsigned int
start_height - unsigned int
status - string; General RPC error code. "OK" means everything looks good.
Example:
Not all daemon RPC calls use the JSON_RPC interface. This section gives examples of these calls.
The data structure for these calls is different than the JSON RPC calls. Whereas the JSON RPC methods were called using the /json_rpc
extension and specifying a method, these methods are called at their own extensions. For example:
For calls that end with .bin, the data is exchanged in the form of binary, serialized objects, as defined in the Core RPC Server.
Get the node's current height.
Alias: /getheight.
Inputs: None.
Outputs:
height - unsigned int; Current length of longest chain known to daemon.
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get all blocks info. Binary request.
Alias: /getblocks.bin.
Inputs:
block_ids - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block
start_height - unsigned int
prune - boolean
Outputs:
blocks - array of block complete entries
current_height - unsigned int
output_indices - structure as follows:
indices - array of tx output indices, structure as follows:
indices - array of unsigned int
start_height - unsigned int
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get blocks by height. Binary request.
Alias: /getblocks_by_height.bin.
Inputs:
heights - array of unsigned int; list of block heights
Outputs:
blocks - array of block complete entries
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get hashes. Binary request.
Alias: /gethashes.bin.
Inputs:
block_ids - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block
start_height - unsigned int
Outputs:
current_height - unsigned int
m_block_ids - binary array of hashes; see block_ids above.
start_height - unsigned int
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get global outputs of transactions. Binary request.
Alias: None.
Inputs:
txid - binary txid
Outputs:
o_indexes - array of unsigned int; List of output indexes
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get outputs. Binary request.
Alias: None.
Inputs:
outputs - array of structure get_outputs_out as follows:
amount - unsigned int;
index - unsigned int;
Outputs:
outs - array of structure outkey as follows:
amount - unsigned int;
height - unsigned int; block height of the output
key - the public key of the output
mask
txid - transaction id
unlocked - boolean; States if output is locked (false
) or not (true
)
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Look up one or more transactions by hash.
Alias: /gettransactions.
Inputs:
txs_hashes - string list; List of transaction hashes to look up.
decode_as_json - boolean; Optional (false
by default). If set true
, the returned transaction information will be decoded rather than binary.
prune - boolean; Optional (false
by default).
Outputs:
missed_tx - array of strings. (Optional - returned if not empty) Transaction hashes that could not be found.
status - General RPC error code. "OK" means everything looks good.
txs - array of structure entry as follows:
as_hex - string; Full transaction information as a hex string.
as_json - json string; List of transaction info:
version - Transaction version
unlock_time - If not 0, this tells when a transaction output is spendable.
vin - List of inputs into transaction:
key - The public key of the previous output spent in this transaction.
amount - The amount of the input, in atomic units.
key_offsets - A list of integer offets to the input.
k_image - The key image for the given input
vout - List of outputs from transaction:
amount - Amount of transaction output, in atomic units.
target - Output destination information:
key - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output.
extra - Usually called the "payment ID" but can be used to include any random 32 bytes.
signatures - List of signatures used in ring signature to hide the true origin of the transaction.
block_height - unsigned int; block height including the transaction
block_timestamp - unsigned int; Unix time at chich the block has been added to the blockchain
double_spend_seen - boolean; States if the transaction is a double-spend (true
) or not (false
)
in_pool - boolean; States if the transaction is in pool (true
) or included in a block (false
)
output_indices - array of unsigned int; transaction indexes
tx_hash - string; transaction hash
txs_as_hex - string; Full transaction information as a hex string (old compatibility parameter)
txs_as_json - json string; (Optional - returned if set in inputs. Old compatibility parameter) List of transaction as in as_json above:
Example 1: Return transaction information in binary format.
Example 2: Decode returned transaction information in JSON format. Note: the "vin", "vout" and "signatures" list have been truncated in the displayed return for space considerations.
Example 3: Returned a missed (unexisting) transaction.
Get the known blocks hashes which are not on the main chain.
Alias: None.
Inputs: None
Outputs:
blks_hashes - array of strings; list of alternative blocks hashes to main chain
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Check if outputs have been spent using the key image associated with the output.
Alias: None.
Inputs:
key_images - string list; List of key image hex strings to check.
Outputs:
spent_status - unsigned int list; List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction pool
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Broadcast a raw transaction to the network.
Alias: /sendrawtransaction.
Inputs:
tx_as_hex - string; Full transaction information as hexidecimal string.
do_not_relay - boolean; Stop relaying transaction to other nodes (default is false
).
Outputs:
double_spend - boolean; Transaction is a double spend (true
) or not (false
).
fee_too_low - boolean; Fee is too low (true
) or OK (false
).
invalid_input - boolean; Input is invalid (true
) or valid (false
).
invalid_output - boolean; Output is invalid (true
) or valid (false
).
low_mixin - boolean; Mixin count is too low (true
) or OK (false
).
not_rct - boolean; Transaction is a standard ring transaction (true
) or a ring confidential transaction (false
).
not_relayed - boolean; Transaction was not relayed (true
) or relayed (false
).
overspend - boolean; Transaction uses more money than available (true
) or not (false
).
reason - string; Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed.
status - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
too_big - boolean; Transaction size is too big (true
) or OK (false
).
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example (No return information included here.):
Save the blockchain. The blockchain does not need saving and is always saved when modified, however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Harware crashes.
Alias: None.
Inputs: None.
Outputs:
status - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
Example:
Get the known peers list.
Alias: None.
Inputs: None.
Outputs:
gray_list - array of offline peer structure as follows:
host - unsigned int; IP address in integer format
id - string; Peer id
ip - unsigned int; IP address in integer format
last_seen - unsigned int; unix time at which the peer has been seen for the last time
port - unsigned int; TCP port the peer is using to connect to Oxen network.
status - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
white_list - array of online peer structure, as above.
Example (truncated lists):
Set the log hash rate display mode.
Alias: None.
Inputs:
visible - boolean; States if hash rate logs should be visible (true
) or hidden (false
)
Outputs:
status - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
Example while mining:
Error while not mining:
Set the daemon log level. By default, log level is set to 0
.
Alias: None.
Inputs:
level - integer; daemon log level to set from 0
(less verbose) to 4
(most verbose)
Outputs:
status - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
Example:
Set the daemon log categories. Categories are represented as a comma separated list of <Category>:<level>
(similarly to syslog standard <Facility>:<Severity-level>
), where:
Category is one of the following:
* - All facilities
default
net
net.http
net.p2p
logging
net.throttle
blockchain.db
blockchain.db.lmdb
bcutil
checkpoints
net.dns
net.dl
i18n
perf
stacktrace
updates
account
cn
difficulty
hardfork
miner
blockchain
txpool
cn.block_queue
net.cn
daemon
debugtools.deserialize
debugtools.objectsizes
device.ledger
wallet.gen_multisig
multisig
bulletproofs
ringct
daemon.rpc
wallet.simplewallet
WalletAPI
wallet.ringdb
wallet.wallet2
wallet.rpc
tests.core
Level is one of the following:
FATAL - higher level
ERROR
WARNING
INFO
DEBUG
TRACE - lower level A level automatically includes higher level. By default, categories are set to *:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO
. Setting the categories to "" prevent any logs to be outputed.
Alias: None.
Inputs:
categories - string; Optional, daemon log categories to enable
Outputs:
categories - string; daemon log enabled categories
status - string; General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
Example to set all facilities to Security Level Info
:
Example without input to set the default categories:
Show information about valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the txpool in the node's memory.
Alias: None.
Inputs: None.
Outputs:
spent_key_images - List of spent output key images:
id_hash - string; Key image.
txs_hashes - string list; tx hashes of the txes (usually one) spending that key image.
status - string; General RPC error code. "OK" means everything looks good.
transactions - List of transactions in the mempool are not in a block on the main chain at the moment:
blob_size - unsigned int; The size of the full transaction blob.
double_spend_seen - boolean; States if this transaction has been seen as double spend.
do_not_relay; boolean; States if this transaction should not be relayed
fee - unsigned int; The amount of the mining fee included in the transaction, in atomic units.
id_hash - string; The transaction ID hash.
kept_by_block - boolean; States if the tx was included in a block at least once (true
) or not (false
).
last_failed_height - unsigned int; If the transaction validation has previously failed, this tells at what height that occured.
last_failed_id_hash - string; Like the previous, this tells the previous transaction ID hash.
last_relayed_time - unsigned int; Last unix time at which the transaction has been relayed.
max_used_block_height - unsigned int; Tells the height of the most recent block with an output used in this transaction.
max_used_block_hash - string; Tells the hash of the most recent block with an output used in this transaction.
receive_time - unsigned int; The Unix time that the transaction was first seen on the network by the node.
relayed - boolean; States if this transaction has been relayed
tx_blob - unsigned int; Hexadecimal blob represnting the transaction.
tx_json - json string; JSON structure of all information in the transaction:
version - Transaction version
unlock_time - If not 0, this tells when a transaction output is spendable.
vin - List of inputs into transaction:
key - The public key of the previous output spent in this transaction.
amount - The amount of the input, in atomic units.
key_offsets - A list of integer offets to the input.
k_image - The key image for the given input
vout - List of outputs from transaction:
amount - Amount of transaction output, in atomic units.
target - Output destination information:
key - The stealth public key of the receiver. Whoever owns the private key associated with this key controls this transaction output.
extra - Usually called the "transaction ID" but can be used to include any random 32 bytes.
rct_signatures - Ring signatures:
type
txnFee
ecdhInfo - array of Diffie Helman Elipctic curves structures as follows:
mask - String
amount - String
outPk
rctsig_prunable
rangeSigs - array of structures as follows:
asig
Ci
MGs - array of structures as follows:
ss - array of arrays of two strings.
cc - String
Example (Note: Some lists in the returned information have been truncated for display reasons):
Get hashes from transaction pool. Binary request.
Alias: None.
Inputs: None.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
tx_hashes - binary array of transaction hashes.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Get the transaction pool statistics.
Alias: None.
Inputs: None.
Outputs:
pool_stats - Structure as follows:
bytes_max - unsigned int; Max transaction size in pool
bytes_med - unsigned int; Median transaction size in pool
bytes_min - unsigned int; Min transaction size in pool
bytes_total - unsigned int; total size of all transactions in pool
histo - structure txpool_histo as follows:
txs - unsigned int; number of transactions
bytes - unsigned int; size in bytes.
histo_98pc unsigned int; the time 98% of txes are "younger" than
num_10m unsigned int; number of transactions in pool for more than 10 minutes
num_double_spends unsigned int; number of double spend transactions
num_failing unsigned int; number of failing transactions
num_not_relayed unsigned int; number of non-relayed transactions
oldest unsigned int; unix time of the oldest transaction in the pool
txs_total unsigned int; total number of transactions.
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Send a command to the daemon to safely disconnect and shut down.
Alias: None.
Inputs: None.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Example:
Alias:
/getinfo
get_info
Get daemon bandwidth limits.
Alias: None.
Inputs: None.
Outputs:
limit_down - unsigned int; Download limit in kBytes per second
limit_up - unsigned int; Upload limit in kBytes per second
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Example:
Set daemon bandwidth limits.
Alias: None.
Inputs:
limit_down - signed int; Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit)
limit_up - signed int; Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit)
Outputs:
limit_down - unsigned int; Download limit in kBytes per second
limit_up - unsigned int; Upload limit in kBytes per second
status - string; General RPC error code. "OK" means everything looks good.
Example:
Limit number of Outgoing peers.
Alias: None.
Inputs:
out_peers - unsigned int; Max number of outgoing peers
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Example:
Limit number of Incoming peers.
Alias: None.
Inputs:
in_peers - unsigned int; Max number of incoming peers
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Example:
Obsolete. Conserved here for reference.
Alias: None.
Inputs: None.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Example:
Obsolete. Conserved here for reference.
Alias: None.
Inputs: None.
Outputs:
status - string; General RPC error code. "OK" means everything looks good.
Example:
Get outputs.
Alias: None.
Inputs:
outputs array of get_outputs_out structure as follows:
amount - unsigned int;
index - unsigned int;
Outputs:
outs - array of structure outkey as follows:
height - unsigned int; block height of the output
key - String; the public key of the output
mask - String
txid - String; transaction id
unlocked - boolean; States if output is locked (false
) or not (true
)
status - string; General RPC error code. "OK" means everything looks good.
untrusted - boolean; States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Update daemon.
Alias: None.
Inputs:
command - String; command to use, either check
or download
path - String; Optional, path where to download the update.
Outputs:
auto_uri - string;
hash - string;
path - String; path to download the update
status - string; General RPC error code. "OK" means everything looks good.
update - boolean; States if an update is available to download (true
) or not (false
)
user_uri - string;
version - string; Version available for download.
Example:
Reworked RPC calls for Oxen under their .
Block blob data - array of strings; list of block blobs which have been mined. See to get a blob on which to mine.
block_header - A structure containing block header information. See .
Similar to above, this method includes a block's height as an input parameter to retrieve basic information about the block.
block_header - A structure containing block header information. See .
Similar to above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks.
headers - array of block_header
(a structure containing block header information. See ).
block_header - A structure containing block header information. See .
See other RPC Methods
bootstrap_daemon_address - string; to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy).
info - structure of connection info, as defined in
Note: It is recommended to use JSON RPC where such alternatives exist, rather than the following methods. For example, the recommended way to get a node's height is via the JSON RPC methods or , rather than below.
This method is a convenient backward support and should not be used anymore. See JSON RPC for details.
Reworked from RPC calls for Oxen under their .