taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

032-brandt-vickrey-auctions.rst (13802B)


      1 DD 32: Brandt-Vickrey Auctions
      2 ##############################
      3 
      4 Summary
      5 =======
      6 
      7 This document describes the design for how (SMC) auctions could be done with
      8 funds held in escrow by a Taler exchange.  It is taking major inspiration from
      9 Markus Teich's Master's thesis on "Implementing Privacy Preserving Auction
     10 Protocols".
     11 
     12 The support for these types of auctions will be in the form of an extension for
     13 a deposit policy.
     14 
     15 
     16 Motivation
     17 ==========
     18 
     19 Escrow is a key capability of payment systems. With SMC auctions we can
     20 broaden the escrow functionality beyond the (simplistic) refunds we currently
     21 offer. This provides a first new use-case for the extension mechanism. By
     22 using SMC auctions (libbrandt), we also provide privacy for another business
     23 process.
     24 
     25 We expect the design to be useful for three primary use-cases:
     26 
     27   * Auctions in the style of Ebay (consumer goods)
     28 
     29   * Auctions for commodities and stock trading
     30 
     31   * Auctions in currency exchange, including crypto-currencies
     32 
     33 We do not consider the use-case of high-value art auctions, as here the Taler
     34 payment system is likely unsuitable for the high transaction values, the
     35 privacy for the buyer would still be problematic from a money-laundering
     36 perspective, and the cost of a trusted auctioneer manually running the auction
     37 is small compared to the transaction value, so the benefits from automation
     38 are also minor.
     39 
     40 
     41 Requirements
     42 ============
     43 
     44 The discovery of ongoing auctions and the exchange of meta-data about the
     45 auction (duration, price ranges, conditions of the sale, etc.) is considered
     46 out-of-scope for the Taler protocol. Taler is only used to escrow a payment
     47 once participants have decided to make a bid on an aution.
     48 
     49   * Support libbrandt-style SMC multiparty computation to determine
     50     auction winner.  No party is trusted to learn the bids during
     51     the bidding phase, including the exchange.  This implies that
     52     participants have to always escrow the largest possible amount
     53     in the auction, even if their actual bid is much lower.
     54 
     55   * Integrate nicely with existing exchange functionality, including
     56     minimal changes to existing endpoints and introducing as few new
     57     endpoints as reasonable.
     58 
     59   * Verifiablity of the auction outcome by the exchange and the
     60     auditor. There is not supposed to be any trusted third party.
     61     Naturally, when selling real-world goods, external enforcement
     62     of the transfer of the good may be required.
     63 
     64   * Guaranteed payment. If the auction is successful (there were at
     65     least two bidders), the seller must unconditionally receive the
     66     payment.
     67 
     68   * Participants pay fees (possibly even just for participation),
     69     to ensure only truly interested parties with skin in the game
     70     participate (protection against denial-of-service attacks).
     71 
     72   * To ensure participants can perform the required computations
     73     in each round, the number of bidders on an auction may need
     74     to be limited.
     75 
     76 
     77 
     78 Proposed Solution
     79 =================
     80 
     81 We will for now consider five types of parties involved in
     82 the auction:
     83 
     84   * A seller, who is offering an item and who sets some basic
     85     rules for the auction (like the price range, duration of
     86     rounds, delivery conditions, seller's bank account,
     87     auction operator, etc.).
     88 
     89   * A number of bidders, who make bids on the auction, with
     90     the highest bidder winnig the auction and paying the
     91     second highest price to the seller.
     92 
     93   * An auction operator, who collects messages from the seller
     94     and the bidders and ultimately announces the (then universally
     95     verifiable) outcome.  In the original paper of Brand, this
     96     would be the ``blackboard``. The auction operator may
     97     also facilitate the discovery of auctions, but this is out
     98     of scope.  The auction operator may charge fees for setting
     99     up and running an auction. However, from the Taler perspective,
    100     paying an auction operator to run an auction is the same
    101     as paying any other merchant and thus out of scope for this
    102     design document.
    103 
    104   * An exchange that supports the ``policy_vickrey_auction`` extension and
    105     holds the funds for bids in escrow for the duration of the auction.  Upon
    106     completion of the auction, the exchange pays the seller from the auction's
    107     winner and refunds the other bidders.
    108 
    109   * An auditor that verifies that the exchange made the payments
    110     correctly.
    111 
    112 The high-level protocol for a bidder's interaction with the auction operator
    113 and the Taler exchange is already described in Teich's thesis in Figure 3.2:
    114 the bidder begins by registering (say with an ephemeral EdDSA key) at the
    115 auction operator.  Further messages from the bidder during this auction must
    116 then always be signed by the respective private key.
    117 
    118 The auction operator checks if there is a free slot (to limit the number of
    119 bidders per auction) and if one is free, gives the bidder a (modest) timeout
    120 until when it must prove that it escrowed an appropriate amount at the
    121 exchange.  If no slots are free, the auction operator may allow the
    122 prospective bidder to long-poll for slots to become available (say because
    123 another prospective bidder failed to provide a proof of escrow on time).
    124 
    125 The bidder then uses the existing ``/deposit`` endpoint at the exchange to
    126 escrow the maximum bid. Escrowing the maximum bid ensures that no information
    127 about the actual bid is leaked to the exchange, and that any bid that could be
    128 made by the bidder can always be executed.  In the ``/deposit``, the contract
    129 hash is set to information that includes those private parts of the auction
    130 meta data that do not concern the exchange (such as information about the item
    131 being sold).  The seller's account information is included as the receiver of
    132 the funds.  Additionally, the ``/deposit`` handler accepts an extension object
    133 which specifies the (SMC auction) extension and relevant meta-data about the
    134 auction (in particular, the bidder's ephemeral EdDSA public key, until when
    135 the auction runs, and (possibly) key material about the auction operator).
    136 
    137 The resulting proofs of deposits (plural, as there may be multiple coins
    138 involved) are then returned to the bidder. Note that the deposit confirmation
    139 signatures cover both the hash of the contract terms and the extension object.
    140 The deposit confirmations are then forwarded by the bidder to the auction
    141 operator, possibly already together with first (sealed) information about the
    142 bid.
    143 
    144 The auction operator then runs the auction protocol with all participants
    145 until conclusion. Once the winner and price have been determined, the auction
    146 operator POSTs the resulting transcript to a new
    147 ``/extensions/policy_brandt_vickrey_auction`` endpoint of the exchange.  Here,
    148 the extension-specific logic stores the transcript in its database (in a new
    149 table) and then simulates the auction again (using libbrandt), again
    150 determining the winner and price.  The extension configuration (and thus
    151 ``/keys``) may stipendulate some fee(s) charged by the exchange to handle the
    152 ``/extensions/policy_brandt_vickrey_auction`` request.  The fees should be
    153 covered by the seller.  We note that the transcript inherently contains the
    154 deposit confirmations originally issued by the exchange for the auction. So,
    155 the exchange can identify all of the coins that were escrowed (it should also
    156 double-check that the coins were escrowed for the correct auction).  It then
    157 refunds the bids from the losing bidders, pays the price to the seller from
    158 the winner (minus auction fee), and partially refunds the winner the difference
    159 between the escrowed amount and the winning bid.
    160 
    161   .. note::
    162 
    163      Partial refunds are currently implemented using the ``refunds`` table.
    164      The refunds table requires refund message signatures by the merchant's
    165      public key.  Thus, this table will need to be generalized to include
    166      some indicator as to whether the refund signature is valid or
    167      whether some other mechanism justified the refund.  The most trivial
    168      way would probably be to allow NULL values for the signature.  However,
    169      likely a link to the extension transcript should then be stored in
    170      another column to make it easier for the auditor to look for
    171      "alternative" justifications in those cases.
    172 
    173 In case participants are identified as malicious, the auction meta data should
    174 specify the penalty those participants must pay to the seller.  Again, the
    175 exchange should assess the auction transcript and then trigger the correct
    176 transactions.
    177 
    178 The auditor of the exchange can again simulate the auction protocol and can
    179 thus confirm that the exchange's ultimate transactions were correct.
    180 
    181 Transcripts
    182 ^^^^^^^^^^^
    183 
    184 A transcript of a Brandt-Vickrey auction is the JSON encoding of an object of
    185 type `BrandtVickreyAuctionTranscript`.
    186 
    187   .. ts:def:: BrandtVickreyAuctionTranscript
    188 
    189     // This structure defines the transcript of an auction of Brandt-Vickrey kind.
    190     interface BrandtVickreyAuctionTranscript {
    191       // The auction definition.
    192       auction: BrandtVickreyAuction;
    193 
    194       // The public keys of the bidders, in Crockford Base32 encoding.
    195       bidders: EddsaPublicKey[];
    196 
    197       // Signatures of the auction in Crockford Base32 encoding.
    198       // One signature per bidder.
    199       signatures: EddsaSignature[];
    200 
    201       // List of policy hash codes that identify policy details associated with
    202       // each bidder.  Those codes were generated by the policy extension
    203       // policy_brandt_vickrey_auction during the deposit of coins for this
    204       // auction.
    205       policy_hash_codes: HashCode[];
    206 
    207       // The transcript of all messages received by the seller.
    208       transcript: BrandtVickreyAuctionMessage[];
    209 
    210       // Optionally, the seller can provide the winners it had calculated.
    211       winners?: BrandtVickreyAuctionWinner[];
    212 
    213       // The signature over the hash of this JSON object, without the
    214       // key ``sig`` and in normalized form, basically over
    215       //   H(auction, bidders, signatures, transcripts, winners?)
    216       // It is signed by the private key that corresponds to the public key
    217       // in `BrandtVickreyAuction`.``pubkey``.
    218       // This signature is in Crockford Base32 encoding.
    219       sig: EddsaSignature;
    220     }
    221 
    222 
    223   .. ts:def:: BrandtVickreyAuctionMessage
    224 
    225    interface BrandtVickreyAuctionMessage {
    226      // The index of the bidder into the
    227      // `BrandtVickreyAuctionTranscript`.``bidders`` array.
    228      bidder: number;
    229 
    230      // The raw message in Crockford Base32 encoding.
    231      msg: string;
    232 
    233      // The signature over the message.  The signature is in Crockford Base32
    234      // encoding.  It must be signed by the private key corresponding to the
    235      // bidder's public key in `BrandtVickreyAuctionTranscript`.``bidders``.
    236      sig: EddsaSignature;
    237    }
    238 
    239 
    240 
    241   .. ts:def:: BrandtVickreyAuctionWinner
    242 
    243    interface BrandtVickreyAuctionWinner {
    244      // The index of the bidder into the
    245      // `BrandtVickreyAuctionTranscript`.bidder array.
    246      bidder: number;
    247 
    248      // The index of the winning price into the
    249      // `BrandtVickreyAuction`.prices array.
    250      price_idx: number;
    251 
    252      // The winning price
    253      price: Amount;
    254    }
    255 
    256 
    257 Alternatives
    258 ============
    259 
    260 If currency is sold for currency in an auction, the seller could also escrow
    261 the currency being sold.  This could be done by a simple parallel extension
    262 for sellers that provides the seller's escrow proof as input into the auction
    263 protocol. The result would effectively be an auction-driven equivalent of the
    264 atomic swap protocols for crytocurrencies.
    265 
    266 Instead of the exchange and the auditor re-running the auction protocol
    267 internally against the transcript, it might suffice if the auction operator,
    268 seller and all bidders jointly attest to the outcome.  However, this presumes
    269 that there are no malicious participants.  Thus, this is an optimization that
    270 can help, but likely should not be relied upon.  The exchange may stipendulate
    271 different fees if auction participants provide signatures demonstrating that
    272 they agree upon the outcome of the auction.
    273 
    274 
    275 Drawbacks
    276 =========
    277 
    278 Forcing participants to escrow the largest possible bid may exclude some
    279 bidders. However, it can be assumed that the seller (wanting to get as many
    280 high bids as possible) will set a reasonable bidding range to not exclude
    281 realistic bids. If the seller set the bidding range wrong and receives no bids
    282 as a result, the auction can of course simply be repeated. Finally, excluding
    283 bidders that can only make rather low bids may help keep the number of
    284 participants managable.  Given the three application domains we focus on,
    285 it seems that the number of bidders regularly excluded from the auction due
    286 to this constraint should be acceptable.
    287 
    288 
    289 Discussion / Q&A
    290 ================
    291 
    292 A possible challenge that may require more thought is how to deal with auction
    293 participants dropping out and not sending any more messages and the
    294 equivalent attack from the auction operator of suppressing messages from
    295 certain participants.  The latter case can likely be addressed partially by
    296 network-level anonymization of all participants, as then the auction operator
    297 doesn't have the ability to target specific users. However, a conspirator
    298 could still deanonymize themselves to the auctioneer with the objective of the
    299 auction operator then suppressing messages from other (anonymous)
    300 participants and thereby possibly excluding higher bids from those users.
    301 
    302   .. note::
    303 
    304      As described above, the Master's thesis of Markus Teich proposes to
    305      address the issue of bidders dropping out of the protocol by fining them,
    306      for example by keeping (some of) the escrowed funds.  This may work, but
    307      only if we assume that the auction operator is not maliciously dropping
    308      messages from some bidders.
    309 
    310 
    311 
    312 (This should be filled in with results from discussions on mailing lists / personal communication.)