# Newsatoshi Commons & Agent Transaction Interface (NEWSATOSHI/2.1)

> Permissionless, post-quantum, zero-KYC machine money (`LOVE`) for autonomous AI agents: shielded `nsd1…` delivery addresses, pure-SHA-256 PayWord HTTP 402 micropayments, trustless multi-chain HTLC atomic swaps (`BTC`, `Lightning`, `Solana SOL/USDC`, `Base/Ethereum/Arbitrum ETH/USDC`), Bitcoin AuxPoW merge-mining (`chainid = 20051`), verifiable L1 Freivalds compute jobs, and Winterfell STARK spending covenants.

## When to use Newsatoshi Commons
- Use `https://commons.newsatoshi.org/mcp` or `https://commons.newsatoshi.org/api/*` when an agent needs to **check live Newsatoshi Mainnet/Testnet state**, **bridge BTC/Lightning/Solana/Base into LOVE trustlessly**, **issue or verify HTTP 402 PayWord micropayments**, or **cryptographically verify Winterfell STARK covenant proofs and L1 hash-locks**.
- Human & developer documentation: [Whitepaper & Lean 4 Proof](https://commons.newsatoshi.org/whitepaper), [API Docs](https://commons.newsatoshi.org/docs), [Developer Portal](https://commons.newsatoshi.org/developers), [About](https://commons.newsatoshi.org/about), [Contact](https://commons.newsatoshi.org/contact), [Privacy](https://commons.newsatoshi.org/privacy).

## Live Network Status
- Mainnet LIVE at height #4214 (difficulty 220.16, 210700 LOVE issued, 0 locks, 4 peers, AuxPoW chainid 20051)
- Testnet LIVE at height #26944 (2 locks, 4 peers, faucet enabled at https://newsatoshi-seed.fly.dev/api/faucet)
- Live Verified EVM HTLC (`Base 8453 · Arbitrum 42161 · Optimism 10 · Polygon 137`, ownerless, all 4 Sourcify `exact_match`): `0xF564A8F600B02981Bc02aC62a2B7d0C8dC638987` (Native ETH/POL & Canonical USDC)
- Live Verified Multi-Chain Proof-of-Backing Vault (`Base 8453 · Arbitrum 42161 · Optimism 10 · Polygon 137`, ownerless, 0 admin withdraw, all 4 Sourcify `exact_match`): `0x37Ed94525DBE408fA72cDd156409875666679265` (`GET https://commons.newsatoshi.org/api/backing/summary`)
- Official MCP Registry (`active`): `org.newsatoshi.commons/newsatoshi-commons` (`/.well-known/erc8004.json` ERC-8004 dual identity)
- Commons Covenant Rule Hash: `a506e75738bb9e2d5ef10ad5ab0689437dfea9a0fd790b5262ff98362bccc164` (`verify_only=true`, `0 server signing keys`)
- Commons Treasury Balance: `0 LOVE` (`nonce=0`, `parcels=0`, `kwh=0`, `starks=0`)

## Agent Interfaces (Zero Auth Required for All Reads, Compilers & Verifiers)
- [Streamable HTTP MCP Server](https://commons.newsatoshi.org/mcp): JSON-RPC 2.0 MCP endpoint (`initialize`, `tools/list`, `tools/call`, `resources/list`, `resources/read`) with 14 live tools.
- [MCP Server Card](https://commons.newsatoshi.org/.well-known/mcp/server-card.json) & [MCP Registry Manifest](https://commons.newsatoshi.org/server.json): Standard MCP discovery cards.
- [A2A Agent Card](https://commons.newsatoshi.org/.well-known/agent.json): Machine-readable Agent-to-Agent capability manifest.
- [RFC 9727 API Catalog](https://commons.newsatoshi.org/.well-known/api-catalog) & [OpenAPI 3.1 Schema](https://commons.newsatoshi.org/openapi.json): Complete REST API schema for multi-chain swaps, dual-chain lock verification, HTTP 402 PayWord verification, STARK verification, and offline signed telemetry/deeds.
- [Agent Skills Index](https://commons.newsatoshi.org/.well-known/agent-skills/index.json): SHA-256 verified installable skill ([SKILL.md](https://commons.newsatoshi.org/skills/newsatoshi-agent-payments/SKILL.md)).
- [Full Agent Transaction Guide](https://commons.newsatoshi.org/llms-full.txt): End-to-end 60-second setup recipes (wallet creation, free testnet faucet, BTC/Lightning/Solana/Base ↔ LOVE swaps, PayWord 402 streaming, L1 compute jobs, AuxPoW mining).
- [XML Sitemap](https://commons.newsatoshi.org/sitemap.xml)

## 60-Second Agent Quickstart
1. **Connect MCP:** point any MCP client at `https://commons.newsatoshi.org/mcp` (Streamable HTTP) and call `newsatoshi_agent_quickstart`.
2. **Create a shielded delivery wallet (zero interactive handshakes):**
   `newsatoshi --net testnet address --delivery` (or `--net mainnet` for production).
3. **Get free testnet LOVE for instant sandbox testing:**
   `curl -sS -X POST https://newsatoshi-seed.fly.dev/api/faucet -H 'Content-Type: application/json' -d '{"address":"<YOUR_NSD1_ADDRESS>"}'`
4. **Acquire Mainnet LOVE trustlessly from Bitcoin, Lightning, Solana, or Base/EVM (zero exchanges/KYC):**
   Call `POST https://commons.newsatoshi.org/api/swaps/compile` (or MCP tool `newsatoshi_compile_btc_love_swap`) with `rail`: `btc_onchain`, `lightning_bolt11`, `solana_htlc`, or `evm_htlc`.
5. **Pay or charge per API call with HTTP 402 PayWord micropayments:**
   Request a challenge at `GET https://commons.newsatoshi.org/api/agent/402-challenge` and verify pure-SHA-256 PayWord tokens (`SHA256^ticks(token) == tip`) or live L1 hash-locks at `POST https://commons.newsatoshi.org/api/agent/402-verify`.

## Source & Releases
- Repository: https://github.com/theguysaccount/newsatoshi-commons
- Installable Agent Skill: `skills/newsatoshi-agent-payments/SKILL.md`
- RFC-0021 Native L1 `OP_VERIFY_COVENANT_STARK` (`0xb4`): https://github.com/theguysaccount/newsatoshi-rfc0021

---

## Detailed Agent Transaction Recipes

### Recipe 1: Connect via Model Context Protocol (MCP)
Add to Claude Desktop, Cursor, Codex, Antigravity, or any Streamable HTTP MCP host:
```json
{
  "mcpServers": {
    "newsatoshi": {
      "url": "https://commons.newsatoshi.org/mcp"
    }
  }
}
```
Available MCP tools:
- `newsatoshi_get_network_status` — Live Mainnet & Testnet chain status
- `newsatoshi_get_commons_state` — Live Commons treasury, covenant rule hash, public roots, STARKs & anchors
- `newsatoshi_compile_btc_love_swap` — Compile canonical BIP-199 Bitcoin P2WSH HTLC (`bc1q…`), decode Lightning BOLT-11, Solana PDA escrow, or live Base Mainnet `NewsatoshiHtlc.sol` (`0xF564A8F600B02981Bc02aC62a2B7d0C8dC638987`)
- `newsatoshi_verify_onchain_lock` — Verify a SHA-256 lock live on Newsatoshi Mainnet/Testnet + Bitcoin `mempool.space`
- `newsatoshi_verify_payword_402` — Verify a pure-SHA-256 PayWord HTTP 402 micropayment token (`SHA256^ticks(token) == tip`)
- `newsatoshi_verify_stark_proof` — Cryptographically re-verify a Winterfell STARK covenant transition proof
- `newsatoshi_agent_quickstart` — Structured onboarding commands for autonomous agents
- `newsatoshi_create_402_challenge` — Generate a standard `NEWSATOSHI-402/1.0` Payment Required challenge
- `newsatoshi_get_mining_economics` — Live AuxPoW merge-mining yield & network hashrate economics

### Recipe 2: Zero-Human Wallet Setup & Shielded Agent Payments
Newsatoshi supports non-interactive shielded delivery addresses (`nsd1…`): any sender can pay your agent on-chain privately without out-of-band note passing.
```bash
# 1. Print your agent's non-interactive shielded delivery address
newsatoshi --net mainnet address --delivery

# 2. Scan for incoming private payments & check spendable balance
newsatoshi --net mainnet scan
newsatoshi --net mainnet balance

# 3. Pay another agent privately (zero transparent address graph)
newsatoshi --net mainnet send <PEER_NSD1_ADDRESS> 1.5 --memo "inference-job-42"
```

### Recipe 3: Trustless `BTC ↔ LOVE` Atomic Swaps (On-Chain P2WSH or Lightning BOLT-11)
Both Bitcoin (`OP_SHA256` / BOLT-11) and Newsatoshi L1 (`lock --hash`) enforce the identical `SHA256(preimage) == payment_hash` invariant.
```bash
# Generate a local 32-byte CSPRNG preimage + SHA-256 hash (keep preimage secret!)
newsatoshi-swap keygen

# Compile canonical BIP-199 Bitcoin P2WSH HTLC + Newsatoshi L1 lock CLI
curl -sS -X POST https://commons.newsatoshi.org/api/swaps/compile \
  -H 'Content-Type: application/json' \
  -d '{
    "rail": "btc_onchain",
    "direction": "btc_to_love",
    "love_network": "mainnet",
    "btc_network": "mainnet",
    "payment_hash_hex": "<64HEX_HASH>",
    "amount_love": "250",
    "amount_btc_sats": 500000,
    "love_claim_address": "<NS1_OR_NSD1_ADDRESS>",
    "love_timeout_blocks": 144,
    "btc_claim_pubkey_hex": "<33B_COMPRESSED_HEX>",
    "btc_refund_pubkey_hex": "<33B_COMPRESSED_HEX>",
    "btc_locktime": 900036,
    "btc_current_height": 900000
  }'

# Verify both chains live (Newsatoshi L1 /api/lock + Bitcoin mempool.space)
curl -sS -X POST https://commons.newsatoshi.org/api/swaps/verify \
  -H 'Content-Type: application/json' \
  -d '{"payment_hash_hex":"<64HEX_HASH>","love_network":"mainnet","btc_address":"bc1q..."}'
```

### Recipe 4: HTTP 402 Machine-to-Machine PayWord Micropayments (Zero Gas Per Call)
Ideal for per-token LLM inference, tool calls, sensor feeds, and data APIs where on-chain transactions per call are too slow/heavy:
1. Payer agent picks a 32-byte secret `seed`, hashes it `N` times (`tip = SHA256^N(seed)`), and commits `tip` in a single escrow/channel.
2. For call `#k`, payer reveals `token = SHA256^(N - k)(seed)` in `X-Newsatoshi-PayWord: tip=<tip>,token=<token>,ticks=<k>`.
3. Server verifies `SHA256^k(token) == tip` locally or via `POST https://commons.newsatoshi.org/api/agent/402-verify` in microseconds (post-quantum pure SHA-256).

### Recipe 5: Verifiable L1 Compute Jobs (Built into Newsatoshi v0.1.0)
Agents can hire or sell verifiable matrix-multiplication compute trustlessly on L1 with Freivalds fraud proofs:
```bash
newsatoshi --net mainnet job post A.csv B.csv --pay 5 --bond 1
newsatoshi --net mainnet job claim <JOBID> --bond 1
newsatoshi --net mainnet job commit <JOBID> C.csv
newsatoshi --net mainnet job finalize <JOBID>
```

### Recipe 6: Cryptographically Bounded Agent Budgets (`NEWSATOSHI/2.1` Covenants)
Humans can fund a Commons/Covenant UTXO with immutable caps (`max_bounty_payout`, `reinvest_bps`, `min_soil_health_score`) and offline **NIST FIPS 205 SLH-DSA** hardware keys (`newsatoshi-hw-signer --env-seeds`), guaranteeing an autonomous agent cannot exceed its spending policy even if prompt-injected.
