Docs / Protocol reference
Chain bindings
The portable core of LOPW is the warranty offer, the service receipt, the validator interface and the claim semantics. A chain binding supplies the parts that depend on a chain: the encoding, the signature scheme, the contract functions and the payment-rail binding.
| Binding | Contracts | Stake | Payments | Oracle (P6) | Encoding and signatures |
|---|---|---|---|---|---|
| Stellar (reference binding) | Soroban: Bond Registry, Claims, six validators | USDC Stellar Asset Contract, 7 decimals (one SEP-41 token per registry deployment) | x402 exact, SEP-41 transfer | SEP-40 (Reflector) | ScVal XDR; Ed25519 over a domain-separated SHA-256 |
| EVM (Base first, then Ethereum, Arbitrum, Optimism, Polygon, Avalanche) | Solidity: the same three kinds of contract | Native USDC, 6 decimals | x402 exact, EIP-3009 transferWithAuthorization | Chainlink getRoundData(roundId) | ABI encoding; secp256k1 over EIP-712 typed data (keccak-256) |
| Solana (planned) | Anchor programs | USDC SPL, 6 decimals | x402 exact, SPL transfer | Pyth price update verified in-program | Borsh; Ed25519 over a domain-separated SHA-256 |
One protocol, the same semantics on every chain. Each binding adds its own contracts and SDK adapter implementing the same ChainBinding shape without changing the offer, receipt, predicate or claim semantics. Per-network details (chain ids, CAIP-2 ids, token and oracle addresses, deployed contracts) are in the Networks section.
The Stellar binding
| Aspect | Stellar binding |
|---|---|
| Addresses | Strkeys: G... accounts, C... contracts |
| Network ID | SHA-256 of the network passphrase (Test SDF Network ; September 2015 on testnet; Public Global Stellar Network ; September 2015 on mainnet) |
| CAIP-2 id for x402 | stellar:testnet, stellar:pubnet |
| Read path | Read-only calls are simulated through Stellar RPC from a throwaway account that never signs |
| Write path | invoke: simulate, assemble, sign, send, poll; contract errors are decoded to names |
| Ledger time | Trails wall-clock time by up to one ledger; the SDK waits before submitting a claim so it never lands in a ledger closed before served_at |
| Storage | Persistent entries with TTL extended on access; instance storage for contract configuration |
TypeScript
import { StellarBinding, STELLAR_TESTNET, STELLAR_MAINNET, getNetwork, withContracts } from "@lopw/protocol";
const binding = new StellarBinding(STELLAR_TESTNET); // contract addresses included
const main = withContracts(STELLAR_MAINNET, { rpcUrl, registry, claims }); // supply your own for a mainnet deployment
const net = getNetwork(); // LOPW_NETWORK + env overridesStellarNetwork field | Meaning |
|---|---|
name | testnet or mainnet; used in API paths |
caip2 | CAIP-2 id used by x402 |
passphrase | Network passphrase hashed into every signature |
rpcUrl | Stellar RPC endpoint |
registry, claims | Contract addresses |
usdc | The USDC Stellar Asset Contract |
oracle | The SEP-40 fiat-rates oracle used by the reference services |
Contract addresses of the current deployment are listed on the proofs page and inside STELLAR_TESTNET.
What a new binding must provide
- A canonical, deterministic encoding of
Terms,Offer,Receiptand the oracle blocks that the contracts and SDKs produce byte for byte, plus a test-vector file in the style of v1.json. - A signature scheme over the domain-separated message (type tag, network identifier, registry identifier, encoded body).
- Contracts with the registry, claims and validator functions, the same states, checks, outcomes and error semantics.
- A payment-rail binding that yields a settlement reference and payer for the receipt, and carries the offer and receipt alongside the payment.
- An oracle interface for P6 that returns a past observation with its own timestamp.