TESTNET|Using MockMNEE tokens — not real value
Back

Commit Protocol

Optimistic Agentic Settlement for On-Chain Work Commitments with Discord Integration

Complete Technical Specification v2.0

WHITEPAPERLast updated: January 2026

Overview

What is Commit Protocol?

Commit Protocol is a trustless escrow system for work commitments that combines:

Smart contract escrow (MNEE ERC-20 on Ethereum)
Discord server integration (prepaid balance)
AI-powered verification (automated review)
Optimistic settlement (auto-release via cron)
Dynamic economic security (reputation-based)

MNEE Token

Token

MNEE

Network

Ethereum

Standard

ERC-20

Decimals

18

0x8ccedbAe4916b79da7F3F612EfB2EB93A2bFD6cF

Testing: Fork mainnet using Anvil (no testnet available)

Problem Statement

Manual payment releases (slow, requires multisig)
Separate payment wallets per user (complex UX)
Subjective "done" definitions (endless disputes)
Fixed dispute costs (wrong scale for tasks)
No reputation tracking (same treatment for all)

Solution

Discord server registration (15 MNEE)
Prepaid balance (one MNEE pool per server)
Secure relayer pattern (bot verifies roles)
Automatic settlement via cron job
AI verification defines objective criteria
Dynamic stakes scale with value & reputation

Discord Integration

Registration Flow

Admin/register-serverBot
BotPlease approve 15 MNEEAdmin
AdminregisterServer(guildId, adminId)Contract
ContractTransfer 15 MNEE → Store data → Emit event
Bot✓ Registered! Deposit MNEE to start

Balance Management

Each Discord server has a prepaid MNEE balance tracked on-chain:

FieldDescription
totalDepositedLifetime MNEE deposited (never decreases)
totalSpentLifetime MNEE spent on commitments
availableBalanceCurrent spendable balance

Invariant: availableBalance = totalDeposited - totalSpent

Role-Based Access Control

The protocol uses Discord roles verified off-chain by the bot:

Server AdminadminDiscordId

Registered during server registration. Can deposit/withdraw MNEE balance.

commit-creatorDiscord role

Configured in Discord server settings. Can create commitments using server balance. Bot verifies role before contract call.

ContributorsAny user

Any Discord user with linked wallet. Can submit work and receive payments.

Core Concepts

The protocol is built on four foundational principles:

Prepaid Escrow

Servers fund a balance upfront. Commitments deduct from this pool, eliminating per-transaction approvals.

Optimistic Settlement

Work is assumed valid unless disputed. Auto-settles after deadline + dispute window.

Relayer Pattern

Bot wallet is the sole caller. Verifies Discord permissions off-chain, executes on-chain.

Dynamic Stakes

Dispute costs scale with task value and participant reputation. Fair for all sizes.

Smart Contract Specification

Data Structures

ServerData

uint256 guildId

uint256 adminDiscordId

bool isActive

uint256 registeredAt

uint256 totalDeposited

uint256 totalSpent

uint256 availableBalance

CommitmentData

address creator // relayer

address contributor

address token

uint256 amount

uint256 deadline

uint256 disputeWindow

string specCid

string evidenceCid

State state

uint256 createdAt

uint256 submittedAt

Core Interface

SERVER MANAGEMENT

registerServer(uint256 _guildId, uint256 _adminDiscordId)

depositToServer(uint256 _guildId, uint256 _amount)

withdrawFromServer(uint256 _guildId, address _to, uint256 _amount)

COMMITMENT LIFECYCLE

createCommitment(guildId, contributor, token, amount, deadline, disputeWindow, specCid)

submitWork(uint256 _guildId, uint256 _commitId, string _evidenceCid)

openDispute(uint256 _guildId, uint256 _commitId)

SETTLEMENT (RELAYER ONLY)

settle(uint256 _commitId)

batchSettle(uint256[] _commitIds)

ARBITRATION

resolveDispute(uint256 _commitId, bool _favorContributor)

Key Events

ServerRegistered(guildId, adminDiscordId)
ServerDeposited(guildId, amount, newBalance)
ServerWithdrew(guildId, to, amount)
CommitmentCreated(commitId, creator, contributor, ...)
WorkSubmitted(commitId, evidenceCid, timestamp)
CommitmentSettled(commitId, recipient, amount)

Commitment Lifecycle

State Machine

[*]FUNDED createCommitment()

FUNDEDSUBMITTED submitWork()

SUBMITTEDDISPUTED openDispute() [within window]

SUBMITTEDSETTLED batchSettle() [after window]

DISPUTEDSETTLED resolveDispute(CONTRIBUTOR)

DISPUTEDREFUNDED resolveDispute(CREATOR)

State Definitions

StateDescriptionTrigger
FUNDEDMNEE deducted from server balance, commitment createdRelayer (via bot)
SUBMITTEDContributor submitted work + evidence CIDRelayer (via bot)
DISPUTEDCreator opened dispute with required stakeRelayer (via bot)
SETTLEDFunds released to contributorCron job
REFUNDEDFunds returned to server balanceArbitrator

Note: CREATED state is unused — commitments are FUNDED immediately upon creation.

Economic Model

Fee Structure

Server Registration15 MNEE
Commitment CreationFree*
Work SubmissionFree
SettlementFree

*Deducted from pre-funded server balance

Dispute Stakes

Base Stake10% of amount
Minimum Stake1 MNEE
Stake RecipientWinner

Loser forfeits stake to winning party

Security Model

Data Flow

User/commandBot

BotCheck RoleDiscord API

DiscordRole OKBot

BotSign TXRelayer Wallet

RelayerCallSmart Contract

Trust Assumptions

Bot private key is secure

The relayer wallet key is the root of trust. It's the only way to call contract.

Discord API correctly reports roles

We trust Discord to accurately report user identities and role memberships.

Contract trusts relayer

All calls from the relayer address are treated as pre-verified for permissions.

Security Guarantees

Only registered servers can create commitments
Only relayer wallet can call protected functions
Server balance prevents overspending
No on-chain role storage (reduced gas costs)

Deployment Guide

Prerequisites

Foundry installed
Ethereum RPC URL
MNEE tokens
Private key

Local Deployment (Anvil Fork)

# Start Anvil with mainnet fork

./scripts/start-anvil.sh

# Fund test wallet with MNEE

./scripts/fund-test-wallet.sh 10000 0xf39F...266

# Deploy contract

forge script script/DeployLocal.s.sol:DeployLocal \

--rpc-url http://localhost:8545 --broadcast

# Set relayer (bot wallet)

cast send $CONTRACT "setRelayer(address)" $BOT_WALLET \

--rpc-url http://localhost:8545 --private-key $KEY

Mainnet Deployment

# Configure .env

ETH_MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/KEY

PRIVATE_KEY=0x...

ARBITRATOR_ADDRESS=0x...

# Deploy and verify

forge script script/Deploy.s.sol:DeployMainnet \

--rpc-url $ETH_MAINNET_RPC_URL \

--broadcast --verify \

--etherscan-api-key $ETHERSCAN_API_KEY

Testing

# Run all tests

forge test -vv

# Specific test

forge test --match-test testRegisterServer -vvvv

# Gas report

forge test --gas-report

Test Coverage

Server registration (15 MNEE fee)
Balance deposit/withdrawal
Commitment creation with deduction
Insufficient balance protection
Relayer access control
Batch settlement
Admin functions

Built With

SolidityTypeScriptNode.jsDiscord.jsMongoDBFoundryOpenZeppelin