OrbitStream provides two escrow mechanisms for marketplace and freelance transactions:
- Claimable Balances (Stellar Classic) — simple, low-cost escrow for straightforward buyer-seller transactions
- Soroban Escrow Contract — programmable escrow for complex flows with custom logic, multi-party arbitration, or dispute resolution
Stellar's native Claimable Balances provide escrow-like functionality without deploying a smart contract.
Buyer Stellar Network Seller
| | |
| Create Claimable Balance | |
| (seller as claimant, | |
| buyer after timeout) | |
|--------------------------->| |
| | |
| Funds locked on-chain | |
| | |
| | Seller delivers goods |
| | |
| | Seller claims balance |
| |<-------------------------|
| | |
| If timeout passes: | |
| Buyer reclaims funds | |
|<---------------------------| |
create_claimable_escrow(buyer, seller, asset, amount, timeout_hours)— creates Claimable Balance with seller as immediate claimant, buyer as post-timeout claimantclaim_escrow(claimant, balance_id)— seller claims immediately, buyer claims after timeoutget_claimable_escrow(balance_id)— returns balance status and details
- Simple marketplace transactions
- Minimal gas cost needed
- No custom release conditions
- No contract deployment required
For complex escrow flows requiring custom logic, multi-party arbitration, or programmable conditions.
- Requires buyer auth
- Validates amount > 0 and timeout > 0
- Creates escrow record with Active status
- Emits EscrowCreated event
- Returns unique escrow_id
- Requires seller auth
- Escrow must be Active
- Sets status to Released
- Emits EscrowReleased event
- Requires buyer auth
- Escrow must be Active
- Current time must be past timeout_at
- Sets status to Refunded
- Emits EscrowRefunded event
- Read-only
- Returns escrow details or EscrowNotFound
pub struct Escrow {
pub id: u64,
pub buyer: Address,
pub seller: Address,
pub token: Address,
pub amount: u128,
pub status: EscrowStatus,
pub created_at: u64,
pub timeout_at: u64,
}
pub enum EscrowStatus {
Active = 0,
Released = 1,
Refunded = 2,
}- EscrowNotFound
- Unauthorized
- EscrowAlreadySettled
- TimeoutNotReached
- InvalidAmount
- InvalidTimeout
- Claimable Balances are the default escrow mechanism for simplicity and cost efficiency
- Soroban contract is opt-in for advanced use cases
- No smart contract token transfer in Phase 1 — escrow is a record-keeping contract
- Timeout is ledger-timestamp based (seconds since epoch)
- Only buyer can create and refund; only seller can release
- Single escrow per transaction (no batching)