summaryrefslogtreecommitdiff
path: root/design-documents
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-05-16 15:49:43 +0200
committerChristian Grothoff <christian@grothoff.org>2021-05-16 15:49:43 +0200
commita30edee1db15fdeba205464b6238356d650775aa (patch)
tree2a2dc23c132df8b35ddd7b5f87d88040acee2941 /design-documents
parenta9e4a611c51d5a34c8c363a8abf52276edbcc127 (diff)
downloaddocs-a30edee1db15fdeba205464b6238356d650775aa.tar.gz
docs-a30edee1db15fdeba205464b6238356d650775aa.tar.bz2
docs-a30edee1db15fdeba205464b6238356d650775aa.zip
add table to cache /wire reply from partner exchange
Diffstat (limited to 'design-documents')
-rw-r--r--design-documents/013-peer-to-peer-payments.rst50
1 files changed, 41 insertions, 9 deletions
diff --git a/design-documents/013-peer-to-peer-payments.rst b/design-documents/013-peer-to-peer-payments.rst
index c0308bcf..68c75643 100644
--- a/design-documents/013-peer-to-peer-payments.rst
+++ b/design-documents/013-peer-to-peer-payments.rst
@@ -975,18 +975,41 @@ database.)
COMMENT ON INDEX wad_in_entries_reserve_pub
IS 'needed to compute reserve history';
--
- CREATE TABLE IF NOT EXISTS partners
- (partner_serial_id BIGSERIAL UNIQUE
- ,wad_in_serial_id INT8 REFERENCES wads_in (wad_serial_id) ON DELETE CASCADE
- ,partner_master_pub BYTEA NOT NULL CHECK(LENGTH(reserve_pub)=32)
+ CREATE TABLE IF NOT EXISTS p2pfees
+ (p2pfees_serial_id BIGSERIAL UNIQUE
,start_date INT8 NOT NULL
,end_date INT8 NOT NULL
- ,wad_frequency INT8 NOT NULL
- ,wad_fee_val INT8 NOT NULL
- ,wad_fee_frac INT4 NOT NULL
+ ,kyc_timeout INT8 NOT NULL
+ ,purse_timeout INT8 NOT NULL
+ ,history_retention INT8 NOT NULL
+ ,purse_account_limit INT NOT NULL
+ ,kyc_fee_val INT8 NOT NULL
+ ,kyc_fee_frac INT4 NOT NULL
+ ,history_fee_val INT8 NOT NULL
+ ,history_fee_frac INT4 NOT NULL
+ ,account_fee_val INT8 NOT NULL
+ ,account_fee_frac INT4 NOT NULL
+ ,purse_fee_val INT8 NOT NULL
+ ,purse_fee_frac INT4 NOT NULL
,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64))
- ,partner_base_url TEXT NOT NULL
);
+ --
+ CREATE TABLE IF NOT EXISTS partner_accounts
+ (payto_uri VARCHAR PRIMARY KEY
+ ,partner_serial_id INT8 REFERENCES partners(partner_serial_id) ON DELETE CASCADE,
+ ,partner_master_sig BYTEA CHECK (LENGTH(partner_master_sig)=64)
+ ,last_seen INT8 NOT NULL
+ );
+ CREATE INDEX IF NOT EXISTS partner_accounts_index_by_partner_and_time
+ ON partner_accounts (partner_serial_id,last_seen);
+ COMMENT ON TABLE partner_accounts
+ IS 'Table with bank accounts of the partner exchange. Entries never expire as we need to remember the signature for the auditor.';
+ COMMENT ON COLUMN wire_accounts.payto_uri
+ IS 'payto URI (RFC 8905) with the bank account of the partner exchange.';
+ COMMENT ON COLUMN wire_accounts.partner_master_sig
+ IS 'Signature of purpose TALER_SIGNATURE_MASTER_WIRE_DETAILS by the partner master public key';
+ COMMENT ON COLUMN wire_accounts.last_seen
+ IS 'Last time we saw this account as being active at the partner exchange. Used to select the most recent entry, and to detect when we should check again.';
-- Complete transaction
COMMIT;
@@ -1093,8 +1116,17 @@ Q / A
* Q: What determines when a wad transfer can happen between two exchanges?
- * Exchanges should explicitly state which other exchanges they are willing
+ * Exchanges explicitly state which other exchanges they are willing
to do wad transfers with (and how often, at what cost). This may involve
abstract policies like sharing an auditor, using the same currency and the
same (banking) protocol, or other constraints (like a specific list of
exchanges).
+
+* Q: What happens if the owner of a reserve never drains it?
+
+ * Reserves are eventually closed. If the reserve is associated
+ with a bank account, the remaining funds are sent to that bank
+ account. If the reserve was created via a merge, and the owner
+ failed to associate a bank account with it (say because the
+ KYC step never happened), then the reserve balance is forfeit
+ to the exchange upon expiration.