LOPWDocumentation

Docs / Networks

Stellar

Stellar is the reference binding: the first chain LOPW runs on and the one the other bindings are defined against. The contracts are Soroban, signatures are Ed25519, and the shared test vectors pin every byte. The protocol semantics on this page are the same on every other chain; what is specific to Stellar is listed here.

Reference binding Live on Stellar testnet

At a glance

AspectStellar binding
ContractsSoroban (Rust): Bond Registry, Claims, six validators
SignaturesEd25519 by a dedicated service signing key registered on-chain (key_version); it cannot move stake
Hashingmessage = SHA-256(tag ‖ network_id ‖ XDR(registry) ‖ XDR(body)) with tags LOPW/OFFER/v1 and LOPW/RECEIPT/v1; network_id = SHA-256(network passphrase)
EncodingScVal XDR of the contract types (maps with keys in sorted order), so the contracts and the SDKs hash identical bytes
Stake tokenUSDC Stellar Asset Contract (SEP-41), 7 decimals; one token per registry deployment
P6 oracleReflector, SEP-40 price(asset, timestamp); the validator reads the tick the oracle returns for the cited timestamp
x402 schemeexact on stellar:testnet / stellar:pubnet, a SEP-41 transfer with sponsored fees; payment_reference is the settlement transaction hash, buyer the payer
AddressesStrkeys: G... accounts, C... contracts
Network namestestnet and mainnet

Networks

NetworkNameCAIP-2PassphraseUSDCReflector oracleExplorer
Stellar testnettestnetstellar:testnetTest SDF Network ; September 2015CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMACCSSOHTBL3LEWUCBBEB5NJFC2OKFRC74OWEIJIZLRJBGAAU4VMU5NV4Wstellar.expert (testnet)
Stellar mainnetmainnetstellar:pubnetPublic Global Stellar Network ; September 2015CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75CBKGPWGKSKZF52CFHMTRR23TBWTPMRDIYZ4O2P5VS65BMHYH4DXMCJZCstellar.expert (public)

USDC on Stellar testnet is issued by GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5; the Stellar Asset Contract above is its Soroban interface. Stellar RPC for testnet: https://soroban-testnet.stellar.org.

LOPW contracts

Stellar testnet

Deployed Current LOPW contracts on Stellar testnet, each linked to the public explorer.

Treasury account GBNQ7FKN25IGBY7V7XJUVMMACLDIACYDLUNYZA56RR2RQMHW3UV2CCQ5. Registration fee 1 USDC; stake fee 100 basis points a year; admin change delay 93600 seconds (26 hours).

Stellar mainnet

Not deployed No LOPW deployment is published on this network yet.

Hashing and signing, exactly

The Hashing and signing page shows every byte with an interactive layout taken from the test vectors. In short:

Text
message      = SHA-256( tag || network_id || ScVal-XDR(registry) || ScVal-XDR(body) )
tag          = "LOPW/OFFER/v1" or "LOPW/RECEIPT/v1" (ASCII)
network_id   = SHA-256(network passphrase)           // testnet signatures are invalid on mainnet
registry     = ScvAddress XDR of the Bond Registry   // signatures cannot be replayed against another deployment
signature    = Ed25519.sign(service signing key, message)   // 64 bytes
terms_hash   = SHA-256(ScVal-XDR(terms))             // no domain separation
service_id   = SHA-256(XDR(registry address) || XDR(counter))

Soroban’s signature check traps on an invalid signature, so a bad signature fails the claim transaction with the same outcome as a rejection: nothing recorded, nothing paid.

P6 on Stellar

Terms name a SEP-40 oracle contract and an asset (Stellar(address) or Other(symbol)). The validator calls price(asset, oracle_timestamp); the oracle rounds the timestamp down to its previous tick and returns that tick’s price and timestamp. The validator applies max_oracle_age to the returned timestamp, rejects a tick after served_at, and proves a breach with the exact integer test |reported_value − oracle_price| × 10000 > max_deviation_bps × oracle_price. The Reflector fiat-rates oracle quotes USD per unit with 14 decimals, ticks every 5 minutes and keeps 24 hours of history, which is why a P6 claim window is at most 1 hour.

x402 on Stellar

402 PaymentRequired, Stellar
"extensions": {
  "lopw": {
    "info": {
      "version": 1,
      "network": "testnet",
      "registry": "CBNGZB5GL3FEZKIQK73BTJYCQAC76N7SZCLN34JRMTQCUWER4GB3WHPL",
      "service_id": "…64 hex…",
      "offer": "AAAAEQAAAAEAAAAK…"          // base64 ScVal XDR of SignedOffer { offer, signature }
    },
    "schema": { "type": "object" }
  }
}

The receipt returns in PAYMENT-RESPONSE.extensions.lopw.receipt as base64 ScVal XDR of SignedReceipt. The full envelope is on the x402 extension page.

SDK

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 addresses for a mainnet deployment
const net = getNetwork();                                                       // LOPW_NETWORK + env overrides

Read-only calls are simulated through Stellar RPC from a throwaway account that never signs; writes are simulate, assemble, sign, send, poll, with contract errors decoded to names. Ledger time trails wall-clock time by up to one ledger, so the SDK waits before submitting a claim.

For agents

For agents

ItemValue
Network name in API pathstestnet (/v1/testnet/..., served) and mainnet (no deployment published, not served)
CAIP-2 idstellar:testnet, stellar:pubnet
Wire encoding of extensions.lopwinfo.offer and receipt are base64 ScVal XDR of SignedOffer / SignedReceipt; JSON Schemas offer.json, receipt.json, terms.json
Explorerhttps://stellar.expert/explorer/testnet/tx/{hash} and .../contract/{address}; public for mainnet
Test vectors/docs/vectors/v1.json