钱包对象
涉及钱包相关功能,以及存储。
const FUNDS_BUCKET = "FUNDS" // stores all incoming funds, key is global output index encrypted form
// TX_Wallet_Data
const FUNDS_AVAILABLE = "FUNDS_AVAILABLE" // indices of all funds ready to spend
// Index_Global
const FUNDS_SPENT = "FUNDS_SPENT" // indices of all funds already spent
// index
const FUNDS_SPENT_WHERE = "FUNDS_SPENT_WHERE" // mapping which output -> spent where
// spent_index
const FUNDS_BUCKET_OUTGOING = "FUNDS_OUTGOING" // stores all tx where our funds were spent
// TX_Wallet_Data
const RING_BUCKET = "RING_BUCKET" // to randomly choose ring members when transactions are created
// Ring_Member
const KEYIMAGE_BUCKET = "KEYIMAGE_BUCKET" // used to track which funds have been spent (only on chain ) and which output was consumed
// Index_Global
const SECRET_KEY_BUCKET = "TXSECRETKEY" // used to keep secret keys for any tx this wallet has created
// tx_secret_key
const TX_OUT_DETAILS_BUCKET = "TX_OUT_DETAILS" // used to keep secret keys for any tx this wallet has created
// Outgoing_Transfer_Details
const HEIGHT_TO_BLOCK_BUCKET = "H2BLOCK_BUCKET" // used to track height to block hash mapping
// BLID
const OUR_TX_BUCKET = "OUR_TX_BUCKET" // this contains all TXs in which we have spent OUR FUNDS
// TXID
// the strings are prepended so as there can NEVER be collision between TXID and payment ID
// as paymentID are chosen by users
const TXID = "TXID" // all TX to output index will have this string prepended
// Index_Global
const PAYID = "PAYID" // all payment ID to output index will have this string prepended,
// Index_Global
类型复杂的有 TX_Wallet_Data、Ring_Member、Outgoing_Transfer_Details,简单的有 Hash、Key、Index_Global.
TX_Wallet_Data 为主要存储数据,可用于查询、转出,数据大,量少;
Ring_Member 数据来源于 TX_Output_Data,可用于转出,数据小,量多;
Outgoing_Transfer_Details 是转出记录。
const FUNDS_BY_TX_ID_BUCKET = 11 // each tx id is a bucket
const FUNDS_BY_BLOCK_HEIGHT_BUCKET = 12 // funds sorted by block height
const FUNDS_SPENT_BY_BLOCK_HEIGHT_BUCKET = 13 // funds spent by block height
const NOTES_BY_TXID = 14 // any notes attached