Skip to content
vgonkivsPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Edicta

Edicta — the boundary between decision and execution.

Agents decide freely. They execute only what they committed to beforehand, within the policy their principal signed, and anyone can verify it.

Precisely: "execute only what they committed to" holds when the executor enforces the gate's Authorization (or, later, with an on-chain gate). Where the executor does not enforce it, an agent can still act outside its commitment, but it cannot do so undetected.

Why

When an automated actor acts with someone else's money, the only evidence of what it decided, and why, sits today with its operator. The operator can rewrite or hide that evidence after the fact. Edicta makes the decision public and committed before the action, so the record no longer depends on the party it is supposed to hold to account.

First use case: AI agents that spend other people's money

Example: a trading agent manages a client's brokerage account. Before each order it publishes its decision (the market data it saw, its model and policy, and the exact order bytes) and commits to it. The gate authorizes only that exact order, inside the limits the client signed, and the broker connector places it only with that Authorization. Afterwards the client, or an auditor, can check every order against what was decided and when.

The core makes no AI assumptions. A trading bot, a DeFi keeper or a cron script that moves funds uses Edicta in exactly the same way.

What it does

An agent's decision (its context, policy, model and the exact action bytes) is published to a data availability layer and committed to, with the agent's signature, before the action happens. A gate authorizes only valid commitments and returns a signed Authorization for exactly the committed action bytes. The integrator's executor checks that Authorization, runs exactly those bytes, and runs them once, keyed by commitment_hash. An optional receipt maps commitment_hash to the rail reference (an order id, a transaction hash); it is the gate's attestation of what the executor reported, not proof of execution.

Afterwards anyone can verify that the decision existed before the action, that exactly that action ran, and that the gate authorized it.

What it does not do

Edicta never evaluates the agent: not its logic, not the truth of its inputs (prices, for example), not the quality of the decision. Judging the agent is the operator's or auditor's job, using the published payload.

The core is platform-agnostic. An action is an opaque byte string; rails, brokers and chains live in profiles. The gate verifies and authorizes, it never executes and holds no rail credentials.

Try it

One command runs the whole flow on the Celestia Mocha testnet in 3 to 5 minutes. An agent decides on a TIA transfer, and the decision is published as a Celestia blob and anchored on chain. A gate, started in-process and reached over its real HTTP API, authorizes it. An executor sends exactly the committed transfer, and the decision, the Authorization and the payload go to the archive. An independent verifier then checks all of it from the archive and public RPCs, including proof of the executed transaction and the principal's mandate. Finally the demo tries to cheat five ways (a different amount, a reused decision, an amount above the mandate's limit, a tampered archive, a rogue executor) and shows each attempt refused or caught.

make demo                      # builds everything, then runs bin/edicta-demo
make demo ARGS="--json"        # pass demo flags through ARGS

The demo prints an address to fund with testnet TIA and starts only after you press Enter. Using your own funded key, the trust root, the verdicts and how to re-verify a run offline: examples/tia-transfer/demo/README.md.

Commands

  • edicta, the one binary: init, doctor, commit, agent serve, verify, replay, absence, gate serve (the gate daemon), signer serve, principal, and dev init in builds with the edictadev tag.
  • edicta-signer and edicta-principal: light standalones for the signer service and the principal's mandate tool. They link no Celestia node or chain code, so the processes that hold the payer key and the principal key stay small.
  • edicta-demo and edicta-live: the example binaries.

Build and test

make build builds all of these into bin/; make vet and make test run every Go module; make release-check builds, vets and checks every module, the guard tests, the command line pin, the vector manifest and the documentation links, without running the full test suite. To run the tests directly, from the repository root:

go test ./...
go -C plugins/celestia test ./...
go -C services/gate test ./...
go -C services/signer test ./...
go -C services/cli test ./...
go -C examples test ./...

The older manual runner (edicta-live, with your own gate started as edicta gate serve, and your endpoints), step by step: examples/tia-transfer/README.md. The gate daemon's configuration reference (the edictad package and configuration): services/gate/README.md. Coming from an older path or binary name: docs/code-locations.md.

User guides (quickstart, operator, principal, profiles, private mode, verifier): docs/. Architecture and design rationale: ARCHITECTURE.md.

Flow

agent --payload--> Recorder --> DA layer (Celestia blob or Fibre), anchored at height H
  |
  +- signs commitment (payload hash, locator, action {type, salted hash}, nonce, expiry[, mandate_ref])
       |
       v
  commitment + action bytes + salt --> gate: verify, check mandate, consume nonce --> signed Authorization (mode, [anchor_deadline])
                                                                     |
                                                                     v
                         executor: check Authorization, run the exact bytes once
                                                                     |
                                                                     v
                           optional receipt: commitment_hash -> rail reference

Gate invariants

  1. The agent's signature over commitment_hash is valid.
  2. The payload is available (DA layer or archive) and its hash matches.
  3. The action bytes presented to the gate, with the agent's 32-byte salt, hash to the committed action.hash, and the action type is one the gate is configured for. Exact match, no semantics.
  4. The commitment has not expired, its lifetime is well below DA retention, and the Authorization never outlives it.
  5. The nonce is unused and is marked used atomically with issuing the Authorization: at most one Authorization per (agent_pubkey, nonce).
  6. commitment_hash is computed over the canonical encoding and is not a field of what it hashes; no decision or Authorization carries a tx hash or rail reference.
  7. The gate signs only after 1 to 6, 8 and 9 hold, under its own domain tags; gate, agent, executor and principal keys never overlap.
  8. With a mandate, an Authorization is issued only if the principal-signed mandate allows exactly the committed action; the policy is deny-only and fail-closed, and its counters are updated in the same transaction as the nonce.
  9. The Authorization states its mode: strict when the payload is already anchored, fast when only the anchor intent was checked; fast mode needs the principal's consent in the mandate, and a missing anchor by anchor_deadline is provable afterwards.

The normative list is in spec/decision-commitment-v1.md, section 1.1.

Format

  • Deterministic CBOR (RFC 8949 core deterministic encoding, further restricted: integer map keys, no floats, no tags, optional fields absent rather than null).
  • SHA-256 for every hash, Ed25519 for every signature.
  • Every hash and signature is domain-separated by a length-prefixed tag (edicta/v1/...).
  • The action is opaque: {type, hash}, where type is a media type and hash is a tagged hash over the type, a fresh 32-byte salt and the exact action bytes; the salt travels with the bytes to the gate and the executor and inside the encrypted payload.

Specification: spec/decision-commitment-v1.md (core, revision v1.0, frozen) and spec/policy-v1.md (mandates); errata in spec/ERRATA.md. Release tags: v1.0.0 (the frozen v1 format) and v1.0.1 (erratum E1, which changed two expectations in a vector file and no wire bytes). Profiles: spec/profiles/. Cross-language test vectors (with an independent Python checker): spec/vectors/.

Data availability

  • celestia_blob (default): the payload is a share-version-1 blob on Celestia L1, paid by MsgPayForBlobs. Live on the Mocha testnet; this is what the demo uses.
  • Fibre: the payload is a Fibre blob, anchored on L1 by a MsgPayForFibre transaction. A first-class mode, implemented in the Recorder, the gate and the verifier; not part of the demo, and its first live run is still pending.
  • Archive: long-term copy of the payload for verification after DA retention ends. The hash proves integrity, so the archive is trusted only for availability.

Status

Wire version 1 (the earlier v0 drafts are superseded and unsupported). The gate (edicta gate serve), the Go SDK, the Recorder, the archive and the verifier (edicta verify, edicta replay, edicta absence) work end to end; the demo above, with the celestia_blob mode and a mandate, ran live on Celestia Mocha. The HTTP API speaks CBOR and, alongside it, JSON.

  • Mandates (spending limits, recipients, private mode with auditors) are implemented. Principals sign with Ed25519, Keplr (ADR-036) or MetaMask (EIP-712); the wallet flows are vector-tested but not yet tested live with real wallets.
  • Fast mode is implemented in the gate, the Recorder ([recorder] fast, both DA modes) and the verifier (absence proofs); it has not run live, and its Mocha checklist (docs/mocha-checklist.md) has not been run.
  • Fibre support is implemented but has not run live yet.
  • Eden escrow payment profile (x402 escrow-upto on Eden, chain 714): a draft profile, spec/profiles/eden-escrow-v1.md, not frozen. Its signer service holds the dedicated payer key behind the gate, so the gate stays keyless. A deployment with a real payer key should run the light standalone edicta-signer, which does not link the Celestia stack; edicta signer serve is a convenience for development and demos. The TypeScript wrapper @edicta/houston (sdk/ts/edicta-houston) puts it into the payment flow. The Eden flow has not yet run live end to end through Edicta.

Not production-ready.

Repository layout

Path Contents
/ (module github.com/vgonkivs/edicta) Core: engine/commitment (encoding, hashing, checks), engine/gate, engine/dasource (DA read and recompute interfaces), engine/recorder (the Recorder interface and its refusal reasons), engine/policy (mandates), engine/principalsig, engine/archive, engine/verifier, sdk, api/edictaapi (HTTP API), api/signerapi (the signer's HTTP wire format), engine/dacommit, engine/retention, config, internal, test; cmd/edicta-principal (the principal's mandate tool, also edicta principal)
plugins/celestia/ (own module) The Celestia plugin: node client (node), chain readers (chain), proof checks (proof), the Recorder (recorder), Fibre blob commitment (fibrecommit), the bank-send transaction signer and checker (banksend), and test fakes (celestiatest)
services/gate/ (own module) The gate daemon (package edictad), its wiring (edictad/wire) and its command line (gatecmd, run as edicta gate serve)
services/signer/ (own module, links no Celestia node or chain code) The payer key's service edicta-signer (also edicta signer serve): rail-agnostic signing core, Eden escrow handler (eden), daemon (signerd), command line (signercmd)
services/cli/ (own module) The edicta binary: init, doctor, commit, agent serve, verify, replay, absence, gate serve, signer serve, principal, and dev init in edictadev builds
config/ (root module) The edicta.toml schema, defaults and presets
internal/ (root module) Shared helpers: CBOR modes, EVM hashing, signing and RLP, key files, file locks, the principal tool's command line
plugins/banksend (root module) The bank-send rail: action format, message encoding, executor, policy extension
plugins/edenescrow (root module) The Eden escrow rail: action format, escrow table, executor-side checks (edenexec), the JSON-RPC reader (edenrpc) and the payment server's relay client (edenrelay)
plugins/ibkr (root module) The IBKR rail: order format (ibkrorder), executor, and a fake broker (brokerfake)
examples/ (own module) Profiles in use: tia-transfer (Cosmos MsgSend on a price trigger, with the edicta-demo demo and the edicta-live runner) and dca-agent (IBKR order, offline with a fake broker)
sdk/ts/edicta-houston/ @edicta/houston, the TypeScript wrapper for the escrow-upto payment flow (npm package, not a Go module)
contracts/ The EdictaPublish contract and its deploy tool
deploy/dev/ The local docker compose stack (DEV ONLY keys)
test/ Cross-package tests: attacks, fixtures, the command line pin and the layering, import and doc guards
make/ Makefile includes and the release check script
spec/ Specification, profiles, test vectors and their generators
docs/ User guides

Own Go modules: the root, plugins/celestia, services/gate, services/signer, services/cli and examples; the vector generators under spec/vectors/tools/ are separate small modules. Where older text, including the frozen specification, names a package path or a binary from before this layout, docs/code-locations.md gives the current one.

License

Edicta is licensed under the Apache License, Version 2.0: the code, the specification, the test vectors and the contracts. Copyright 2026 vgonkivs.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages