Matrix logo

tachyon-tools Developer Docs

Agent-native Solidity/EVM toolbox: compile, test, simulate, deploy, and call verbs over HTTP API, JSON-RPC 2.0, and MCP stdio with structured I/O, simulation-first safety, idempotent deploys, and policy-gated signing.

Source: github.com/paxlabs-inc/matrix-core/tachyon Language: Go 1.22+ (daemon), Solidity (contracts corpus), JavaScript (test suite) One-sentence contract: An agent-native Solidity / EVM toolbox that exposes compile, test, simulate, deploy, and call verbs over HTTP API, JSON-RPC, and MCP stdio, with structured I/O, simulation-first safety, idempotent deploys, and policy-gated signing.


Contents

DocSubsystemSource files
overview.mdxThis file-
engine.mdxCore engine, verb dispatch, envelope types, error taxonomyinternal/engine/engine.go, internal/engine/workdir.go
compiler.mdxSolidity compiler, forge build, artifact normalization, ephemeral source workdirsinternal/compiler/compiler.go, internal/forgeutil/run.go
deployer.mdxIntent-based deployment, idempotency, CREATE2, on-chain confirmation, registry write-backinternal/deployer/deployer.go
wallet.mdxSigning backends, self-hosted (raw/keystore/env) and embedded (Paxeer DID lane) with policy gateinternal/wallet/wallet.go, internal/wallet/embedded.go
evm-client.mdxgo-ethereum RPC wrapper, tx building, gas estimation, EIP-1559, raw broadcast, receipt pollinginternal/evm/client.go, internal/evm/evm.go
simulate.mdxDry-run simulation, eth_call + optional debug trace, revert captureinternal/simulate/simulate.go
tester.mdxForge test runner, JSON parsing, suite aggregation, partial failure handlinginternal/tester/tester.go
abi-encoder.mdxABI encoding bridge, JSON-to-Go type coercion for method calls and constructorsinternal/abienc/abienc.go
registry.mdxArtifact + deployment index, JSON-file backed, mutex-protected, atomic savesinternal/registry/registry.go
chains.mdxChain profile manager, presets, custom registration, numeric chain-id fallback, inline RPCinternal/chains/chains.go
config.mdxRuntime configuration, .kvx format, env precedence, wallet mode selection, policy profilesinternal/config/config.go, internal/config/kvx.go
api-server.mdxHTTP API, REST routes, JSON-RPC passthrough, Bearer auth middleware, structured loggingpkg/api/server.go
mcp-server.mdxMCP stdio server, NDJSON-RPC, tool registry, selftest, error formattingpkg/mcp/server.go, pkg/mcp/tools.go
rpc-server.mdxJSON-RPC dispatcher, tachyon_* method routing, envelope wrappingpkg/rpc/server.go
types.mdxShared request/response types, envelopes, errors, chain profiles, artifactspkg/types/*.go
daemon.mdxEntry point, flag parsing, engine wiring, signal handling, MCP vs HTTP modecmd/tachyond/main.go

Repo layout

tachyon/
├── cmd/
│   ├── tachyon/          # thin CLI client (main.go)
│   └── tachyond/         # daemon entry point (main.go)
├── pkg/
│   ├── api/              # HTTP REST server
│   ├── mcp/              # MCP stdio server + tool registry
│   ├── rpc/              # JSON-RPC dispatcher
│   └── types/            # shared request/response types
├── internal/
│   ├── abienc/           # ABI encoding bridge
│   ├── chains/           # chain profile manager
│   ├── compiler/         # forge build + artifact normalization
│   ├── config/           # .kvx config parser + loader
│   ├── deployer/         # intent-based deployment
│   ├── engine/           # core verb dispatch + workdir helpers
│   ├── evm/              # go-ethereum RPC wrapper
│   ├── forgeutil/        # forge subprocess runner
│   ├── registry/         # artifact + deployment index
│   ├── simulate/         # eth_call dry-run
│   ├── tester/           # forge test runner
│   └── wallet/           # signing backends + policy gate
├── contracts/            # OpenZeppelin contracts corpus (baked dependency)
├── chains/               # chain presets (presets.json)
├── test/                 # Hardhat/Foundry test suite
└── docs/                 # API docs, architecture docs

Key locked decisions

  1. Agent-native, not human-native. The CLI (cmd/tachyon/) is a thin HTTP client that pipes JSON stdin to the daemon's REST endpoints; the product is the API/MCP/JSON-RPC surfaces. Every response is machine-parseable JSON with stable error codes.
  2. Simulation-first. simulate is a first-class verb. Agents dry-run before they broadcast. Revert data is captured and returned structurally. call supports simulate_only: true for the same effect.
  3. Idempotent by key. Deploys carry an idempotency_key (+ optional CREATE2 salt) so retries do not double-deploy. The registry tracks confirmed deployments and verifies on-chain bytecode before returning cached results.
  4. Keys behind policy. Agents hold scoped capability tokens, never raw keys. Every signature passes a policy gate (Gate.Authorize) that enforces spend caps, contract allow-lists, and chain allow-lists.
  5. Self-contained source uploads. A non-empty sources map on compile/test makes the request self-contained: the engine materializes an ephemeral Foundry project with the baked dependency tree (forge-std, OpenZeppelin, erc4626-tests, halmos-cheatcodes) linked in via symlinks.
  6. Conservative EVM version. Uploaded-source compiles default to shanghai (not cancun) so artifacts do not emit MCOPY, which pre-Cancun chains reject. Callers can override per-chain via CompileRequest.EVMVersion.
  7. Structured errors everywhere. Every failure carries a machine-stable code, human message, and boolean retry flag. Partial results (e.g., test failures with pass counts) are returned in the envelope data field even when ok: false.
  8. Dual wallet modes. self_hosted signs locally with an operator-held key (raw hex, env var, or geth v3 keystore). embedded delegates signing and broadcasting to the Paxeer embedded wallet over the agent-native DID lane, supporting both single-tenant (seed on disk) and multi-tenant (forwarded token, zero seeds) deployments.