summaryrefslogtreecommitdiff
path: root/src/exchangedb/exchange-0002.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-11-27 14:46:48 +0100
committerChristian Grothoff <christian@grothoff.org>2020-11-27 14:46:48 +0100
commit99de3a49c3c336418a53c6a1842cf4b2e45d80dc (patch)
tree9f48f82b69a6c8dccfe6b63c54d4094f3ac1c22d /src/exchangedb/exchange-0002.sql
parenta69079ef6c4278a4653028e9587a4ecd84ae4aff (diff)
downloadexchange-99de3a49c3c336418a53c6a1842cf4b2e45d80dc.tar.gz
exchange-99de3a49c3c336418a53c6a1842cf4b2e45d80dc.tar.bz2
exchange-99de3a49c3c336418a53c6a1842cf4b2e45d80dc.zip
add tables for signing key revocation and for wire accounts
Diffstat (limited to 'src/exchangedb/exchange-0002.sql')
-rw-r--r--src/exchangedb/exchange-0002.sql27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/exchangedb/exchange-0002.sql b/src/exchangedb/exchange-0002.sql
index a670876af..04f1a3621 100644
--- a/src/exchangedb/exchange-0002.sql
+++ b/src/exchangedb/exchange-0002.sql
@@ -42,7 +42,6 @@ COMMENT ON INDEX prepare_get_index
IS 'for wire_prepare_data_get';
-
CREATE TABLE IF NOT EXISTS future_denominations
(denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64)
,denom_pub BYTEA NOT NULL
@@ -131,5 +130,31 @@ COMMENT ON COLUMN exchange_sign_keys.legal_end
IS 'Time when this online signing key legally expires.';
+CREATE TABLE IF NOT EXISTS wire_accounts
+ (payto_uri VARCHAR PRIMARY KEY
+ ,master_pub BYTEA NOT NULL CHECK (LENGTH(master_pub)=32)
+ ,master_sig BYTEA CHECK (LENGTH(master_sig)=64)
+ ,is_active BOOLEAN NOT NULL
+ ,last_change INT8 NOT NULL
+ );
+COMMENT ON TABLE wire_accounts
+ IS 'Table with current and historic bank accounts of the exchange. Entries never expire as we need to remember the last_change column indefinitely.';
+COMMENT ON COLUMN wire_accounts.payto_uri
+ IS 'payto URI (RFC 8905) with the bank account of the exchange.';
+COMMENT ON COLUMN wire_accounts.is_active
+ IS 'true if we are currently supporting the use of this account.';
+COMMENT ON COLUMN wire_accounts.last_change
+ IS 'Latest time when active status changed. Used to detect replays of old messages.';
+
+
+CREATE TABLE IF NOT EXISTS signkey_revocations
+ (signkey_revocations_serial_id BIGSERIAL UNIQUE
+ ,exchange_pub BYTEA PRIMARY KEY REFERENCES exchange_sign_keys (exchange_pub) ON DELETE CASCADE
+ ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)
+ );
+COMMENT ON TABLE signkey_revocations
+ IS 'remembering which online signing keys have been revoked';
+
+
-- Complete transaction
COMMIT;