1

another noob question : Is it technically possible to use SSC for build a third party escrow service ?

Let's imagine an absurd scenario : Once upon a time a man named Jed. He want to sell his Nintendostation 128 for 1000 xlm.

He publish an announce on a consumer-to-consumer platform.

Joyce saw the announce and want to buy it.

The transaction scheme is then :

  • Joyce send 1200 xlm to a new account generated by the consumer-to-consumer platform.
  • A tx is generated by this new account, with a random-generated memo, and send to the stellar account of Jed.
  • Jed send his Nintendostation by a postal service to Joyce postal address, with the random-generated memo printed in the packet.
  • One Joyce receveid it, she send a tx to the consumer-to-consumer account with the random-generated memo.
  • The consumer-to-consumer account then send 1000 xlm to Jed and send back 199.9 lumens to Joyce.

The End.

Thanks in advance.

2

To start, much of the proposed above is based on trust rather than rules defined in an SSC. There are no measures preventing the consumer-to-consumer platform from just taking the money and leaving. I would recommend building a 3-Party SSC from some of the 2-Party SSC's available. In these examples, there are fail-safes in place that disincentive foul play.

Ultimately, this proposed scenario seems to be a derivation of the 2-Party Multisignature Escrow Account with Time Lock and Recovery presented in the SSC docs from Stellar.org. In fact, this is actually very similar to a Distributed Trustless Worker Smart Contract proposed by Zulu Crypto.

In Zulu Crypto's smart contract, a customer is paying a worker for generating a vanity address (a computationally expensive problem). A very basic overview of how this works is:

  1. Customer creates an escrow account with 1000 XLM.
  2. Once the escrow account is funded, two transactions are created. The first transaction is a timebounded refund that will send the 1000 XLM back to the customer in case the exchange never takes place (this ensures the funds will not be lost). The second is a transaction that makes the escrow account escrowy aka the worker and customer are added as signers with weight 1, the thresholds of the escrow account are made weight 2 and the master key of the escrow is made weight 0.
  3. Worker proves they have found such a vanity keypair.
  4. The two create a transfer transaction where:

    a. the worker sets the vanity account's signer to the customer, sets all the vanity's thresholds to 1 and sets the master key of the vanity account to 0
    b. the user and the worker merge the escrow account to the worker so the worker gets paid.

Of course, a swap of physical goods would be a little more difficult. You would have to ensure that once the package is received, the payment is made. This may require some 3rd-party such as a delivery service, or a scannable barcode that activates the transfer transaction. Nevertheless, I imagine you could follow a similar pattern to the one outlined above. Maybe instead of a 2-of-2 multisignature, you could create a 2-of-3 where the 3rd party acts as an oracle.

What is an oracle? Here are some good reads:

tldr: I believe it is possible and a good starting ground may be to experiment with and build off of some of the already existing 2-party SSC's.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.