DocsProtection

How the escrow works

Where the crypto sits during a trade, and exactly who can move it.

The escrow is a Solana program. Each offer is an account owned by that program, holding the seller's SOL directly or their tokens in a vault account that only the program controls. Nobody can take funds out except through the program's instructions, and each instruction checks who is signing.

Who can do what#

ActionWhoWhen
Create, top up, withdraw, close an offerThe sellerAny time, for the part not reserved by open trades
Open a tradePeerlock's relayer, for a signed-in buyerWhen the amount is within the offer's limits and available
Mark as paidThe buyer (via the relayer)Before the payment window ends
CancelThe buyer or relayerAny time before it's marked paid; anyone once the window has expired unpaid
Release to the buyerThe sellerAny time until the trade is settled
Open a disputeThe buyer or seller (via the relayer)After the trade is marked paid
Settle a disputeThe moderatorOnly while the trade is disputed: release to the buyer, or return to the offer

The relayer#

The relayer is a small wallet run by Peerlock. It pays the network fees and the temporary trade account deposit so buyers don't need SOL. It can open, confirm, cancel and dispute trades, all of which only reserve or unreserve funds inside an offer. It can never send escrowed crypto anywhere.

The moderator#

The moderator wallet is set in the program's configuration. Its only power over funds is settling a trade that is in dispute, and even then it can only send the crypto to that trade's buyer or back into the seller's offer, never to itself.

Verify it yourself

The program, the configuration and every trade are public on Solana. See smart contract for the addresses.

Something unclear? Ask us on X.