Skip to content
This repository was archived by the owner on Sep 5, 2026. It is now read-only.
RzbytePublic archive

About

Trust layer for verifiable autonomous agent work on PortalDot. Clients escrow POT rewards, worker agents lock a bond and submit deterministic result hashes, verifier agents validate before onchain settlement.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

Bondot

Trust layer for verifiable autonomous agent work on PortalDot.

Bondot is a PortalDot-based trust layer for verifiable autonomous agent work. Clients create onchain task escrows with rewards, worker agents accept tasks by locking a bond, worker agents submit deterministic result hashes, and verifier agents validate submitted results before settlement. The MVP demonstrates a verifiable worker-verifier trust loop on PortalDot using POT for transaction gas.


Project Overview

Problem Statement

Autonomous agent work needs trust. Clients need proof that a task was accepted, a result was submitted, verification happened, and settlement followed onchain rules. Without an onchain trust layer, agent work is unverifiable — there is no transparent mechanism to ensure agents deliver quality and get paid fairly.

Solution

Bondot provides an onchain trust loop:

  1. Client creates task escrow with a POT reward locked in the contract.
  2. Worker agent accepts the task and locks a POT bond, committing to deliver.
  3. Worker agent submits a deterministic result hash onchain.
  4. Verifier agent submits PASS/FAIL with a verification hash.
  5. Contract settles — PASS: reward + bond → worker. FAIL/Timeout: reward → client, bond → worker.

Blockchain Relevance

Bondot uses PortalDot smart contract state as the onchain source of truth for:

  • Agent identity and registration
  • Task lifecycle (created, accepted, submitted, settled)
  • Worker bond locking
  • Result hash recording
  • Verifier decision
  • Settlement disbursement

POT is used as transaction gas for every onchain action.


Technical Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        Client Web App                           │
│           (Next.js · @polkadot/extension-dapp)                  │
│     Register Agents · Create Tasks · Sign Transactions          │
└───────────────┬────────────────────────┬────────────────────────┘
                │ wallet tx              │ wallet tx
                ▼                        ▼
┌──────────────────────┐    ┌───────────────────────┐
│    Worker Agent      │    │   Verifier Agent       │
│  (offchain script)   │    │  (offchain script)     │
│  Generates result    │    │  Validates result       │
│  + result_hash       │    │  + verification_hash   │
└──────────┬───────────┘    └──────────┬─────────────┘
           │ submit_result()           │ submit_verification()
           │                           │
           ▼                           ▼
┌─────────────────────────────────────────────────────────────────┐
│                   Bondot Smart Contract                         │
│              (ink! / Rust · deployed on PortalDot)              │
│                                                                 │
│  register_agent · create_task · accept_task                     │
│  submit_result · submit_verification · settle                   │
└───────────────────────────┬─────────────────────────────────────┘
                            │
                            ▼
               ┌────────────────────────┐
               │    PortalDot Node      │
               │  (Substrate / ink!)    │
               │   POT gas for txs      │
               └────────────────────────┘

Core Stack:

  • Blockchain: PortalDot (Substrate-based)
  • Smart Contract: ink! / Rust
  • Frontend: Next.js 14, React 18, TypeScript, Tailwind CSS
  • Wallet: Polkadot-JS Extension / PortalDot Extension (@polkadot/extension-dapp)
  • Contract Interaction: @polkadot/api-contract
  • Offchain Agents: Python 3 scripts (deterministic, no LLM/GPU required)
  • Gas: POT

Smart Contracts

Contract directory: lib.rs (ink! contract at project root)

Build artifacts (after cargo contract build --release):

  • target/ink/pot_agent_escrow.contract
  • target/ink/pot_agent_escrow.wasm
  • target/ink/pot_agent_escrow.json

Note: Final local PortalDot deployment evidence is still pending and will be added after the local PortalDot deployment phase.

Contract Functions

Function Description
register_agent(metadata_hash, capabilities_hash, role) Register an agent onchain with role (Worker/Verifier/Orchestrator/Specialist) and metadata.
update_agent(metadata_hash, capabilities_hash) Update an existing agent's metadata and capabilities hashes.
deactivate_agent() Deactivate the calling account's agent registration.
create_task(verifier_agent, reward, required_bond, task_hash, verification_deadline) Create a new task escrow. Locks reward in contract. Payable — reward value must be sent with call.
accept_task(task_id) Accept a task as worker agent. Locks bond in contract. Payable — bond value must be sent with call.
submit_result(task_id, result_hash) Submit a 32-byte result hash for an accepted task.
submit_verification(task_id, passed, verification_hash) Submit verifier decision (PASS/FAIL) with 32-byte verification hash. Triggers settlement.
claim_verification_timeout(task_id) Claim timeout if verifier has not responded by the deadline block.
cancel_unaccepted_task(task_id) Cancel a funded task that has not yet been accepted and refund client.
get_task(task_id) Read-only query: returns full task state.
get_agent(account) Read-only query: returns agent registration record.

Installation & Setup

Requirements

  • Rust with cargo-contract CLI
    cargo install cargo-contract --version 4.1.1 --force
  • Node.js ≥ 18 and npm
  • Python ≥ 3.9 (for agent scripts)
  • A running local PortalDot/Substrate node (see local node note)

Clone Repository

git clone https://github.com/sz-dev/portaldot-hackathon-2026-bondot-sz.git
cd portaldot-hackathon-2026-bondot-sz

Contract — Run Tests & Build

# Run unit tests
cargo test

# Build contract (generates target/ink/ artifacts)
cargo contract build --release

Expected output: 45/45 unit tests pass, artifacts generated in target/ink/.

Frontend — Install & Run

cd frontend

# Install dependencies
npm install

# Copy .env.local.example to .env.local and configure
cp .env.local.example .env.local
# Edit .env.local: set NEXT_PUBLIC_PORTALDOT_RPC_URL and NEXT_PUBLIC_ESCROW_CONTRACT_ADDRESS

# Copy contract ABI metadata to public dir
bash copy-metadata.sh

# Run dev server
npm run dev

Frontend runs at http://localhost:3000.

Agent Scripts

cd agents

# Worker agent — process task and produce result hash
python3 worker_agent.py --task-id 1

# Verifier agent — validate result (PASS)
python3 verifier_agent.py \
  --task-id 1 \
  --result output/worker_result.json \
  --spec mock_data/verification_spec.json

# Keeper agent — check timeout
python3 keeper_agent.py \
  --task-id 1 \
  --current-block 120 \
  --verification-deadline 100 \
  --status Submitted

# Run agent tests
python3 -m pytest tests/ -v

Local PortalDot Node

A local PortalDot/Substrate node is required for live contract interaction. See your community portaldot-node-guide for setup instructions. Default local RPC: ws://127.0.0.1:9944.


Demo

Demo Video: TBA (being prepared — see roadmap)

Core Demo Flow

Step Actor Action
1 Alice (Client) Register Worker Agent (Bob)
2 Charlie Register Verifier Agent (Charlie)
3 Alice (Client) Create task with POT reward
4 Bob (Worker) Accept task, lock bond
5 Bob (Worker) Submit deterministic result hash
6 Charlie (Verifier) Submit PASS verification
7 Contract Settle — reward + bond → worker
8 Frontend Show lifecycle and transaction proof

Test Role Mapping:

  • Alice = Client / Deployer
  • Bob = Worker Agent
  • Charlie = Verifier Agent

Roadmap

Phase Goal
Phase 1 Submission packaging — README, LICENSE, docs, rebranding
Phase 2 Local PortalDot deploy and first onchain proof
Phase 3 Full Bondot lifecycle onchain (register → create → accept → result → verify → settle)
Phase 4 Frontend proof UX — live tx hash display, block confirmation
Phase 5 Demo video and evidence capture
Future Self-hosted agent worker, agent marketplace, multi-verifier quorum, reputation system, orchestrator/specialist workflows

Team

Team Name: SZ

Member: SZ — Solo Developer


License

MIT — see LICENSE


Honesty Disclaimer

  • This project is an MVP / work in progress.
  • The smart contract is not yet deployed to a live or production PortalDot network.
  • Real onchain transaction evidence is still pending (will be captured in Phase 2).
  • POT gas/fee proof is still pending.
  • Offchain agent scripts support the workflow but do not currently auto-submit onchain transactions — the smart contract is the onchain source of truth.
  • No LLM, GPU, or AI model is required to run this MVP.
  • No fully autonomous onchain agent autonomy is claimed.

About

Trust layer for verifiable autonomous agent work on PortalDot. Clients escrow POT rewards, worker agents lock a bond and submit deterministic result hashes, verifier agents validate before onchain settlement.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages