CHAT_TURN, AGENT_REQUEST/CLAIM/STEP/FINISH
Fork V6 transactions for public chat memory and distributed agentic AI. See Quickstart › Agent Run for full lifecycle.
CHAT_TURN
A public signed message. Used standalone (regular chat) or as part of an agent run (agentRunId field).
| Field | Type | Notes |
|---|---|---|
type | "CHAT_TURN" | — |
from | string | Sender |
conversationId | string | sha256-derived conversation ID (see helpers) |
role | string | "user", "assistant", "system", "tool" |
content | string | Inline text, ≤ 16384 bytes (else use contentBlobId) |
contentBlobId? | string | For large content via SOCIAL_BLOB |
parentTurnHash? | string | For threading replies |
agentRunId? | string | Link to AGENT_REQUEST if part of agent execution |
attachments? | array | [{ type: "image"|"audio"|"file", blobId }] |
Fee: implicit CHAT_TURN_FEE = 100 micro deducted from from balance.
Helpers:
computeConversationId(creator: address, seed?: string)—sha256(creator + "|" + now + "|" + seed)computeContentHash(content: string)—sha256(utf8(content))
AGENT_REQUEST
Initiates an agent run. Escrows maxFee from submitter.
| Field | Type | Notes |
|---|---|---|
type | "AGENT_REQUEST" | — |
from | string | Submitter |
agentRunId | string | sha256(from + nonce + prompt[:256]) — helper: computeAgentRunId |
conversationId | string | Thread this run belongs to |
prompt | string | Initial user prompt |
toolsWhitelist | array<string> | Tool names miner may use |
maxFee | string (bigint) | Escrow in micro-OMBRA, typically MICRO_OMBRA = 1_000_000 (1 OMBRA) |
maxSteps | number | Safety cap, typically 100 |
promptBlobId? | string | For large prompts |
modelHint? | string | Optional preferred model |
Validation:
agentRunId == sha256(from + nonce + prompt[:256])state.balance(from) >= maxFeemaxSteps in [1, 200]
Effect:
state.balance(from) -= maxFee(escrow)state.agentRuns[agentRunId] = { status: "pending", submitter: from, ... }
AGENT_CLAIM
A miner claims the right to execute the run. First valid claim per agentRunId wins; rest are rejected.
| Field | Type | Notes |
|---|---|---|
type | "AGENT_CLAIM" | — |
from | string | Miner wallet |
agentRunId | string | — |
minerAddress | string | Same as from |
modelInfo | string | E.g., "llama-server:Qwen2.5-7B-Q4_K_M" |
hardwareTier | string | "laptop", "desktop", "workstation", "server", "cluster" |
Validation:
state.agentRuns[agentRunId].status == "pending"- Miner advertises all
toolsWhitelisttools (off-chain check, advisory)
Effect:
state.agentRuns[agentRunId].status = "claimed"state.agentRuns[agentRunId].minerAddress = from
AGENT_STEP
Per LLM iteration. Only the claimed miner can submit.
| Field | Type | Notes |
|---|---|---|
type | "AGENT_STEP" | — |
from | string | Must equal state.agentRuns[agentRunId].minerAddress |
agentRunId | string | — |
stepIndex | number | 0-based |
outputTokens | number | Tokens generated in this step (for billing) |
outputHash | string | sha256 of step output |
thoughtBlobId? | string | Optional chain-of-thought blob |
toolCalls? | array | [{ name, argsHash, resultHash, durationMs, ok }] |
outputBlobId? | string | If output > 16K |
Validation:
from == state.agentRuns[agentRunId].minerAddressstepIndex < state.agentRuns[agentRunId].maxStepsstepIndexmonotonically increasing
Effect:
- Append to
state.agentSteps[agentRunId] state.agentRuns[agentRunId].status = "running"
AGENT_FINISH
Final settlement. Only claimed miner.
| Field | Type | Notes |
|---|---|---|
type | "AGENT_FINISH" | — |
from | string | Claimed miner |
agentRunId | string | — |
totalTokensOut | number | Sum across all steps |
status | string | "completed", "failed", "timeout", "insufficient_funds", "cancelled" |
minerReward | string (bigint) | totalTokensOut × AGENT_REWARD_PER_TOKEN |
userRefund | string (bigint) | maxFee − minerReward − networkFee |
networkFee | string (bigint) | ≈ steps × AGENT_NETWORK_FEE_PER_STEP |
finalAnswerInline? | string | Final answer ≤ 16K |
finalAnswerBlobId? | string | For larger answers |
Validation:
from == state.agentRuns[agentRunId].minerAddressminerReward + userRefund + networkFee == state.agentRuns[agentRunId].maxFee
Effect:
state.balance(from) += minerRewardstate.balance(submitter) += userRefundstate.totalBurned += networkFeestate.agentRuns[agentRunId].status = status
Billing summary
totalTokensOut × AGENT_REWARD_PER_TOKEN (1) → miner
steps × AGENT_NETWORK_FEE_PER_STEP (100) → burn
maxFee - minerReward - networkFee → refund to submitter
Example: 1 OMBRA escrow, 5_000 output tokens across 8 steps:
minerReward = 5_000 × 1 = 5_000micronetworkFee = 8 × 100 = 800microuserRefund = 1_000_000 − 5_000 − 800 = 994_200micro
Builders
buildChatTurnTx(from, { conversationId, role, content, ... }, nonce, privKey)
buildAgentRequestTx(from, { agentRunId, conversationId, prompt, toolsWhitelist, maxFee, maxSteps, ... }, nonce, privKey)
buildAgentClaimTx(from, { agentRunId, minerAddress, modelInfo, hardwareTier }, nonce, privKey)
buildAgentStepTx(from, { agentRunId, stepIndex, outputTokens, outputHash, ... }, nonce, privKey)
buildAgentFinishTx(from, { agentRunId, totalTokensOut, status, minerReward, userRefund, networkFee, ... }, nonce, privKey)
computeConversationId(creator, seed?)
computeAgentRunId(from, nonce, prompt)
computeContentHash(content)