-1

In real life it would be like putting two items at the opposite sides of a revolving door, you turn it and they can be exchanged safely.

Not only that, if the door is made out of glass, you can pretty much guess that the other person either has the actual item you requested or put a considerable amount of effort to create a decoy.

How do you translate this into technical terms?

schroeder
  • 123,438
  • 55
  • 284
  • 319
gurghet
  • 129
  • 5

2 Answers2

2

In terms of exchanging physical or virtual goods when your medium of communication is the Internet, typically exchanges like this are arbitrated by an escrow service, of which there are dozens.

There are certain special cases that can be automated in a fashion, but you'd have to come up with a specific use case if you wanted more specifics.

schroeder
  • 123,438
  • 55
  • 284
  • 319
tylerl
  • 82,225
  • 25
  • 148
  • 226
1

Apart from escrow services mentioned by @tylerl, there are cryptographic protocols called fair exchange protocols which try to achieve this property. See this page for a list of references to relevant research articles.

Most fair exchange protocols do something like this:

  1. The two data items to be exchanged are encrypted, with zero-knowledge proofs that the encryption was done properly. The two keys Ka and Kb have size n bits.
  2. The two keys are exchanged one bit at a time: Alice send first bit of Ka to Bob, Bob sends first bit of Kb to Alice, Alice sends second bit of Ka to Bob, and so on.
  3. If one of the parties bails out before protocol completion, the computational effort needed to complete the partially obtained keys are similar for Alice and Bob (hence the "fairness").

These protocols are highly technical because they need strong ZK proofs that what they send is "correct". If Alice intends on bailing out, she could also try to send junk bits to Bob and thus gain an unfair advantage. Mathematics are involved. There are also variants which try to account for an asymmetry in computing power (if Alice has a 20-PC cluster and Bob has only a smartphone, Alice may want to close the connection earlier). To my knowledge, none of these protocols have reached the "standardized and implemented as an easy-to-use library" stage.

Tom Leek
  • 168,808
  • 28
  • 337
  • 475