The Protocol
A deep dive into the mathematical finality and governance of the DeFiEscrow smart contracts.
Standard Settlement Workflow
The Protocol operates through a strict state machine, ensuring that funds are never moved without meeting predefined conditions.
1. Initialization
An escrow is created on-chain with a unique ID. All participating parties, their required deposits, and their expected payouts are defined upfront. The contract validates that the sum of all deposits equals the sum of all payouts.
2. Funding Phase
Parties deposit their required assets (ETH, USDC, or USDT) into the contract. Funds are held in a non-custodial manner. The state only advances to "Funded" once 100% of the required collateral is secured.
3. Consensus & Approval
Once funded, the agreement enters the review period. For funds to
be released, every party involved must call the
approve() function. This ensures total consensus
before any value is moved.
4. Automated Release
Upon reaching full approval, the release() function
becomes available. It can be triggered by anyone, and the smart
contract automatically distributes funds to the recipients'
wallets as defined during initialization.
Disputes & Resolution (No Central Authority)
Real-world deals can go wrong — but funds should never be locked indefinitely. The Protocol supports disputes using on-chain rules and a hard timeout safety mechanism.
1. Raise a Dispute
Any participant can call raiseDispute() while the escrow
is Funded or Approved. This immediately freezes the escrow to prevent
release.
2. Optional Dispute Removal (by the raiser)
The original dispute raiser can call removeDispute() to
return the escrow back to its pre-dispute state (Funded or Approved).
3. Dispute Timeout → Refund
If a dispute remains unresolved, a hard-coded timeout ensures an exit
path. After 30 days, anyone can call
resolveDisputeTimeout() to terminate the escrow and
refund deposits back to depositors.
Fail-Safes & Security
Funding Timeouts
If an escrow is not fully funded by its deadline, any party can cancel it and receive a full refund of their individual deposit.
Approval Timeouts
If the approval period expires without consensus, the contract allows for automatic termination and refunding to prevent "zombie" escrows.
Dispute Timeout
Disputed escrows cannot remain locked forever. After a fixed timeout (30 days), anyone can terminate the escrow and refund deposits.