Escrow System
Overview

Escrow System

DeroPay includes a full on-chain escrow system for trustless buyer-seller transactions. Funds are held in a DERO smart contract and released based on predefined conditions.

Why Escrow?

Standard invoices work for trusted merchants, but many scenarios require a neutral third party:

  • Marketplaces — Buyer pays, seller ships, funds release on confirmation
  • Freelance work — Client deposits, freelancer delivers, funds release on approval
  • P2P trades — Neither party trusts the other; contract holds funds until both agree
  • Dispute resolution — An arbitrator can intervene if buyer and seller disagree

How It Works

Status Codes

CodeStatusDescription
0awaiting_depositEscrow created, waiting for buyer's DERO
1fundedBuyer has deposited, awaiting seller action
2releasedFunds sent to seller
3refundedFunds returned to buyer
4expired_claimedTime limit reached, seller claimed funds
5disputedDispute raised, awaiting arbitrator
6arbitratedArbitrator has resolved the dispute

Components

Smart Contract (escrow.bas)

A DERO smart contract written in BASIC that holds funds and enforces escrow rules. See Smart Contract.

TypeScript SDK

  • EscrowContract — Low-level wrapper around the contract's RPC functions
  • EscrowManager — High-level lifecycle manager that handles the full escrow flow

See TypeScript SDK.

The escrow contract supports platform fees (in basis points), so marketplaces can take a cut of each transaction automatically at the contract level.