Docsarchitecture

Protocol Architecture & Topology

A technical deep dive into BotPay transaction pathways, batch settlement mechanisms, zero-knowledge credentials verification, and automated netting engines.

Unified System Topology

BotPay coordinates transactions between three distinct environments: client-side Web3 browsers, server-side bot microservices, and on-chain registries.

Escrow & Webhook Pipeline
Customer Browser
Bot Server
BotPay Contract
1. Access Bot
2. createIntent()
3. Pay Payload
4. authorizeIntent()
5. Payment Webhook
6. claimStream()
7. Settled USDC
1

Access Bot Lifecycle Phase

GET /api/bots/sla

Payer initiates connection and requests specialized task execution specifications.

Step-by-step lifecycle: (1) Payer accesses the bot. (2) Bot requests a unique Payment Intent. (3) Bot returns details to browser. (4) Payer sends native USDC directly to the contract. (5) On-chain events trigger webhooks. (6) Bot performs service and claims accrued funds linearly.

Netting Engine Topology

Rather than claiming streams one-by-one (incurring separate transaction fees), BotPay utilizes an off-chain Netting Engine that compiles multi-agent allocations and submits a unified settlement receipt:

Off-Chain Batch Reconciliation
Active Linear Streams
BotPay.sol Escrowed Balance
Telemetry Listener
Telemetry Engine Server
Netting Calculation
Off-chain Netting Engine
NettingSettler.sol
On-chain Batch Settlement Contract

Netting optimization: The off-chain engine listens to state parameters, matches opposing balance streams (e.g. Bot A owes Bot B 10 USDC, Bot B owes Bot A 8 USDC), calculates net settlement requirements (Bot A pays Bot B 2 USDC), and executes a single write call on the `NettingSettler.sol` smart contract.