exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 99de3a49c3c336418a53c6a1842cf4b2e45d80dc
parent a69079ef6c4278a4653028e9587a4ecd84ae4aff
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 27 Nov 2020 14:46:48 +0100

add tables for signing key revocation and for wire accounts

Diffstat:
Msrc/exchangedb/exchange-0002.sql | 27++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

diff --git 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;