SPV Wallet Engine transaction engine database overview:

Note: The lack of relations in database does not mean there is no logical relationships between models.


Note: Prefix 'xapi' will be omitted in further descriptions.


Represents an HD-Key or extended public key (xPub for short). Model has no external references.


AccessKey is a private key with a corresponding public key. Model is linked to xpubs by xpub_id field.


Represents paymail data like public name, avatar etc.. Model is linked to xpubs by xpub_id field.


Represents the BSV block header. Model may refer to another block_header record through hash_previous_block field.


Represents the BSV transaction. In the table we store all transactions in the system: outgoing and incomig ones. In other words, transaction record is created based on record from draft_transactions (for outgoing) and based on incoming_transactions (for incoming). Outgoing transaction will refer to draft_transactions by draft_id field, incoming will refer to incoming_transactions by by id field (1:1).

Note: Transactions inside the same SPV Walllet Engine system (between two paymails in same system) are recorded as outgoing only!


Represents the draft outgoing BSV transaction prior to the final transaction. Model is linked to xpubs by xpub_id field and transactions by final_tx_id.

  • sync_transactions

Represents the chain-state sync configuration and results for a given transaction. Sync record is added for EVERY transaction in system (outgoing and incoming). Model is linked to transactions by id field (1:1).

Note: sync_transactions does not represents transaction per se, but its synchronization state.

Possible values for status fields (p2p_status, sync_status, broadcast_status ):

  • pending - is when the sync is pending (blocked by other constraints)

  • ready - is when the sync is ready (waiting for workers)

  • processing - is when the sync is processing (worker is running task)

  • canceled - is when the sync is canceled

  • skipped - is when the sync is skipped

  • error - is when the sync has an error

  • complete - is when the sync is complete


Represents the incoming (external) transaction (for pre-processing). Model is related to transactions by id field (1:1).

NOTE: Internal incoming transactions (from SPV Wallet to SPV Wallet) are not recorded in incoming_transactions


Represents a BSV unspent transaction. Model is related to transactions by transaction_id field.

Last updated