open-standards/jcp/jcp-rs/crates/jcp-gateway/Cargo.toml
Transaction Science 950ac778ce
All checks were successful
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Successful in 11m58s
jcp-gateway --fleet: the binary as one node of a fleet, each record served by its owner and forwarded to it whole
A record is the receipts and the call record under one root grant a trusted
issuer signed; a request with no chain or rooted elsewhere moves no budget
and is served without one, so callers cannot make records. The first call
of a record this node does not hold takes it: restored from the store, its
gateway resumed from the receipts and its call record from the call lines,
both recording to it under the fence. A call for a record a live node owns
is forwarded to the address its lease advertises, method, target, fields and
body, since the caller's signature binds the endpoint and not a node; a
forwarded call reaching a non-owner gets 503 rather than a second hop. A node
that loses a record gives it up; one that cannot renew its lease writes
SELF-FENCE and exits 3.

Two binaries on one store: a call to either is charged against one budget,
a retry to either is answered from the owner's call record, a killed owner's
record is taken at epoch 2 with its spend and its answered calls, and a node
whose lease cannot be renewed fences itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 09:52:52 -05:00

44 lines
2.2 KiB
TOML

[package]
name = "jcp-gateway"
description = "The energy-native MCP gateway: a JCP enforcement point in front of an MCP server. Every tools/call is gated by a capability grant, the upstream call is metered (on the upstream server's own process tree where the host's kernel counts per-process CPU energy, and otherwise machine-wide: a hardware reading where the host exposes a live energy counter, an estimate where it does not, each sealed as what it is), the metered joules are debited from the grant's budget, and the decision seals into a hash-chained receipt log. The chokepoint position the AI-gateway field occupies — denominated in joules, with a tamper-evident audit, not dollars and a span."
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
[dependencies]
jcp-schema = { workspace = true }
jcp-grant = { workspace = true }
jcp-runtime = { workspace = true }
jcp-receipt = { path = "../jcp-receipt" }
jcp-bridge = { path = "../jcp-bridge" }
jcp-flow = { path = "../jcp-flow" }
# A priced tool paid by an x402 `upto` authorization: the v2 wire and the
# facilitator seam, network-free.
op-rails-x402 = { path = "../../../../openpay/crates/op-rails-x402" }
# The caller of a call over HTTP is the key that signed it (C35).
jcp-httpsig = { path = "../jcp-httpsig" }
# Serving as one node of a fleet (`--fleet`): records in a shared store, one
# owner each (extensions/fleet.md).
jcp-fleet = { path = "../jcp-fleet" }
sandbox-meter = { path = "../../../../sandbox/sandbox-rs/crates/sandbox-meter" }
# The meter's device classes: a hardware span with no CPU record is a reading
# of part of the call, and is sealed as one.
sandbox-schema = { path = "../../../../sandbox/sandbox-rs/crates/sandbox-schema" }
ed25519-dalek = { workspace = true }
serde_json = { workspace = true }
# A presented chain's grants are unpadded base64url; a mirrored MCP header
# value may be the Base64 sentinel form.
base64 = "0.23"
[dev-dependencies]
# tests/upstream_tree.rs's oracle reads the upstream server's energy count
# with proc_pid_rusage into a raw buffer, sharing no code with the meter.
libc = "0.2"
[[bin]]
name = "jcp-gateway"
path = "src/bin/jcp_gateway.rs"
[lints]
workspace = true