@@ -65,76 +65,82 @@ Migration `000036_asset_commit.up.sql` introduces several tables to manage the s
65
65
66
66
``` mermaid
67
67
erDiagram
68
- STATE-MACHINES ||--o{ TRANSITIONS : "has pending "
69
- STATE-MACHINES }|--|| STATES : "uses state "
70
- STATE-MACHINES }|--|| COMMITMENTS : "tracks latest "
71
- TRANSITIONS ||--o{ UPDATE-EVENTS : "includes events "
72
- TRANSITIONS }|--|| COMMITMENTS : "replaces old "
73
- TRANSITIONS }|--|| COMMITMENTS : "creates new "
74
- TRANSITIONS }|--|| CHAIN-TXNS : "uses pending tx "
75
- UPDATE-EVENTS ||--|| UPDATE-TYPES : "uses type "
76
- COMMITMENTS ||--|| CHAIN-TXNS : "included in tx "
77
- COMMITMENTS ||--|| INTERNAL-KEYS : "uses internal key "
78
- MINT-COMMITMENTS }|--|| COMMITMENTS : "spent by commit "
68
+ supply_commit_state_machines ||--o{ supply_commit_transitions : "has_pending "
69
+ supply_commit_state_machines }|--|| supply_commit_states : "uses_state "
70
+ supply_commit_state_machines }|--|| supply_commitments : "tracks_latest "
71
+ supply_commit_transitions ||--o{ supply_update_events : "includes_events "
72
+ supply_commit_transitions }|--|| supply_commitments : "replaces_old "
73
+ supply_commit_transitions }|--|| supply_commitments : "creates_new "
74
+ supply_commit_transitions }|--|| chain_txns : "uses_pending_tx "
75
+ supply_update_events ||--|| supply_commit_update_types : "uses_type "
76
+ supply_commitments ||--|| chain_txns : "included_in_tx "
77
+ supply_commitments ||--|| internal_keys : "uses_internal_key "
78
+ mint_anchor_uni_commitments }|--|| supply_commitments : "spent_by_commit "
79
79
80
- STATES {
80
+ supply_commit_states {
81
81
INTEGER id PK
82
82
TEXT state_name UK
83
83
}
84
84
85
- UPDATE-TYPES {
85
+ supply_commit_update_types {
86
86
INTEGER id PK
87
- TEXT name UK
87
+ TEXT update_type_name UK
88
88
}
89
89
90
- COMMITMENTS {
91
- INTEGER id PK
92
- BLOB group_key
93
- BIGINT txn_id FK
90
+ supply_commitments {
91
+ INTEGER commit_id PK
92
+ BLOB group_key "Idx"
93
+ BIGINT chain_txn_id FK
94
94
INTEGER output_index
95
- BIGINT key_id FK
95
+ BIGINT internal_key_id FK
96
96
BLOB output_key
97
+ BLOB supply_root_hash
98
+ BIGINT supply_root_sum
97
99
}
98
100
99
- STATE-MACHINES {
101
+ supply_commit_state_machines {
100
102
BLOB group_key PK
101
- INTEGER state_id FK
102
- BIGINT commitment_id FK
103
+ INTEGER current_state_id FK
104
+ BIGINT latest_commitment_id FK
103
105
}
104
106
105
- TRANSITIONS {
106
- INTEGER id PK
107
- BLOB machine_key FK
108
- BIGINT old_id FK
109
- BIGINT new_id FK
110
- BIGINT txn_id FK
111
- BOOLEAN finalized
107
+ supply_commit_transitions {
108
+ INTEGER transition_id PK
109
+ BLOB state_machine_group_key FK
110
+ BIGINT old_commitment_id FK
111
+ BIGINT new_commitment_id FK
112
+ BIGINT pending_commit_txn_id FK
113
+ BOOLEAN finalized "Default=0"
114
+ TIMESTAMP creation_time
112
115
}
113
116
114
- UPDATE-EVENTS {
115
- INTEGER id PK
117
+ supply_update_events {
118
+ INTEGER event_id PK
116
119
BIGINT transition_id FK
117
- INTEGER type_id FK
118
- BLOB data
120
+ INTEGER update_type_id FK
121
+ BLOB event_data
119
122
}
120
123
121
- CHAIN-TXNS {
122
- INTEGER id PK
124
+ chain_txns {
125
+ INTEGER txn_id PK
123
126
BLOB txid UK
124
127
BLOB raw_tx
125
- INTEGER height
128
+ INTEGER block_height
129
+ BLOB block_hash
130
+ INTEGER tx_index
126
131
}
127
132
128
- INTERNAL-KEYS {
129
- INTEGER id PK
130
- BLOB key UK
133
+ internal_keys {
134
+ INTEGER key_id PK
135
+ BLOB raw_key UK
131
136
}
132
137
133
- MINT-COMMITMENTS {
138
+ mint_anchor_uni_commitments {
134
139
INTEGER id PK
135
140
BIGINT batch_id FK
136
- INTEGER index
137
- BLOB key
141
+ INTEGER tx_output_index
142
+ BLOB taproot_internal_key
143
+ BLOB group_key
138
144
BIGINT spent_by FK
139
145
}
140
146
```
0 commit comments