@@ -5,6 +5,7 @@ CREATE TABLE utxos(
55 asset_id BLOB NOT NULL ,
66 value INTEGER NOT NULL ,
77 serialized BLOB NOT NULL ,
8+ serialized_witness BLOB,
89 is_confidential INTEGER NOT NULL ,
910 is_spent INTEGER DEFAULT 0 ,
1011 PRIMARY KEY (txid, vout)
@@ -21,28 +22,31 @@ CREATE TABLE blinder_keys (
2122CREATE TABLE assets
2223(
2324 asset_name TEXT NOT NULL ,
24- asset_id BLOB NOT NULL ,
25+ asset_entropy BLOB NOT NULL ,
2526 PRIMARY KEY (asset_name)
2627);
2728
28- CREATE TABLE option_params
29- (
30- script_pubkey BLOB NOT NULL PRIMARY KEY ,
31- start_time BLOB NOT NULL ,
32- expiry_time BLOB NOT NULL ,
33- collateral_per_contract BLOB NOT NULL ,
34- settlement_per_contract BLOB NOT NULL ,
35- collateral_asset_id BLOB NOT NULL ,
36- settlement_asset_id BLOB NOT NULL ,
37- option_token_entropy BLOB NOT NULL ,
38- grantor_token_entropy BLOB NOT NULL
39- );
40-
4129CREATE INDEX idx_utxos_asset_id ON utxos (asset_id);
4230CREATE INDEX idx_utxos_is_spent ON utxos (is_spent);
4331CREATE INDEX idx_utxos_script_pubkey ON utxos (script_pubkey);
4432CREATE INDEX idx_utxos_asset_spent_value ON utxos (asset_id, is_spent, value DESC );
4533
46- CREATE INDEX idx_option_params_script_pubkey ON option_params (script_pubkey);
47-
4834CREATE INDEX idx_assets_asset_name ON assets (asset_name);
35+
36+ CREATE TABLE simplicity_contracts
37+ (
38+ x_only_pubkey BLOB NOT NULL ,
39+ taproot_pubkey_gen BLOB NOT NULL ,
40+ contract_type INTEGER NOT NULL ,
41+ PRIMARY KEY (taproot_pubkey_gen)
42+ );
43+
44+ CREATE TABLE contracts
45+ (
46+ taproot_pubkey_gen BLOB NOT NULL ,
47+ params BLOB NOT NULL ,
48+ FOREIGN KEY (taproot_pubkey_gen) REFERENCES simplicity_contracts (taproot_pubkey_gen),
49+ PRIMARY KEY (taproot_pubkey_gen)
50+ );
51+
52+
0 commit comments