wallet.sql 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. -- Wallet definitions for this contract.
  2. -- We store data that is needed to be able to receive and send tokens.
  3. -- TODO: The tables should be prefixed with ContractId to prevent collision
  4. -- Arbitrary info that is potentially useful
  5. CREATE TABLE IF NOT EXISTS money_info (
  6. last_scanned_slot INTEGER NOT NULL
  7. );
  8. -- The Merkle tree containing coins
  9. CREATE TABLE IF NOT EXISTS money_tree (
  10. tree BLOB NOT NULL
  11. );
  12. -- The keypairs in our wallet
  13. CREATE TABLE IF NOT EXISTS money_keys (
  14. key_id INTEGER PRIMARY KEY NOT NULL,
  15. is_default INTEGER NOT NULL,
  16. public BLOB NOT NULL,
  17. secret BLOB NOT NULL
  18. );
  19. -- The coins we have the information to and can spend
  20. CREATE TABLE IF NOT EXISTS money_coins (
  21. coin BLOB PRIMARY KEY NOT NULL,
  22. is_spent INTEGER NOT NULL,
  23. serial BLOB NOT NULL,
  24. value BLOB NOT NULL,
  25. token_id BLOB NOT NULL,
  26. spend_hook BLOB NOT NULL,
  27. user_data BLOB NOT NULL,
  28. coin_blind BLOB NOT NULL,
  29. value_blind BLOB NOT NULL,
  30. token_blind BLOB NOT NULL,
  31. secret BLOB NOT NULL,
  32. nullifier BLOB NOT NULL,
  33. leaf_position BLOB NOT NULL,
  34. memo BLOB
  35. );