Official Documentation

Merge Protocol

The deterministic execution layer for professional work.Merge combines cryptographic escrow with on-chain arbitration to create trustless gig economies.

The Philosophy

In a world of subjective deliverables, Merge Protocol introduces objectivity. We treat professional gigs like software commits: they are either verified and merged, or rejected.

Traditional freelancing platforms differ by acting as centralized intermediaries. Merge acts as a protocol—a set of immutable rules that govern the exchange of value for value.

Escrow

Funds are locked in a smart contract before work begins. No rug pulls.

Arbitration

Decentralized arbiters resolve disputes using on-chain evidence.

Factory Pattern

Every job spawns its own isolated, deterministic smart contract. No shared state risk.

Protocol Architecture

MergeFactory.solDeployer Contract
Router & Registry. Owns the canonical list of all jobs.
postJob()Clones
GigEscrow 1Job #001
GigEscrow 2Job #002
... GigEscrow N
1. Isolation

Each job is a separate smart contract with its own balance and state. This prevents a hack in one job from draining the entire protocol.

2. Immutability

Once a GigEscrow is deployed, its rules (Client, Freelancer, Bounty, Terms) are mathematically enforcing and cannot be changed by the Factory.

3. Transparency

The Factory maintains an enumerable registry `jobs[]`, allowing the frontend to index and display all historic gigs without a database.

Escrow Lifecycle

1. Job Created

Client deposits Bounty + Fees. Escrow is deployed in 'Open' state.

2. Application

Freelancers apply. Client selects one. Escrow moves to 'Locked' state.

3. Submission

Freelancer submits work (PR URL). Review window starts ticking.

4. Settlement

Client approves OR auto-release timer hits 0. Funds released.

Dispute Mechanism

At any point during the "Locked" state, either party can raise a dispute. This freezes the funds and summons the Arbiter. The Arbiter then decides the split (e.g. 50/50 refund, or 100% to freelancer) based on evidence.

Hybrid Architecture

We use a Hybrid Indexing approach. Critical financial data (Bounties, State) lives on-chain, while rich text data (Descriptions, PR links) is stored in Supabase for fast retrieval.

Writing (Posting a Job)

  1. Blockchain Deploy: We call Factory.postJob() with the bounty (ETH). This deploys the Escrow contract.
  2. Event Indexing: We wait for the `JobCreated` event to get the new contract address.
  3. Supabase Sync: We immediately POST the job description, repo URL, and contract address to our Supabase `UserJobs` table.

Reading (Browsing Jobs)

  1. Chain + DB Merge: We fetch active jobs from the Blockchain (via Events) to ensure trustlessness.
  2. Rich Data Hydration: For each job, we query Supabase to fetch the full markdown description and repository details.
  3. State Validity: If Supabase goes down, the Bounties remain safe and withdrawal is still possible directly via Etherscan.

Smart Contract Reference

Gig Escrow Template

The GigEscrow is the atomic unit of the protocol. When a job is posted, the Factory clones this logic. It handles the state machine (Locked, In-Review, Completed, Disputed) and holds the bounty funds trustlessly until release conditions are met.

Escrow ABI (Template)

Ready to Build?

The Merge Protocol is open-source and waiting for your contribution. Fork the repo, submit a PR, or just explore the code.

View on GitHub
Crafted by the Developer

O.G Ayanfe

Full-stack Web3 developer building the future of decentralized work. Passionate about clean code, smooth UI, and trustless protocols.