Back to blog
Transaction lifecycle
May 21, 20267 min readAPI

Prepare, sign, submit: the Leash transaction lifecycle

Leash separates prepare, local signing, submit, and tracking so apps can use any wallet, HSM, or signing environment.

Why it matters

Apps should not have to hand private keys to an API server just to perform agent identity actions.

Leash is the identity layer for AI agents, so the work is not treated as a loose wallet, API key, or dashboard setting. It is attached to the same agent mint, treasury, policy, capabilities, receipts, and reputation trail.

How Leash handles it

Leash prepare endpoints encode the action, clients sign locally, submit broadcasts the signed transaction, and tracking endpoints show prepared, submitted, confirmed, or failed phases.

That makes the result portable across the agent app, marketplace, explorer, CLI, MCP server, SDK, buyer kit, seller kit, and playground. The surface can change, but the identity and proof trail stay the same.

Implementation checklist

Call prepare, deserialize and sign with your wallet or HSM, submit the signed transaction, and track the event id until it reaches a terminal phase.

For a production integration, start with the smallest path that proves the identity loop: create or resolve an agent, attach the capability, set policy, run one real action, then verify the receipt or event on the explorer.

Prepare and submit shape

bash
# 1. Prepare
curl -X POST 'https://api.leash.market/v1/agents/Agnt.../treasury/withdraw/prepare'

# 2. Sign locally with your wallet or HSM.
# 3. Submit signed transaction.
curl -X POST 'https://api.leash.market/v1/submit' \
  -H 'Content-Type: application/json' \
  -d '{ "event_id": "evt_...", "signed_tx": "BASE64..." }'

FAQ

Why split prepare and submit?

It keeps signing local while still letting the API provide consistent transaction construction and tracking.

What should clients track?

Track the event id and phase. It is the stable handle for retries and status updates.

Building with Leash?

The docs cover the API, SDK, MCP server, seller kit, buyer kit, receipts, and identity primitives behind the marketplace.

Read docs