summaryrefslogtreecommitdiff
path: root/design-documents
diff options
context:
space:
mode:
Diffstat (limited to 'design-documents')
-rw-r--r--design-documents/024-age-restriction.rst2
-rw-r--r--design-documents/032-auctions.rst91
2 files changed, 81 insertions, 12 deletions
diff --git a/design-documents/024-age-restriction.rst b/design-documents/024-age-restriction.rst
index 6b1004fc..b394a421 100644
--- a/design-documents/024-age-restriction.rst
+++ b/design-documents/024-age-restriction.rst
@@ -151,7 +151,7 @@ registering the extension ``age_restriction`` with a value type
interface ConfigAgeRestriction {
// The age groups. This field is mandatory and binding in the sense
// that its value is taken into consideration when signing the
- // denominations in `ExchangeKeysResponse`.``age_restricted_denoms``.
+ // age restricted denominations in the `ExchangeKeysResponse`
age_groups: AgeGroups;
}
diff --git a/design-documents/032-auctions.rst b/design-documents/032-auctions.rst
index 3d8ccf0a..d81f848e 100644
--- a/design-documents/032-auctions.rst
+++ b/design-documents/032-auctions.rst
@@ -98,10 +98,10 @@ the auction:
as paying any other merchant and thus out of scope for this
design document.
- * An exchange that supports the ``auction`` extension and holds
- the funds for bids in escrow for the duration of the auction.
- Upon completion of the auction, the exchange pays the seller
- from the auction's winner and refunds the other bidders.
+ * An exchange that supports the ``policy_vickrey_auction`` extension and
+ holds the funds for bids in escrow for the duration of the auction. Upon
+ completion of the auction, the exchange pays the seller from the auction's
+ winner and refunds the other bidders.
* An auditor that verifies that the exchange made the payments
correctly.
@@ -140,13 +140,14 @@ bid.
The auction operator then runs the auction protocol with all participants
until conclusion. Once the winner and price have been determined, the auction
-operator POSTs the resulting transcript to a new ``/extensions/policy_auction``
-endpoint of the exchange. Here, the extension-specific logic stores the
-transcript in its database (in a new table) and then simulates the auction
-again (using libbrandt), again determining the winner and price. The extension
-configuration (and thus ``/keys``) may stipendulate some fee(s) charged by the
-exchange to handle the ``/extensions/policy_auction`` request. The fees should
-be covered by the seller. We note that the transcript inherently contains the
+operator POSTs the resulting transcript to a new
+``/extensions/policy_brandt_vickrey_auction`` endpoint of the exchange. Here,
+the extension-specific logic stores the transcript in its database (in a new
+table) and then simulates the auction again (using libbrandt), again
+determining the winner and price. The extension configuration (and thus
+``/keys``) may stipendulate some fee(s) charged by the exchange to handle the
+``/extensions/policy_brandt_vickrey_auction`` request. The fees should be
+covered by the seller. We note that the transcript inherently contains the
deposit confirmations originally issued by the exchange for the auction. So,
the exchange can identify all of the coins that were escrowed (it should also
double-check that the coins were escrowed for the correct auction). It then
@@ -174,6 +175,74 @@ transactions.
The auditor of the exchange can again simulate the auction protocol and can
thus confirm that the exchange's ultimate transactions were correct.
+Transcripts
+^^^^^^^^^^^
+
+A transcript of a Brandt-Vickrey auction is the JSON encoding of an object of
+type `BrandtVickreyAuctionTranscript`.
+
+.. ts:def:: BrandtVickreyAuctionTranscript
+
+ // This structure defines the transcript of an auction of Brandt-Vickory kind.
+ interface BrandtVickreyAuctionTranscript {
+ // The auction definition.
+ auction: BrandtVickreyAuction;
+
+ // The public keys of the bidders, in Crockford Base32 encoding.
+ bidders: EddsaPublicKey[];
+
+ // Signatures of the auction in Crockford Base32 encoding.
+ // One signature per bidder.
+ signatures: EddsaSignature[];
+
+ // The transcript of all messages received by the seller.
+ transcript: BrandtVickreyAuctionMessage[];
+
+ // Optionally, the seller can provide the winners it had calculated.
+ winners?: BrandtVickreyAuctionWinner[];
+
+ // The signature over the hash of this JSON object, without the
+ // key ``sig`` and in normalized form, basically over
+ // H(auction, bidders, signatures, transcripts, winners?)
+ // It is signed by the private key that corresponds to the public key
+ // in `BrandtVickreyAuction`.``pubkey``.
+ // This signature is in Crockford Base32 encoding.
+ sig: EddsaSignature;
+ }
+
+
+.. ts:def:: BrandtVickreyAuctionMessage
+
+ interface BrandtVickreyAuctionMessage {
+ // The index of the bidder into the
+ // `BrandtVickreyAuctionTranscript`.``bidders`` array.
+ bidder: number;
+
+ // The raw message in Crockford Base32 encoding.
+ msg: string;
+
+ // The signature over the message. The signature is in Crockford Base32
+ // encoding. It must be signed by the private key corresponding to the
+ // bidder's public key in `BrandtVickreyAuctionTranscript`.``bidders``.
+ sig: EddsaSignature;
+ }
+
+
+
+.. ts:def:: BrandtVickreyAuctionWinner
+
+ interface BrandtVickreyAuctionWinner {
+ // The index of the bidder into the
+ // `BrandtVickreyAuctionTranscript`.bidder array.
+ bidder: number;
+
+ // The index of the winning price into the
+ // `BrandtVickreyAuction`.prices array.
+ price_idx: number;
+
+ // The winning price
+ price: Amount;
+ }
Alternatives