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#
| Action | Who | When |
|---|---|---|
| Create, top up, withdraw, close an offer | The seller | Any time, for the part not reserved by open trades |
| Open a trade | Peerlock's relayer, for a signed-in buyer | When the amount is within the offer's limits and available |
| Mark as paid | The buyer (via the relayer) | Before the payment window ends |
| Cancel | The buyer or relayer | Any time before it's marked paid; anyone once the window has expired unpaid |
| Release to the buyer | The seller | Any time until the trade is settled |
| Open a dispute | The buyer or seller (via the relayer) | After the trade is marked paid |
| Settle a dispute | The moderator | Only 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.