Documentation

Everything you need to build, integrate, and use YBZ trustless escrow platform.

Getting Started

New to YBZ? Start here to learn the fundamentals.

What is YBZ?

YBZ is a decentralized escrow platform built on Ethereum smart contracts. It enables trustless transactions between buyers and sellers without relying on centralized intermediaries.

Key Features:

  • β€’ Immutable Smart Contracts: Code cannot be changed after deployment
  • β€’ Multi-Token Support: ETH, USDT, and USDC
  • β€’ Automatic Time-based Protections: Prevent indefinite fund locks
  • β€’ Decentralized Arbitration: Fair dispute resolution by neutral arbiters

Core Concepts

Deals

A Deal is an escrow transaction between a buyer and seller. The buyer locks funds in the smart contract, and they are released based on deal terms and outcomes.

Time Windows

Every deal has three time windows: Accept Window (1h-30d), Submit Window (1h-180d), and Confirm Window (1h-30d). These protect both parties from indefinite waiting.

Deal States

Deals progress through states: Created β†’ Accepted β†’ Submitted β†’ Approved/Disputed β†’ Closed. Each state has specific allowed actions.

Arbitration

If disputes arise, neutral arbiters review evidence and make binding decisions. Arbiter fees (1%) are only charged when disputes occur.

Create Your First Deal

1

Connect Your Wallet

Use MetaMask, WalletConnect, or any Web3 wallet. Ensure you're on Ethereum Mainnet.

await window.ethereum.request({ method: 'eth_requestAccounts' });
2

Initialize Contract

Create a contract instance with the YBZ Core address.

const contract = new ethers.Contract( '0xAe1D3Af...Ec15611', YBZCore.abi, signer );
3

Call createDealETH()

Specify seller address, time windows, and send ETH value.

const tx = await contract.createDealETH( sellerAddress, 86400, // 24h accept window 604800, // 7d submit window 259200, // 3d confirm window ethers.constants.AddressZero, '', { value: ethers.utils.parseEther('1.0') } );
4

Monitor Events

Listen for DealCreated event to get your deal ID.

contract.on('DealCreated', (dealId, buyer, seller) => { console.log('Deal ID:', dealId.toString()); });

Smart Contract API

Complete reference of all contract functions and events

Core Functions

createDealETH()

Create a new escrow deal using ETH as payment

Parameters:
  • address seller - Seller's Ethereum address
  • uint256 acceptWindow - Time for seller to accept (1h-30d)
  • uint256 submitWindow - Time for seller to submit work (1h-180d)
  • uint256 confirmWindow - Time for buyer to confirm (1h-30d)
  • address arbiter - Optional arbiter address (use AddressZero for random)
  • string description - Deal description or IPFS hash
Returns:

Emits DealCreated event with deal ID

Gas Estimate:

~150,000 - 200,000 gas

acceptDeal()

Seller accepts the deal and locks escrow

Parameters:
  • uint256 dealId - ID of the deal to accept
Requirements:
  • β€’ Must be called by seller address
  • β€’ Deal must be in Created state
  • β€’ Must be within accept window

submitWork()

Seller submits proof of completed work

Parameters:
  • uint256 dealId - ID of the deal
  • string proof - IPFS hash of work proof
Best Practice:

Upload deliverables to IPFS and include the hash. Add screenshots, links, or detailed descriptions in IPFS metadata.

Network & Contract Info

Essential addresses and network details

Ethereum Mainnet

YBZ Core Contract

0xAe1D3Af...Ec15611

Chain ID

1

Chainlink ETH/USD Feed

0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419

Supported Tokens

Ethereum (ETH) Native

Tether (USDT)

0xdAC17F958D2ee523a2206206994597C13D831ec7
6 decimals

USD Coin (USDC)

0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
6 decimals

Default Arbiters (Mainnet)

Arbiter #1

0x1234567890123456789012345678901234567890

Arbiter #2

0x0987654321098765432109876543210987654321

Guides & Tutorials

Learn best practices and common workflows

Deal Lifecycle Management

Understand how deals progress through states and what actions are available at each stage.

Read Guide

Security Best Practices

Learn how to validate inputs, handle errors, and protect your users from common vulnerabilities.

Read Guide

Time Window Strategy

Choose appropriate time windows for different use cases and protect both parties from delays.

Read Guide

Dispute Prevention

Best practices to avoid disputes through clear communication and proper documentation.

Read Guide

Start Building Today

Integrate trustless escrow into your application with comprehensive documentation and support.