Since it promises to be quite revolutionary, for peer-to-peer trading, the announcement of local.Bitcoin.com (LBC) has attracted a lot of attention. But its main enabling feature, the blind escrow, is technical and this might leave most people suspicious of the platform, as they can’t verify the claims. To be transparent about it, Bitcoin.com published the bitcoin scripts/contracts used in the escrow but, in practice, that mostly satisfies the curiosity of people that already have the technical knowledge. It does little to help the general audience understand how it works.
In this post I’ll try to establish a bridge and translate the contract in simple terms. You can jump right to the bottom but I’ll start with an high level view and a description of typical situations before getting to the escrow itself. Hopefully things will be clear enough, by then, for you to “get it” without needing to blindly trust yet another person on the Internet.
The high level view
First, some high level view of the process. In general, LBC could be used for any trade paid with Bitcoin Cash. The same way you can choose “Cash (in person)”, meaning you will meet in person and pay cash for BCH, you could agree to trade stamps or even potatoes for BCH. The point is that one part of the trade is off-chain and only the seller and the buyer know about it. This is important because this also means that the seller (the one with BCH) is the one that must make the first Bitcoin Cash transaction (to lock the funds in the blind escrow) and typically it’s the buyer (the one wanting BCH) that finally spends those funds into their wallet.
The typical situation
Below is a sequence showing the typical situation. As mentioned, the seller is the one that locks the Bitcoin Cash into the escrow. To do that, first he sends the agreed BCH into an addresses provided by LBC. This money can only be moved out when both the seller and buyer agree that the trade is finished. After that, the buyer gives the fiat money to the seller to pay for the Bitcoin Cash.
The "magical" step happens afterwards. The seller, after receiving the fiat money and checking it is good, does not sign the escrow contract. Instead, he passes a unique stamp back to the buyer. This stamp is unique to this particular escrow and serves as a replacement for a standard signature. This means that, after this point, the seller can continue his merry life because the buyer has everything needed to take the Bitcoin Cash out of the escrow. She uses the seller's stamp to mark its approval and then does a normal signature, like in any other Bitcoin Cash transaction. Since this last step is a new transaction she could move the money to any wallet she wanted although, since this process is automated by LBC, the BCH will go to the buyer’s LBC wallet.
In the the typical situation, where the seller and buyer all behave nicely, there's two Bitcoin Cash transactions and no other party is involved. But the key aspect is that only the person taking the Bitcoin Cash, that is, making the withdrawal transaction needs to sign the transaction. The other party is replaced by a unique stamp and it's this mechanism (enabled by the new opcode) that allows Bitcoin.com to participate as an arbiter. Bitcoin.com's stamps can replace either party in the escrow.
Not so typical situations
Maybe the most common problem, for the honest buyer, is when the seller runs away after receiving the fiat money, goes missing unexpectedly, or demands more money or conditions to accept the trade and pass the approval stamp to the buyer. In all those cases, the result is the same: fiat is gone, Bitcoin Cash is out of reach.
That’s when the blind escrow requiring only one signature comes in handy. She can sign her part but needs to ask Bitcoin.com for a stamp that replaces the seller’s. After showing that the money was deposited as agreed and getting the replacement stamp, she can make the withdrawal transaction.
Obviously, the same can happen the other way around, that is, the seller can deposit the Bitcoin Cash and then the buyer goes missing for a long period of time. In that case, Bitcoin.com will provide, to the seller, a stamp that replaces the buyer and the seller can take back his Bitcoin Cash from the escrow. What can’t happen, is having the Bitcoin Cash taken by Bitcoin.com. The escrow always requires one signature from either the seller or buyer and the person doing the signature is the one deciding where the Bitcoin Cash goes
The translated escrow
From the high level view we can already see that there are 4 ways the escrow can be resolved. The important aspect is that only one participant signs and the other is replaced by a stamp. The rest of the contract are just technical details. You can find the escrow script in LBC’s faq. Here’s my translation of it.