In this post we’re going to talk about one of the most interesting of Zano’s features, Escrow contracts.
Our goals for ecommerce
Zano as a project aims to make anonymous p2p transaction as simple as they can be. One of the most practical use cases for this is ecommerce on a private blockchain. Generally, users must trust each other or a 3rd party to be sure that an online transaction goes as planned, and in order to make this happen they must give up their privacy.
Zano offers a unique solution to this issue of trust. Using an escrow system, both parties are asked to offer an agreed upon number of coins as collateral. This doesn’t have to be the same amount for each person, it depends on the risk for each side. These coins are returned to each person once the deal is done and confirmed by both sides. If the participants don’t follow through the coins in escrow are burned. All this is done with the Zano wallet using the contract proposal-response system built into the app and maintains each user’s anonymity.
Zano escrow mechanics
- Alice wants to buy an item from Bob for 100 ZAN
- Alice prepares an escrow transaction template that will transfer a total of 300 ZAN from both participants on a 2-of-2 multisig. The first key belongs to Alice and the second key to Bob.
- Alice can include details, including delivery instructions, messages etc., all of which will been encrypted and are only retrievable by Bob.
- This data type was described above as transaction attachments and while the hash of the attachment will be verifiable indefinitely on the blockchain, the actual attachment data will fall off after passing checkpoints to manage blockchain bloat as this information at some point in the future loses its relevance. For example, the shipping details including name, address etc. on a package you received a year ago is no longer relevant.
- Alice adds her inputs with 200 ZAN and sends the proposal transaction template (which is not yet semantically correct) to Bob for his consideration.
- Upon acceptance, Bob adds his input for 100 ZAN and broadcasts the transaction (which now becomes semantically correct) to the network. At this point the funds involved in the transaction are locked.
- Bob, pursuant to their agreement, sends the item(s) to Alice and waits for a response.
- If Alice is satisfied with the order, both users sign a new transaction, which unlocks the money and sends 100 ZAN back to Alice and 200 ZAN to Bob.
- Other scenarios may include: Alice sends the goods back to Bob, both get their money back, or Alice keeps defective goods, asks for compensation and Alice and Bob share the money 50/50, and so on.
- If anyone breaks the escrow (Bob does not send any goods or Alice receives the shipment, but refuses to sign the money unlocking transaction), both will lose more than they would receive (Bob loses 100 ZAN or Alice pays twice for the goods). Therefore, it is in everyone’s best interest to play fair.
On a technical level Zano Escrow Contracts are joint or consolidated transactions created by two users locked with 2-of-2 miltisig, that can only be unlocked by both parties.
- Alice prepares the main multisig output, adds all relevant data (her inputs, outputs for balance of payments, attachments, etc.) and signs the transaction. She also uses a special flag TXFLAG SIGNATURE MODE SEPARATE, which will activate the core’s special advanced mode of transaction signature protocol verification.
- At this point the transaction is incomplete: the total output sum is greater than the total input sum. Bob needs to fund his portion of the transaction, so Alice sends a transaction template (transaction information) to Bob as a special attachment.
- If Bob accepts this proposal (transaction template), then Bob funds his portion of the transaction and signs it. Once the transaction template is fully funded, and signed, the transaction is considered valid and can be broadcast to the network and subsequently included in the blockchain.
Additional tech details could be found in Zano Whitepaper
How to do contracts in wallet
Each escrow contract starts with the buyer proposal. Once it’s sent the deposit amount will be locked for a time until the response period. If during this period seller accepts the terms, an escrow contract will be activated. To initiate the process, navigate to wallet Contracts tab and choose New Purchase.
Proposal details are the following:
Description — title or description for contract subject
Seller — wallet address of merchant or seller
Amount — payment amount for goods or services
Your deposit — sum of collateral and payment amount
Seller deposit — collateral from seller required by buyer
Comment — additional information like order ID, delivery address, etc.
Fee — transaction fee amount
Time until response — proposal expiration time
Payment ID — transaction payment identifier provided by seller
When the seller accepts the proposal a special multi signature transaction will be sent to the blockchain. Then after 10 confirmations a new contract will be started. The seller can now fulfill contract terms like shipping the item to the buyer.
The buyers contract window will get three options to continue with: Cancel and return deposits, Terminate and burn deposits, or Complete and release deposits.
Cancel & return deposits
The buyer can send a cancellation offer to return both deposits and close the contract. The seller can accept or ignore this offer within a given response time. This option is useful when deal is mutually canceled.
Terminate & burn deposits
When parties cannot find mutual agreement on any occasions one can decide to burn the deposits completely and close the contract. In that case deposits will not be returned ever.
Complete & release deposits
If buyer is satisfied with the delivery or a provided service the contract can be closed. Releasing the deposits will return both party’s coins.
The complete manual could also be found on Zano resources website
Hopefully that was helpful. Our goal is to bring the crypto community one step closer to a safe and secure method of ecommerce without sacrificing privacy.