Skip to main content

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).

FieldTypeNotes
type"CHAT_TURN"
fromstringSender
conversationIdstringsha256-derived conversation ID (see helpers)
rolestring"user", "assistant", "system", "tool"
contentstringInline text, ≤ 16384 bytes (else use contentBlobId)
contentBlobId?stringFor large content via SOCIAL_BLOB
parentTurnHash?stringFor threading replies
agentRunId?stringLink 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.

FieldTypeNotes
type"AGENT_REQUEST"
fromstringSubmitter
agentRunIdstringsha256(from + nonce + prompt[:256]) — helper: computeAgentRunId
conversationIdstringThread this run belongs to
promptstringInitial user prompt
toolsWhitelistarray<string>Tool names miner may use
maxFeestring (bigint)Escrow in micro-OMBRA, typically MICRO_OMBRA = 1_000_000 (1 OMBRA)
maxStepsnumberSafety cap, typically 100
promptBlobId?stringFor large prompts
modelHint?stringOptional preferred model

Validation:

  • agentRunId == sha256(from + nonce + prompt[:256])
  • state.balance(from) >= maxFee
  • maxSteps 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.

FieldTypeNotes
type"AGENT_CLAIM"
fromstringMiner wallet
agentRunIdstring
minerAddressstringSame as from
modelInfostringE.g., "llama-server:Qwen2.5-7B-Q4_K_M"
hardwareTierstring"laptop", "desktop", "workstation", "server", "cluster"

Validation:

  • state.agentRuns[agentRunId].status == "pending"
  • Miner advertises all toolsWhitelist tools (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.

FieldTypeNotes
type"AGENT_STEP"
fromstringMust equal state.agentRuns[agentRunId].minerAddress
agentRunIdstring
stepIndexnumber0-based
outputTokensnumberTokens generated in this step (for billing)
outputHashstringsha256 of step output
thoughtBlobId?stringOptional chain-of-thought blob
toolCalls?array[{ name, argsHash, resultHash, durationMs, ok }]
outputBlobId?stringIf output > 16K

Validation:

  • from == state.agentRuns[agentRunId].minerAddress
  • stepIndex < state.agentRuns[agentRunId].maxSteps
  • stepIndex monotonically increasing

Effect:

  • Append to state.agentSteps[agentRunId]
  • state.agentRuns[agentRunId].status = "running"

AGENT_FINISH

Final settlement. Only claimed miner.

FieldTypeNotes
type"AGENT_FINISH"
fromstringClaimed miner
agentRunIdstring
totalTokensOutnumberSum across all steps
statusstring"completed", "failed", "timeout", "insufficient_funds", "cancelled"
minerRewardstring (bigint)totalTokensOut × AGENT_REWARD_PER_TOKEN
userRefundstring (bigint)maxFee − minerReward − networkFee
networkFeestring (bigint)≈ steps × AGENT_NETWORK_FEE_PER_STEP
finalAnswerInline?stringFinal answer ≤ 16K
finalAnswerBlobId?stringFor larger answers

Validation:

  • from == state.agentRuns[agentRunId].minerAddress
  • minerReward + userRefund + networkFee == state.agentRuns[agentRunId].maxFee

Effect:

  • state.balance(from) += minerReward
  • state.balance(submitter) += userRefund
  • state.totalBurned += networkFee
  • state.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_000 micro
  • networkFee = 8 × 100 = 800 micro
  • userRefund = 1_000_000 − 5_000 − 800 = 994_200 micro

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)