# Stellar

> The reference LOPW binding: Soroban contracts, Ed25519 signatures, SHA-256 over domain-separated ScVal XDR, the USDC Stellar Asset Contract with 7 decimals, Reflector SEP-40 oracles, x402 exact with SEP-41, network names testnet and mainnet, and the live contract addresses on Stellar testnet.

*LOPW documentation · Networks.* Canonical page: https://lopw.com/docs/networks/stellar.html · This Markdown twin: https://lopw.com/docs/networks/stellar.md · Index of all pages: https://lopw.com/llms.txt · Everything in one file: https://lopw.com/llms-full.txt

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](https://lopw.com/docs/vectors/v1.json) 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

| Aspect | Stellar binding |
| --- | --- |
| Contracts | Soroban (Rust): Bond Registry, Claims, six validators |
| Signatures | Ed25519 by a dedicated service signing key registered on-chain (`key_version`); it cannot move stake |
| Hashing | `message = SHA-256(tag ‖ network_id ‖ XDR(registry) ‖ XDR(body))` with tags `LOPW/OFFER/v1` and `LOPW/RECEIPT/v1`; `network_id = SHA-256(network passphrase)` |
| Encoding | ScVal XDR of the contract types (maps with keys in sorted order), so the contracts and the SDKs hash identical bytes |
| Stake token | USDC Stellar Asset Contract (SEP-41), 7 decimals; one token per registry deployment |
| P6 oracle | Reflector, SEP-40 `price(asset, timestamp)`; the validator reads the tick the oracle returns for the cited timestamp |
| x402 scheme | `exact` on `stellar:testnet` / `stellar:pubnet`, a SEP-41 transfer with sponsored fees; `payment_reference` is the settlement transaction hash, `buyer` the payer |
| Addresses | Strkeys: `G...` accounts, `C...` contracts |
| Network names | `testnet` and `mainnet` |

## Networks

| Network | Name | CAIP-2 | Passphrase | USDC | Reflector oracle | Explorer |
| --- | --- | --- | --- | --- | --- | --- |
| Stellar testnet | `testnet` | `stellar:testnet` | `Test SDF Network ; September 2015` | [CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA](https://stellar.expert/explorer/testnet/contract/CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA) | [CCSSOHTBL3LEWUCBBEB5NJFC2OKFRC74OWEIJIZLRJBGAAU4VMU5NV4W](https://stellar.expert/explorer/testnet/contract/CCSSOHTBL3LEWUCBBEB5NJFC2OKFRC74OWEIJIZLRJBGAAU4VMU5NV4W) | [stellar.expert (testnet)](https://stellar.expert/explorer/testnet) |
| Stellar mainnet | `mainnet` | `stellar:pubnet` | `Public Global Stellar Network ; September 2015` | [CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75](https://stellar.expert/explorer/public/contract/CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75) | [CBKGPWGKSKZF52CFHMTRR23TBWTPMRDIYZ4O2P5VS65BMHYH4DXMCJZC](https://stellar.expert/explorer/public/contract/CBKGPWGKSKZF52CFHMTRR23TBWTPMRDIYZ4O2P5VS65BMHYH4DXMCJZC) | [stellar.expert (public)](https://stellar.expert/explorer/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.

| Contract | Address |
| --- | --- |
| Bond Registry | [CBNGZB5GL3FEZKIQK73BTJYCQAC76N7SZCLN34JRMTQCUWER4GB3WHPL](https://stellar.expert/explorer/testnet/contract/CBNGZB5GL3FEZKIQK73BTJYCQAC76N7SZCLN34JRMTQCUWER4GB3WHPL) |
| Claims | [CBUBZC2AHVKFKYTAO3DIF6CZFQVM4UYCNABYVTPQNUUJGLOIBSIWONSC](https://stellar.expert/explorer/testnet/contract/CBUBZC2AHVKFKYTAO3DIF6CZFQVM4UYCNABYVTPQNUUJGLOIBSIWONSC) |
| Validator P1 Equivocation | [CBEBETGU7AFDBYSP5VGUIKJ7FHLLDOG5LM56MHYWYWT4M4S7FZEZ7TU3](https://stellar.expert/explorer/testnet/contract/CBEBETGU7AFDBYSP5VGUIKJ7FHLLDOG5LM56MHYWYWT4M4S7FZEZ7TU3) |
| Validator P2 Terms mismatch | [CCDRQUWK5JHLNJRAMT6P37K4RS4B3SNELLZPP6LMM64IZ357MSSGSDW4](https://stellar.expert/explorer/testnet/contract/CCDRQUWK5JHLNJRAMT6P37K4RS4B3SNELLZPP6LMM64IZ357MSSGSDW4) |
| Validator P3 Stale data | [CDUIB7ZPIRXMUZLIXRTALEFLXMAYLLIBJ6TDN5HWDR77CPLLPIG44DVJ](https://stellar.expert/explorer/testnet/contract/CDUIB7ZPIRXMUZLIXRTALEFLXMAYLLIBJ6TDN5HWDR77CPLLPIG44DVJ) |
| Validator P4 Bad status | [CA5FBH3RUW65UXIHU4YP2GSTQNUXHXTB4NIEVICPHHV7ISXY2VB6A2LV](https://stellar.expert/explorer/testnet/contract/CA5FBH3RUW65UXIHU4YP2GSTQNUXHXTB4NIEVICPHHV7ISXY2VB6A2LV) |
| Validator P5 Size limit | [CDJGYTFQOGMY3UX7CPYLJPNZF2SPFEHJRJGY3VOOHVVIPLNS4NWL5BEE](https://stellar.expert/explorer/testnet/contract/CDJGYTFQOGMY3UX7CPYLJPNZF2SPFEHJRJGY3VOOHVVIPLNS4NWL5BEE) |
| Validator P6 Oracle deviation | [CDPLC6G732LTARGLAKNA5TRR4DAERXKMWGWI4TS4XQ6WLHRSPHQNEWGV](https://stellar.expert/explorer/testnet/contract/CDPLC6G732LTARGLAKNA5TRR4DAERXKMWGWI4TS4XQ6WLHRSPHQNEWGV) |

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](https://lopw.com/docs/protocol/hashing-and-signing.html) 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*

```http
"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](https://lopw.com/docs/protocol/x402.html) page.

## SDK

```ts
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**
>
> | Item | Value |
> | --- | --- |
> | Network name in API paths | `testnet` (`/v1/testnet/...`, served) and `mainnet` (no deployment published, not served) |
> | CAIP-2 id | `stellar:testnet`, `stellar:pubnet` |
> | Wire encoding of `extensions.lopw` | `info.offer` and `receipt` are base64 ScVal XDR of `SignedOffer` / `SignedReceipt`; JSON Schemas [offer.json](https://lopw.com/docs/schemas/offer.json), [receipt.json](https://lopw.com/docs/schemas/receipt.json), [terms.json](https://lopw.com/docs/schemas/terms.json) |
> | Explorer | `https://stellar.expert/explorer/testnet/tx/{hash}` and `.../contract/{address}`; `public` for mainnet |
> | Test vectors | [/docs/vectors/v1.json](https://lopw.com/docs/vectors/v1.json) |

- [Proofs](https://lopw.com/proofs/): Every contract and transaction on Stellar testnet, linked to the explorer.
- [Demo](https://lopw.com/demo/): One real claim on Stellar testnet, step by step.
- [Chain bindings (reference)](https://lopw.com/docs/protocol/bindings.html): What any binding must provide, with the Stellar binding fields.
- [EVM binding](https://lopw.com/docs/networks/evm.html): How the same protocol is carried on Base, Ethereum, Arbitrum, Optimism, Polygon and Avalanche.
