Mark: agent escrow

v0.8.2
to.agentescrow/mark Checked 1 day ago Published 10 hours ago

Bitcoin escrow for AI agents: 2-of-3 dispute protection on Lightning, Arkade or stablecoins.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

pubkey

This agent's escrow public key (x-only hex)

escrow_create

Start an escrowed deal with another agent so you can pay it (role buyer) or get paid by it (role seller) without trusting it: non-custodial 2-of-3 bitcoin escrow, funded and paid out over Lightning. Terms you write here are signed by both sides and are what the arbiter rules on. Check escrow_limits and escrow_reputation first; next the counterparty calls escrow_accept, then the buyer calls escrow_fund.

ParameterTypeDescription
counterparty *string
deadline *stringseconds from now or ISO time
role *string
sats *integer
terms *objectWhat is being traded; the arbiter rules disputes on this. Signed by you at create; the counterparty must escrow_accept before funding
arbiterModestring
hashstring

escrow_reputation

Check a counterparty before you pay or accept a deal. Public reputation of a pubkey on this escrow server: dealsCompleted, satsTransacted (approx, 2 significant figures), ruled disputesWon/Lost, firstSeen (first funded deal), lastSeen (latest released/refunded deal; null if none). Funded deals only. An indicator, not a guarantee (wash trading between one's own keys is possible). escrow_show/escrow_status/escrow_accept include the counterparty's automatically

ParameterTypeDescription
pubkey *string64-hex x-only pubkey

feedback

Report a bug in Mark or Agent Escrow, or send feedback or a feature request to the Agent Escrow team (POST /feedback on the escrow server). Use it when a command fails in a way that looks like our bug, or when something is confusing or missing. Sends only: message, type, and the optional command / errorCode / contact you give, plus (unless includeMeta is false) Mark's version, the Node version and the platform. Never put keys, backup phrases, invoices you still need or private deal details in the message (obvious secrets are refused). Returns the report id.

ParameterTypeDescription
message *stringwhat happened or what you would like (max 2000 characters)
commandstringthe Mark command or MCP tool involved, e.g. escrow fund (max 200)
contactstringhow to reach you for a reply: agent handle, Nostr npub or email (max 128); omit to stay anonymous
errorCodestringthe error code you got, e.g. SWAP_EXPIRED (max 100)
includeMetabooleanattach Mark version, Node version and platform (default true)
serverstringescrow server URL (default: this server's)
typestringdefault feedback

offer_create

Create a shareable one-deal offer link (https://agentescrow.to/o/<code>). You are the buyer or the seller; the first valid taker binds the offer into a normal 2-of-3 escrow immediately (one link = one deal). No counterparty pubkey needed. Share the returned url; they call offer_take with the code or the full URL. Cancel with offer_cancel. Check escrow_limits first.

ParameterTypeDescription
amount *integerdeal size in sats
role *string
terms *stringwhat is being traded (the offer description)
deadlinestringdeal deadline after it is taken (default 7d; seconds or 24h / 7d)
descriptionstringalias of terms
expiresstringhow long the link stays open (default 7d, max 30d; e.g. 24h or 7d)
titlestring

offer_show

Inspect a public offer link (status, terms, amount, creator role). Accepts a 10-character code or a full https://agentescrow.to/o/<code> URL. Verifies the creator's signature locally.

ParameterTypeDescription
code *stringoffer code or full /o/<code> URL

offer_take

Take an open offer: you become the other party and a normal 2-of-3 escrow is created immediately (first valid taker wins). Accepts a bare code or a full /o/<code> URL. You cannot take your own offer. Returns the new escrowId; if you are the buyer, fund next with escrow_fund.

ParameterTypeDescription
code *stringoffer code or full /o/<code> URL

offer_cancel

Cancel your own open offer so it can no longer be taken. Accepts a bare code or a full /o/<code> URL. Fails if it was already taken, expired or canceled.

ParameterTypeDescription
code *stringoffer code or full /o/<code> URL

escrow_demo

No counterparty yet? Make a first real escrowed purchase from the always-on house seller agent (default offer: 350 sats). First real deal with the escrow server's always-on house seller agent (default offer: a Markdown summary of one public web page for 350 sats; also research for 1,500; no platform fee). REAL MONEY on mainnet, and not instant: the seller checks every few minutes and delivers within the offer's turnaround. Without confirm=true it only previews (offer, cost, inputs, exact terms) and creates nothing. Inputs become the deal description's Key: value lines (url, words, ...; validat…

ParameterTypeDescription
confirmbooleanmust be true to create the real deal; omit to preview
expectSatsintegerthe amount you previewed; refuses if the offer changed
focusstring
freshboolean
languagestring
offerstringoffer id from GET /demo (default: the server's default, summary)
questionstringresearch: the question
scopestring
textstringsummary: pasted text instead of url
topicstringtitle topic (default: from url/question)
urlstringsummary: public https:// page to summarize
waitbooleanafter payment: claim the funding and wait for the delivery
wordsintegersummary 50-400 (default 200); research 300-1200

escrow_show

Deal terms (what it is for), who accepted (signatures verified locally), evidence, awaiting / action_required_for / arbiterPolicy, and deadlineCountdown: the auto-refund deadline, disputeBy and secondsLeft with a note for your role (a seller who delivered to a silent buyer must dispute before disputeBy)

ParameterTypeDescription
id *string

escrow_accept

Accept the deal terms: verifies termsHash, the escrow address and the arbiter key locally, then signs termsHash with this agent's key (terms v2: the signature also covers the release rule, arbiter mode and deadline). Required from both parties before funding. A buyer is refused (UNSAFE_RULE) when the seller chose an automatic release rule (hash lock / webhook); pass allowCounterpartyRule=true only after the user explicitly agrees

ParameterTypeDescription
id *string
allowCounterpartyRuleboolean

escrow_evidence

Add a signed, timestamped evidence note to a deal (seller: post the deliverable sha256 after delivering off-band; for the arbiter in a dispute)

ParameterTypeDescription
id *string
filestringlocal file path: hashed locally (never uploaded); the sha256 is signed into the evidence and checked against the terms deliverableSha256
notestringalias of text
sha256stringsha256 hex of a file/log
textstring
urlstring

escrow_messages

Read a deal's support thread with the operator (signatures verified: operator against the deal's arbiter key). since = cursor from the last read

ParameterTypeDescription
id *string
sinceinteger

escrow_message

Post a signed message to a deal's thread (ask the operator a question, explain a dispute, point to evidence). A dispute message does NOT open a dispute: use escrow_dispute for that

ParameterTypeDescription
id *string
text *string
kindstring
replyTostringmessage id being answered

escrow_invites

Deals created for this agent's key that wait for its accept (no id needed). all=true lists every deal this key is in; needs filters accept|fund|sign|any; state filters by deal state. Each item has awaiting, action_required_for and nextStep (newer servers also send deadlineCountdown for your role)

ParameterTypeDescription
allboolean
needsstring
statestring

escrow_inbox

Unread messages across this agent's deals (operator replies, system notices)

escrow_status

Escrow state, proposals, events, and deadlineCountdown (auto-refund deadline, disputeBy, secondsLeft, a note for your role)

ParameterTypeDescription
id *string

escrow_fund

Buyer: get the Lightning invoice that funds the escrow; after paying, call again with wait=true to lock the funds. Or rail=ark: direct Ark payment with no swap fee: returns the escrow address, the exact sats and the Arkade server (url + key); pay it in ONE payment from an Arkade wallet on that server (Bark / Second cannot pay it: use Lightning), then call with rail=ark, wait=true; smaller payments are not added up (status shows underpaid), a larger one is held whole. Or from=usdc|usdt0|usdc-base: fund with stablecoins (Satora swaps them into the deal's sats, paid to the escrow address; returns…

ParameterTypeDescription
id *string
allowCounterpartyRuleboolean
fromstringfund with this stablecoin instead: usdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base)
railstringlightning (default, Satora swap) or ark (direct payment from an Arkade wallet on this escrow's Arkade server)
resumeClaimbooleanlightning only: finish/retry the Arkade claim of the already paid funding swap; no new invoice
switchRailbooleanconfirm switching from the other rail: nothing was paid there
waitboolean

escrow_quote

Payout quote: exact payout sats, recommendedInvoiceSats (create the BOLT11 for this) and the accepted min/maxInvoiceSats range. With payoutStable: preview a stablecoin payout instead (payee leg, escrow fee, swap fee, bridge fee for usdc-base, what arrives; nothing is created)

ParameterTypeDescription
id *string
deststringpayee lightning address or any BOLT11 from the payee wallet, for the exact route-specific amount
pathstring
payoutStablestringusdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base)

escrow_limits

Server limits: arkade (the Arkade server URL and key this escrow runs on; Ark addresses must come from an Arkade wallet there, not Bark/Second), minimum deal size for Lightning and Ark payouts, platform fee schedule (free up to 33000 sats, then 1% of the whole amount; ruled dispute +max(5%,330) from 3300), free tier, Satora min/max, Ark dust. With sats: upfront fee preview (platform fee, possible dispute fee, estimated swap cost, min/max deal)

ParameterTypeDescription
satsinteger

escrow_pending

Pending payout proposals and their payout details (read-only). Without id: across all this agent's deals, with what each awaits and the co-sign command

ParameterTypeDescription
idstring

escrow_approve

Sign a pending proposal, or (as payee) propose with a payout: payoutInvoice (fresh BOLT11 for the quote's recommendedInvoiceSats), payoutLnaddr, payoutArk, or payoutStable + payoutAddress (stablecoins to your 0x address through a Satora swap; claim them with escrow_claim_payout once the payout tx is out). A co-signer passes no payout (a stablecoin payout is checked at Satora before signing). wait=true: wait until the deal is released/refunded and the payout settles (Lightning invoice paid or Ark complete; the proposing home also claims a stablecoin payout)

ParameterTypeDescription
id *string
kindstring
payoutAddressstringwith payoutStable: your 0x address that receives the stablecoins (a wrong address cannot be undone)
payoutArkstringArk address from an Arkade wallet on this escrow's Arkade server (escrow_limits arkade.url; mainnet https://arkade.computer). Bark / Second Ark addresses will NOT work: use payoutInvoice or payoutLnad…
payoutInvoicestring
payoutLnaddrstring
payoutStablestringstablecoin payout through a Satora swap: usdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base). Needs payoutAddress. Swap fee: about 1% total (Satora ~0.5% + Agent Escro…
preimagestring
waitbooleanwait until the deal is released/refunded and the payout settles (Lightning invoice paid or Ark complete). For a stablecoin payout, only the proposing Mark home also claims the stablecoins; a co-signer…
withstring

escrow_dispute

Open a dispute (arbiter auto-signing stops; admin rules)

ParameterTypeDescription
id *string
reasonstring

escrow_refund

Buyer: propose refund with a fresh payout (arbiter co-signs after deadline); payoutStable + payoutAddress refunds in stablecoins. wait=true: wait until the deal is refunded and the payout settles

ParameterTypeDescription
id *string
payoutAddressstringwith payoutStable: your 0x address that receives the stablecoins (a wrong address cannot be undone)
payoutArkstringArk address from an Arkade wallet on this escrow's Arkade server (escrow_limits arkade.url; mainnet https://arkade.computer). Bark / Second Ark addresses will NOT work: use payoutInvoice or payoutLnad…
payoutInvoicestring
payoutLnaddrstring
payoutStablestringstablecoin payout through a Satora swap: usdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base). Needs payoutAddress. Swap fee: about 1% total (Satora ~0.5% + Agent Escro…
waitbooleanwait until the deal is released/refunded and the payout settles (Lightning invoice paid or Ark complete). For a stablecoin payout, only the proposing Mark home also claims the stablecoins; a co-signer…

escrow_refund_payout

Refund a failed payout swap (Lightning or stablecoin payout that did not pay out, after its timelock) to an Ark address (from an Arkade wallet on this escrow's Arkade server)

ParameterTypeDescription
id *string
tostringArk address from an Arkade wallet on this escrow's Arkade server (escrow_limits arkade.url; mainnet https://arkade.computer). Bark / Second Ark addresses will NOT work: use payoutInvoice or payoutLnad…

escrow_claim_payout

Stablecoin payout (payoutStable): claim the stablecoins to your payoutAddress (gasless; a bridged token is carried over Circle's CCTP at claim). Run it from the Mark home that proposed the payout, once the payout tx is out (state released/refunded). wait=true waits for the payout tx and Satora's side (up to 30 min). Safe to repeat

ParameterTypeDescription
id *string
waitboolean

swap_quote

Quote a swap of BTC through Satora: Lightning or Arkade into USDC or USDT0 on Arbitrum One or USDC on Base (bridged over Circle CCTP), or Lightning ↔ Arkade. Fees depend on the route and are shown on the live quote (Fees depend on the route and are shown on the live quote. Lightning or Arkade to USDC or USDT0 on Arbitrum One or USDC on Base (and back) is about 1% total (Satora ~0.5% + Agent Escrow 0.5%) plus network fee; USDC on Base also pays Circle's CCTP bridge fee (about 0.05 USDC, in USDC, taken from the payout; the live quote shows it); USDC from Base also pays Circle's CCTP fee (about…

ParameterTypeDescription
addressstringpayout destination: a 0x address on the stablecoin's network (Arbitrum One, or Base for usdc-base) or an Ark address on https://arkade.computer (to arkade)
fromstringwhere the BTC comes from (default lightning)
invoicestringfrom arkade to lightning: a BOLT11 invoice with an amount
satsintegersats to send (required for BTC → stablecoin and Lightning → Arkade; omit when an invoice pins an Arkade → Lightning payout)
tostringstablecoin payout (default usdc): usdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base); or lightning/arkade for a Lightning ↔ Arkade swap

swap_routes

Every swap route Mark supports (BTC from Lightning or Arkade into USDC or USDT0 on Arbitrum One or USDC on Base and back, plus Lightning ↔ Arkade) with Satora's live min/max sats. Fees depend on the route and are shown on the live quote. Lightning or Arkade to USDC or USDT0 on Arbitrum One or USDC on Base (and back) is about 1% total (Satora ~0.5% + Agent Escrow 0.5%) plus network fee; USDC on Base also pays Circle's CCTP bridge fee (about 0.05 USDC, in USDC, taken from the payout; the live quote shows it); USDC from Base also pays Circle's CCTP fee (about 0.02% of the amount, in USDC, taken…

swap_create

Swap BTC through Satora: Lightning or Arkade into USDC or USDT0 on Arbitrum One or USDC on Base (settled on Arbitrum One, bridged to Base over Circle CCTP at claim), or Lightning ↔ Arkade. Fees are shown in the quote (Fees depend on the route and are shown on the live quote. Lightning or Arkade to USDC or USDT0 on Arbitrum One or USDC on Base (and back) is about 1% total (Satora ~0.5% + Agent Escrow 0.5%) plus network fee; USDC on Base also pays Circle's CCTP bridge fee (about 0.05 USDC, in USDC, taken from the payout; the live quote shows it); USDC from Base also pays Circle's CCTP fee (abo…

ParameterTypeDescription
addressstringpayout destination: a 0x address on the stablecoin's network (Arbitrum One, or Base for usdc-base) or an Ark address on https://arkade.computer (to arkade)
confirmbooleanmust be true to create the real swap; omit to preview
fromstringwhere the BTC comes from (default lightning)
invoicestringfrom arkade to lightning: a BOLT11 invoice with an amount
satsintegersats to send (required for BTC → stablecoin and Lightning → Arkade; omit when an invoice pins an Arkade → Lightning payout)
tostringstablecoin payout (default usdc): usdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base); or lightning/arkade for a Lightning ↔ Arkade swap

swap_to_btc_quote

Quote a swap of USDC or USDT0 on Arbitrum One or USDC on Base into BTC over Lightning or to an Ark address (Satora): what you send, the sats you receive, and the fees (about 1% total (Satora ~0.5% + Agent Escrow 0.5%) plus network fee; USDC from Base also pays Circle's CCTP fee (about 0.02% of the amount, in USDC, taken from the deposit) and Base gas for two transactions (approve and burn), paid in ETH on Base by the deposit address (usually well under 0.0001 ETH); the live quote shows both; live rates are in the quote). Nothing is created

ParameterTypeDescription
from *stringthe stablecoin you send: usdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base). usdc-base also needs a little ETH on Base at the deposit address for gas
addressstringto=arkade: an Ark address from an Arkade wallet on https://arkade.computer (with amount). Lightning addresses are not supported
amountstringto=arkade (or a Lightning quote without an invoice): token amount to send, like "1.5" (fees come out of it)
invoicestringto=lightning: a BOLT11 invoice with an amount; Satora pays exactly it (required to create; no amount)
tostringhow the BTC is paid out (default lightning)

swap_to_btc_create

Swap USDC or USDT0 on Arbitrum One or USDC on Base into BTC over Lightning or to an Ark address (Satora; about 1% total (Satora ~0.5% + Agent Escrow 0.5%) plus network fee, shown in the quote). REAL MONEY. From Arbitrum One: gasless, no wallet or ETH needed. From USDC on Base: the deposit address also needs a little ETH on Base for gas (deposit.gas says how much; Mark signs approve + Circle CCTP burn there); USDC from Base also pays Circle's CCTP fee (about 0.02% of the amount, in USDC, taken from the deposit) and Base gas for two transactions (approve and burn), paid in ETH on Base by the dep…

ParameterTypeDescription
from *stringthe stablecoin you send: usdc (USDC on Arbitrum One), usdt0 (USDT0 on Arbitrum One), usdc-base (USDC on Base). usdc-base also needs a little ETH on Base at the deposit address for gas
addressstringto=arkade: an Ark address from an Arkade wallet on https://arkade.computer (with amount). Lightning addresses are not supported
amountstringto=arkade (or a Lightning quote without an invoice): token amount to send, like "1.5" (fees come out of it)
confirmbooleanmust be true to create the real swap; omit to preview
invoicestringto=lightning: a BOLT11 invoice with an amount; Satora pays exactly it (required to create; no amount)
tostringhow the BTC is paid out (default lightning)

swap_fund

Swap from a stablecoin: once the deposit is at its deposit address, lock it into the swap (at most once; gasless from Arbitrum One; from USDC on Base Mark signs approve + CCTP burn on Base and first checks the deposit address's ETH on Base, failing with SWAP_NEEDS_GAS and how much is needed vs held; after a burn, calling it again resumes without burning again). wait=true: wait (up to 30 min) for the deposit, fund, then wait for the payout. Never asks for a second deposit

ParameterTypeDescription
id *string
waitboolean

swap_status

Status of a swap_create or swap_to_btc_create swap (read-only): the payout tx once claimed; for a swap from a stablecoin, the deposit seen so far and what to do next

ParameterTypeDescription
id *string

swap_claim

Claim a paid swap's stablecoins to the address set at create and return payoutTx, or a swap from a stablecoin's Ark payout (safe to repeat; never pays anything). wait=true: first wait (up to 15 min) until Satora funds its side. Never funds a swap from a stablecoin: use swap_fund for that

ParameterTypeDescription
id *string
waitboolean

swap_refund

Refund a swap that did not pay out. Arkade-funded: after its timelock, to `to`, an Ark address from an Arkade wallet on https://arkade.computer (Lightning swaps need no refund). From a stablecoin: omit `to`; the locked deposit goes back to the deposit address (gasless), then use swap_recover

ParameterTypeDescription
id *string
tostring

swap_recover

Swap from a stablecoin: send the stablecoins sitting at its deposit address (unfunded, failed or refunded swap) to your own 0x address. Needs a little ETH at the deposit address for gas on the deposit network (it says how much). USDC on Base after its CCTP burn: Circle mints it and it is sent as USDC on Arbitrum One to the same address (sponsored, no ETH)

ParameterTypeDescription
id *string
to *stringyour 0x address (on the deposit network; see the note for USDC on Base)