Skip to content

Daemon Data Model

MoneroNetworkType

Bases: IntEnum

Enumerates a Monero network type_.

.. _Monero network type: https://docs.getmonero.org/infrastructure/networks/

MAINNET = 0 class-attribute instance-attribute

0 indicates Mainnet network_.

.. _Mainnet network: https://docs.getmonero.org/infrastructure/networks/#mainnet

STAGENET = 2 class-attribute instance-attribute

2 indicates Stagenet network_.

.. _Stagenet network: https://docs.getmonero.org/infrastructure/networks/#stagenet

TESTNET = 1 class-attribute instance-attribute

1 indicates Testnet network_.

.. _Testnet network: https://docs.getmonero.org/infrastructure/networks/#testnet

MoneroVersion

Bases: SerializableStruct

Models a Monero version.

is_release: bool | None instance-attribute

States if the monero software version corresponds to an official tagged release (True), or not (False).

number: int | None instance-attribute

Number of the monero software version.

__init__()

Initialize a new Monero version.

MoneroBlockHeader

Bases: SerializableStruct

Models a Monero block header which contains information about the block.

cumulative_difficulty: int | None instance-attribute

Cumulative difficulty of all blocks up to the block in the reply.

depth: int | None instance-attribute

The number of blocks succeeding this block on the blockchain. A larger number means an older block.

difficulty: int | None instance-attribute

The strength of the Monero network based on mining power.

hash: str | None instance-attribute

The hash of this block.

height: int | None instance-attribute

The number of blocks preceding this block on the blockchain.

long_term_weight: int | None instance-attribute

The long term block weight, based on the median weight of the preceding 100000 blocks.

major_version: int | None instance-attribute

The major version of the monero protocol at this block height.

miner_tx_hash: str | None instance-attribute

The hash of this block's coinbase transaction.

minor_version: int | None instance-attribute

The minor version of the monero protocol at this block height.

nonce: int | None instance-attribute

A cryptographic random one-time number used in mining a Monero block.

num_txs: int | None instance-attribute

Number of transactions included in this block.

orphan_status: bool | None instance-attribute

If True, this block is not part of the longest chain.

pow_hash: str | None instance-attribute

The hash, as a hexadecimal string, calculated from the block as proof-of-work.

prev_hash: str | None instance-attribute

The hash of the block immediately preceding this block in the chain.

reward: int | None instance-attribute

The amount of atomic-units rewarded to the miner. The reward is the sum of new coins created (the emission) and fees paid by transactions in this block. Note: 1 XMR = 1e12 atomic-units.

size: int | None instance-attribute

Backward compatibility, same as weight, use that instead.

timestamp: int | None instance-attribute

The unix time at which the block was recorded into the blockchain.

weight: int | None instance-attribute

The adjusted block size, in bytes. This is the raw size, plus a positive adjustment for any Bulletproof transactions with more than 2 outputs.

__init__()

Initialize a Monero block header.

copy()

Copy current block header.

Returns:

Type Description
MoneroBlockHeader

copied block header.

merge(other)

Merge current block header with another one.

Raises:

Type Description
Exception

on reconciliation error.

MoneroBlock

Bases: MoneroBlockHeader

Models a Monero block in the blockchain.

hex: str | None instance-attribute

Hexadecimal blob of block information.

miner_tx: MoneroTx | None instance-attribute

Miner transaction information.

tx_hashes: list[str] instance-attribute

List of hashes of non-coinbase transactions in the block.

txs: list[MoneroTx] instance-attribute

List of non-coinbase transactions in the block.

__init__()

Initialize a Monero block.

copy()

Copy current block.

Returns:

Type Description
MoneroBlock

copied block.

MoneroTx

Bases: SerializableStruct

Models a Monero transaction on the blockchain.

DEFAULT_PAYMENT_ID: str instance-attribute

Default tx payment id

block: MoneroBlock | None instance-attribute

Block including the transaction.

common_tx_sets: str | None instance-attribute

A hexadecimal string representing a set of unsigned transactions, or a set of signing keys used in a multisig transaction.

extra: list[int] instance-attribute

Usually called the payment ID but can be used to include any random 32 bytes.

fee: int | None instance-attribute

The amount of the mining fee included in the transaction, in atomic-units.

full_hex: str | None instance-attribute

Full transaction information as a hex string.

hash: str | None instance-attribute

The transaction hash.

in_tx_pool: bool | None instance-attribute

States if the transaction is in pool (True) or included in a block (False).

inputs: list[MoneroOutput] instance-attribute

List of inputs into transaction.

is_confirmed: bool | None instance-attribute

States if the transaction included in a block (True) or is in pool (False).

is_double_spend_seen: bool | None instance-attribute

States if the transaction is a double-spend (True) or not (False).

is_failed: bool | None instance-attribute

Indicates if the transaction validation has previously failed.

is_kept_by_block: bool | None instance-attribute

States if the transaction was included in a block at least once (True) or not (False).

is_miner_tx: bool | None instance-attribute

States if the transaction is a coinbase-transaction (True) or not (False).

is_relayed: bool | None instance-attribute

States if the transaction was relayed (True) or not (False).

key: str | None instance-attribute

The transaction key.

last_failed_hash: str | None instance-attribute

If the transaction validation has previously failed, this tells the previous transaction hash.

last_failed_height: int | None instance-attribute

If the transaction validation has previously failed, this tells at what height that occurred.

last_relayed_timestamp: int | None instance-attribute

Last unix time at which the transaction has been relayed.

max_used_block_hash: str | None instance-attribute

Tells the hash of the most recent block with an output used in this transaction.

max_used_block_height: int | None instance-attribute

Tells the height of the most recent block with an output used in this transaction.

metadata: str | None instance-attribute

Transaction metadata.

num_confirmations: int | None instance-attribute

Number of network confirmations.

output_indices: list[int] instance-attribute

Transaction indexes.

outputs: list[MoneroOutput] instance-attribute

Transaction outputs.

payment_id: str | None instance-attribute

Payment ID for this transaction.

prunable_hash: str | None instance-attribute

Keccak-256 hash of the prunable portion of the block.

prunable_hex: str | None instance-attribute

Prunable block encoded as a hex string.

pruned_hex: str | None instance-attribute

Pruned block encoded as hex string.

rct_sig_prunable: str | None instance-attribute

Prunable ring signature.

rct_signatures: str | None instance-attribute

Signatures used in ring signature to hide the true origin of the transaction.

received_timestamp: int | None instance-attribute

Unix time at chich the transaction has been received.

relay: bool | None instance-attribute

States if this transaction should be relayed (True) or not (False).

ring_size: int | None instance-attribute

The ring size of this transaction.

signatures: list[str] instance-attribute

List of signatures used in ring signature to hide the true origin of the transaction.

size: int | None instance-attribute

Backward compatibility, same as weight, use that instead.

unlock_time: int | None instance-attribute

If not 0, this tells when the transaction outputs are spendable.

version: int | None instance-attribute

Transaction version.

weight: int | None instance-attribute

The weight of this transaction in bytes.

__init__()

Initialize a new Monero transaction.

copy()

Copy current tx.

Returns:

Type Description
MoneroTx

tx copy.

get_height()

Get the transaction height.

Returns:

Type Description
int | None

The height of the transaction, if known.

merge(other)

Merge current tx with another one.

Parameters:

Name Type Description Default
other MoneroTx

other tx to merge with.

required

MoneroKeyImage

Bases: SerializableStruct

Models a Monero key image.

hex: str | None instance-attribute

The key image in hexadecimal format.

signature: str | None instance-attribute

The key image signature. None if not known.

__init__()

Initialize a Monero key image.

copy()

Copy current key image.

Returns:

Type Description
MoneroKeyImage

key image copy.

deserialize_key_images(key_images_json) staticmethod

Deserialize key images from a JSON string.

Parameters:

Name Type Description Default
key_images_json str

JSON string with serialized key images.

required

Returns:

Type Description
list[MoneroKeyImage]

Deserialized key images.

merge(other)

Merge current key image with another one.

Parameters:

Name Type Description Default
other MoneroKeyImage

other key image to merge with.

required

MoneroOutput

Bases: SerializableStruct

Models a Monero transaction output.

amount: int | None instance-attribute

Output amount in atomic-units.

index: int | None instance-attribute

Output index.

key_image: MoneroKeyImage | None instance-attribute

The key image of the output.

ring_output_indices: list[int] instance-attribute

Indices of ring outputs.

stealth_public_key: str | None instance-attribute

The public key of the output.

tx: MoneroTx instance-attribute

The transaction related to this output.

__init__()

Initialize a Monero output.

copy()

Copy current output.

Returns:

Type Description
MoneroOutput

output copy.

merge(other)

Merge current output wallet with another output.

Parameters:

Name Type Description Default
other MoneroOutput

other output to merge with.

required

MoneroAltChain

Models an alternative chain seen by the node.

block_hashes: list[str] instance-attribute

List of all block hashes in the alternative chain that are not in the main chain.

difficulty: int | None instance-attribute

Cumulative difficulty of all blocks in the alternative chain.

height: int | None instance-attribute

The block height of the first diverging block of this alternative chain.

length: int | None instance-attribute

The length in blocks of this alternative chain, after divergence.

main_chain_parent_block_hash: str | None instance-attribute

The hash of the greatest height block that is shared between the alternative chain and the main chain.

__init__()

Initialize a Monero alt chain info.

MoneroBan

Model a Monero banhammer.

host: str | None instance-attribute

Host ban.

ip: int | None instance-attribute

IP ban.

is_banned: bool | None instance-attribute

Indicates if ban on the host is active (True) or not (False).

seconds: int | None instance-attribute

Indicates the duration of the ban in seconds.

__init__()

Initialize a Monero banhammer.

MoneroPruneResult

Models the result of pruning the blockchain.

is_pruned: bool | None instance-attribute

Indicates if blockchain is pruned.

pruning_seed: int | None instance-attribute

Blockheight at which pruning began.

__init__()

Initialize a Monero prune result.

MoneroMiningStatus

Models a Monero daemon mining status.

address: str | None instance-attribute

Account address daemon is mining to. None if not mining.

is_active: bool | None instance-attribute

Indicates if mining is enabled.

is_background: bool | None instance-attribute

Indicates if mining is running in background.

num_threads: int | None instance-attribute

Number of running mining threads.

speed: int | None instance-attribute

Mining power in hashes per seconds.

__init__()

Initialize a Monero daemon mining status.

MoneroMinerTxSum

Model for the sum of miner emissions and fees.

emission_sum: int | None instance-attribute

The new coins emitted in atomic-units.

fee_sum: int | None instance-attribute

The sum of fees in atomic-units.

__init__()

Initialize a Monero miner transaction sum.

MoneroBlockTemplate

Monero block template to mine.

block_hashing_blob: str | None instance-attribute

Blob on which to try to find a valid nonce.

block_template_blob: str | None instance-attribute

Blob on which to try to mine a new block.

difficulty: int | None instance-attribute

Network difficulty.

expected_reward: int | None instance-attribute

Coinbase reward expected to be received if block is successfully mined.

height: int | None instance-attribute

Height on which to mine.

next_seed_hash: str | None instance-attribute

Hash of the next block to use as seed for Random-X proof-of-work.

prev_hash: str | None instance-attribute

Hash of the most recent block on which to mine the next block.

reserved_offset: int | None instance-attribute

Reserved offset.

seed_hash: str | None instance-attribute

Hash of block to use as seed for Random-X proof-of-work.

seed_height: int | None instance-attribute

Height of block to use as seed for Random-X proof-of-work.

__init__()

Initialize a Monero block template.

MoneroConnectionSpan

Monero daemon connection span.

connection_id: str | None instance-attribute

Id of connection

num_blocks: int | None instance-attribute

Number of blocks in this span

rate: int | None instance-attribute

Connection rate

remote_address: str | None instance-attribute

Peer address the node is downloading (or has downloaded) than span from.

size: int | None instance-attribute

Total number of bytes in that span's blocks (including txes).

speed: int | None instance-attribute

Connection speed.

start_height: int | None instance-attribute

Block height of the first block in that span.

__init__()

Initialize a Monero connection span.

MoneroPeer

Models a peer to the daemon.

address: str | None instance-attribute

The peer's address, actually IPv4 & port.

avg_download: int | None instance-attribute

Average bytes of data downloaded by node.

avg_upload: int | None instance-attribute

Average bytes of data uploaded by node.

connection_type: MoneroConnectionType | None instance-attribute

Type of peer connection.

current_download: int | None instance-attribute

Current bytes downloaded by node.

current_upload: int | None instance-attribute

Current bytes uploaded by node.

hash: str | None instance-attribute

Peer hash.

height: int | None instance-attribute

The peer blockchain height.

host: str | None instance-attribute

The peer host.

id: str | None instance-attribute

The node's ID on the network.

is_incoming: bool | None instance-attribute

Indicates if peer is pulling blocks from node.

is_local_host: bool | None instance-attribute

Indicates if peer is localhost.

is_local_ip: bool | None instance-attribute

Indicates if peer has a local ip address.

is_online: bool | None instance-attribute

Indicates if the peer is online.

last_seen_timestamp: int | None instance-attribute

Last activity timestamp of this peer.

live_time: int | None instance-attribute

Length of time the peer has been online.

num_receives: int | None instance-attribute

Total number of messages received from this peer.

num_sends: int | None instance-attribute

Total number of messages sent to this peer.

num_support_flags: int | None instance-attribute

Support flags number.

port: int | None instance-attribute

The port that the node is using to connect to the network.

pruning_seed: int | None instance-attribute

Block height at which pruning began.

receive_idle_time: int | None instance-attribute

Seconds since last data was received from this peer.

rpc_credits_per_hash: int | None instance-attribute

Credits for every hash calculated by client.

rpc_port: int | None instance-attribute

Peer RPC port.

send_idle_time: int | None instance-attribute

Seconds since the last data sent to this peer.

state: str | None instance-attribute

Peer state.

__init__()

Initialize a new Monero peer.

MoneroSubmitTxResult

Models the result from submitting a tx to a daemon.

credits: int | None instance-attribute

If payment for RPC is enabled, the number of credits available to the requesting client.

has_invalid_input: bool | None instance-attribute

Indicates if the transaction has an invalid input.

has_invalid_output: bool | None instance-attribute

Indicates if the transaction has an invalid output.

has_too_few_outputs: bool | None instance-attribute

Indicates if the transaction has too few outputs.

is_double_spend: bool | None instance-attribute

Indicates if the transaction is double spend.

is_fee_too_low: bool | None instance-attribute

Indicates if the transaction fee is too low.

is_good: bool | None instance-attribute

Indicates if the submission of the transaction was successfull.

is_mixin_too_low: bool | None instance-attribute

Indicates if the transaction mixin count is too low.

is_overspend: bool | None instance-attribute

Indicates if the transaction uses more money than available

is_relayed: bool | None instance-attribute

Indicates if the transaction has been relayed.

is_too_big: bool | None instance-attribute

Indicates if the transaction size is too big.

is_tx_extra_too_big: bool | None instance-attribute

Indicates if the transaction extra size is too big.

reason: str | None instance-attribute

Additional information. Currently empty or Not relayed if transaction was accepted but not relayed.

sanity_check_failed: bool | None instance-attribute

Indicates if the transaction sanity check has failed.

top_block_hash: str | None instance-attribute

Hash of the highest block in the chain.

__init__()

Initialize a new submit transaction result.

MoneroTxBacklogEntry

TODO

__init__()

Intialize a new tx backlog entry.

MoneroOutputDistributionEntry

Models a Monero output distribution entry.

amount: int | None instance-attribute

Output amount in atomic-units.

base: int | None instance-attribute

The total number of outputs of amount in the chain before, not including, the block at start_height.

distribution: list[int] instance-attribute

The output distibution.

start_height: int | None instance-attribute

Not necessarily equal to start_height parameter especially for amount = 0 where start_height will be no less than the height of the v4 hardfork.

__init__()

Initialize a Monero output distribution entry.

MoneroOutputHistogramEntry

Models a Monero output histogram entry.

amount: int | None instance-attribute

Output amount in atomic-units.

num_instances: int | None instance-attribute

Number of outputs.

recent_instances: int | None instance-attribute

Number of recent outputs.

unlocked_instances: int | None instance-attribute

Number of unlocked outputs.

__init__()

Initialize a Monero output histogram entry.

MoneroTxPoolStats

Models transaction pool statistics.

bytes_max: int | None instance-attribute

Max transaction size in pool.

bytes_med: int | None instance-attribute

Median transaction size in pool.

bytes_min: int | None instance-attribute

Min transaction size in pool.

bytes_total: int | None instance-attribute

Total size of all transactions in pool.

fee_total: int | None instance-attribute

The sum of the fees for all transactions currently in the transaction pool atomic-units.

histo98pc: int | None instance-attribute

The time 98% of txes are younger than.

num10m: int | None instance-attribute

Number of transactions in pool for more than 10 minutes.

num_double_spends: int | None instance-attribute

Number of double spend transactions.

num_failing: int | None instance-attribute

Number of failing transactions.

num_not_relayed: int | None instance-attribute

Number of non-relayed transactions.

num_txs: int | None instance-attribute

Total number of transactions.

oldest_timestamp: int | None instance-attribute

Unix time of the oldest transaction in the pool.

__init__()

Initialize a Monero transaction pool statistics.

MoneroDaemonUpdateCheckResult

Models the result of checking for a daemon update.

auto_uri: str | None instance-attribute

URL automatically generated by the daemon to download the update.

hash: str | None instance-attribute

Integrity check hash.

is_update_available: bool | None instance-attribute

Indicates if an update is available to download.

user_uri: str | None instance-attribute

Alternative user URI.

version: str | None instance-attribute

Version available for download.

__init__()

Initialize a Monero update check result.

MoneroDaemonUpdateDownloadResult

Bases: MoneroDaemonUpdateCheckResult

Models the result of downloading a daemon update.

download_path: str | None instance-attribute

Path to download the update.

__init__()

Initialize a Monero update download result.

MoneroFeeEstimate

Models a Monero fee estimate.

fee: int | None instance-attribute

Amount of fees estimated per byte in atomic-units.

fees: list[int] instance-attribute

Represents the base fees at different priorities [slow, normal, fast, fastest].

quantization_mask: int | None instance-attribute

Final fee should be rounded up to an even multiple of this value.

__init__()

Initialize a Monero fee estimate.

MoneroDaemonInfo

Models information got from a Monero daemon.

adjusted_timestamp: int | None instance-attribute

Current time approximated from chain data, as Unix time.

block_size_limit: int | None instance-attribute

Backward compatibility, same as block_weight_limit, use that instead.

block_size_median: int | None instance-attribute

Backward compatibility, same as block_weight_median, use that instead.

block_weight_limit: int | None instance-attribute

Maximum allowed adjusted block size based on latest 100000 blocks.

block_weight_median: int | None instance-attribute

Median adjusted block size of latest 100000 blocks.

bootstrap_daemon_address: str | None instance-attribute

Bootstrap-node to give immediate usability to wallets while syncing by proxying RPC to it.

credits: int | None instance-attribute

If payment for RPC is enabled, the number of credits available to the requesting client.

cumulative_difficulty: int | None instance-attribute

Cumulative difficulty.

database_size: int | None instance-attribute

The size of the blockchain database, in bytes.

difficulty: int | None instance-attribute

The network difficulty.

free_space: int | None instance-attribute

Available disk space on the node.

height: int | None instance-attribute

Current length of longest chain known to daemon.

height_without_bootstrap: int | None instance-attribute

Current length of the local chain of the daemon.

is_busy_syncing: bool | None instance-attribute

States if new blocks are being added (True) or not (False).

is_offline: bool | None instance-attribute

States if the node is offline (True) or online (False).

is_restricted: bool | None instance-attribute

Indicates that the node RPC interface is restricted (True) or not (False).

is_synchronized: bool | None instance-attribute

States if the node is synchronized (True) or not (False).

network_type: MoneroNetworkType | None instance-attribute

Network type (MAINNET, TESTNET, or STAGENET).

num_alt_blocks: int | None instance-attribute

Number of alternative blocks to main chain.

num_incoming_connections: int | None instance-attribute

Number of peers connected to and pulling from your node.

num_offline_peers: int | None instance-attribute

Number of peers that are marked as not reacheable on the network.

num_online_peers: int | None instance-attribute

Number of peers that are marked as reacheble on the network.

num_outgoing_connections: int | None instance-attribute

Number of peers that you are connected to and getting information from.

num_rpc_connections: int | None instance-attribute

Number of RPC client connected to the daemon (Including this RPC request).

num_txs: int | None instance-attribute

Total number of non-coinbase transactions in the chain.

num_txs_pool: int | None instance-attribute

Number of transactions that have been broadcast but not included in a block.

start_timestamp: int | None instance-attribute

Start time of the daemon, as UNIX time.

target: int | None instance-attribute

Current target for next proof of work.

target_height: int | None instance-attribute

The height of the next block in the chain.

top_block_hash: str | None instance-attribute

Hash of the highest block in the chain.

update_available: bool | None instance-attribute

States if a newer Monero software version is available.

version: str | None instance-attribute

The version of the Monero software the node is running.

was_bootstrap_ever_used: bool | None instance-attribute

States if a bootstrap node has ever been used since the daemon started.

__init__()

Initiliaze a Monero daemon info.

MoneroDaemonSyncInfo

Models daemon synchronization information.

credits: int | None instance-attribute

If payment for RPC is enabled, the number of credits available to the requesting client.

height: int | None instance-attribute

Daemon blockchain height.

next_needed_pruning_seed: int | None instance-attribute

The next pruning seed needed for pruned sync.

overview: str | None instance-attribute

Overview of current block queue where each character in the string represents a block set in the queue. '.' = requested but not received, 'o' = set received, 'm' = received set that matches the next blocks needed

peers: list[MoneroPeer] instance-attribute

List of peers connected to the node

spans: list[MoneroConnectionSpan] instance-attribute

Currently connected peers to download blocks from.

target_height: int | None instance-attribute

Target height the node is syncing from (will be 0 if node is fully synced).

top_block_hash: str | None instance-attribute

Hash of the highest block in the chain.

__init__()

Initialize a Monero daemon sync info.

MoneroHardForkInfo

Models a Monero look up information regarding hard fork voting and readiness.

credits: int | None instance-attribute

If payment for RPC is enabled, the number of credits available to the requesting client.

earliest_height: int | None instance-attribute

Block height at which hard fork would be enabled if voted in.

is_enabled: bool | None instance-attribute

Tells if hard fork is enforced.

num_votes: int | None instance-attribute

Number of votes towards hard fork.

state: int | None instance-attribute

Current hard fork state. 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good).

threshold: int | None instance-attribute

Minimum percent of votes to trigger hard fork. Default is 80.

top_block_hash: str | None instance-attribute

If payment for RPC is enabled, the hash of the highest block in the chain. Otherwise, empty.

version: int | None instance-attribute

The major block version for the fork.

voting: int | None instance-attribute

Hard fork voting status.

window: int | None instance-attribute

Number of blocks over which current votes are cast. Default is 10080 blocks.

__init__()

Initialize a Monero hard fork info.

MoneroDaemonListener

Receives notifications as a daemon is updated.

last_header: MoneroBlockHeader | None instance-attribute

Last block header added to the chain.

__init__()

Initialize a Monero daemon listener.

on_block_header(header)

Called when a new block is added to the chain.

Parameters:

Name Type Description Default
header MoneroBlockHeader

is the header of the block added to the chain.

required