r402-hedera
Hedera chain support for the x402 payment protocol, part of the
r402 workspace.
Highlights
- Exact scheme — a payer-signed
TransferTransaction(HBAR or HTS FT) with the facilitator asfeePayer. The facilitator adds its signature and submits; success requires aSUCCESSreceipt. - CAIP-2 networks —
hedera:mainnetandhedera:testnet. extra.feePayeronly — copied ontoPriceTagfrom/supported.aliasPolicyis facilitator config (defaultreject), not wire extra.- In-process facilitator — Mirror Node REST preflight (balance and
token association) plus Hiero SDK execute. Duplicate settle is blocked
by
SettlementCachekeyed by the base64 transaction.
Host tools
client, facilitator, and full depend on the Hiero SDK (hedera 0.43),
which compiles hedera-proto with protoc and links OpenSSL. These are
required host tools, same class as a C compiler — hedera-proto 0.20 has
no vendored-protoc feature.
# macOS
# Debian / Ubuntu
protoc must be on PATH. Workspace --all-features builds (including
just test) need the same toolchain.
Cargo Features
| Feature | Surface |
|---|---|
client |
Buyer-side partially signed TransferTransaction. |
server |
Server-side PriceTag generation. |
facilitator |
On-chain verify and settle (Mirror REST + Hiero SDK). |
telemetry |
tracing instrumentation. |
full |
All of the above. |
Quick Start (server price tag)
use ;
let tag = price_tag;
Documentation
- Crate docs: https://docs.rs/r402-hedera
- Project README:
../../README.md
License
Dual-licensed under MIT and Apache-2.0.