This part describes the database schema and interactions used in the relayer.
The relayer uses a SQLite database to store and manage transaction data. The database has three tables:
Column | Data Type | Description |
---|---|---|
id |
INTEGER | The ID of the IKA sign request (primary key) |
payload |
BLOB | The raw transaction data as a byte array |
dwallet_id |
TEXT | The ID of the dWallet used for signing |
user_sig |
TEXT | The user's signature on the transaction |
final_sig |
BLOB | The final signature generated by IKA (initially NULL) |
timestamp |
INTEGER | The timestamp of the request (Unix timestamp) |
Column | Data Type | Description |
---|---|---|
sr_id |
INTEGER | The ID of the IKA sign request (foreign key to ika_sign_requests ) |
status |
INTEGER | The status of the IKA transaction (0: Success, 1: Failed) |
ika_tx_id |
TEXT | The ID of the IKA transaction |
timestamp |
INTEGER | The timestamp of the IKA transaction (Unix timestamp) |
note |
TEXT | Any notes or error messages related to the IKA transaction |
sr_id , ika_tx_id |
Primary Key | The combination of sr_id and ika_tx_id uniquely identifies a row in this table |
Column | Data Type | Description |
---|---|---|
sr_id |
INTEGER | The ID of the IKA sign request (foreign key to ika_sign_requests ) |
status |
INTEGER | The status of the Bitcoin transaction (0: Pending, 1: Broadcasted, 2: Confirmed) |
btc_tx_id |
TEXT | The ID of the Bitcoin transaction (hash) |
timestamp |
INTEGER | The timestamp of the Bitcoin transaction (Unix timestamp) |
note |
TEXT | Any notes or error messages related to the Bitcoin transaction |
sr_id , btc_tx_id |
Primary Key | The combination of sr_id and btc_tx_id uniquely identifies a row in this table |
The dal
package handles all interactions with the database. The functions within this package can be grouped into the following categories:
These functions manage the lifecycle of IKA sign requests within the ika_sign_requests
table.
These functions manage IKA transaction records in the ika_txs
table.
These functions manage Bitcoin transaction records in the bitcoin_txs
table.