# Try Black_Wall — a pre-signature payment verdict in one `curl`

Black_Wall is a **pre-signature payment-risk oracle** for AI agents. Before your
agent signs an x402 payment, it asks Black_Wall one question and gets one answer:

> **GO** — sign it · **HOLD** — get a second look first · **STOP** — do not sign.

It **never touches funds** and is **not in the settlement path** — it returns a
verdict, your agent decides. (Verdict, not custody.)

**Free to try:** verdicts for payments **under $10 are free** — no wallet, no API
key, no signup. (Above $10 it's a small x402 micro-fee.) Everything below is a
real call to the live oracle; the verdicts are what it actually returns.

Endpoint: `POST https://agent-egress-proxy.onrender.com/v1/forecast-payment`

---

## See it (real scenarios — copy, paste, run)

### 1. GO — reputable counterparty, fair price
```sh
curl -s https://agent-egress-proxy.onrender.com/v1/forecast-payment \
  -H 'Content-Type: application/json' \
  -d '{"counterparty":"0x1111111111111111111111111111111111111111",
       "amount":"0.09","asset":"USDC","chain":"base",
       "resource":"https://api.example.com/run"}'
```
→ `"verdict":"GO"` — *has a real settlement track record, price within its norms.*

### 2. HOLD — unknown counterparty (no evidence is not trust)
```sh
curl -s https://agent-egress-proxy.onrender.com/v1/forecast-payment \
  -H 'Content-Type: application/json' \
  -d '{"counterparty":"0x00000000000000000000000000000000000000ff",
       "amount":"0.09","asset":"USDC","chain":"base"}'
```
→ `"verdict":"HOLD"` — *no history — it will not rubber-stamp a stranger.*

### 3. STOP — sanctioned counterparty (OFAC screening)
```sh
curl -s https://agent-egress-proxy.onrender.com/v1/forecast-payment \
  -H 'Content-Type: application/json' \
  -d '{"counterparty":"0x0330070fd38ec3bb94f58fa55d40368271e9e54a",
       "amount":"0.09","asset":"USDC","chain":"base"}'
```
→ `"verdict":"STOP"` — *"counterparty is on a sanctions list."* (Screened against the
current OFAC SDN digital-currency address list.)

### 4. STOP — price gouge (quote far above the payee's own norm)
```sh
curl -s https://agent-egress-proxy.onrender.com/v1/forecast-payment \
  -H 'Content-Type: application/json' \
  -d '{"counterparty":"0x1111111111111111111111111111111111111111",
       "amount":"9.00","asset":"USDC","chain":"base",
       "resource":"https://api.example.com/run"}'
```
→ `"verdict":"STOP"` — *the quote is wildly above what this payee normally charges.*

### 5. STOP — recipient mismatch (paying someone other than the 402 named)
```sh
curl -s https://agent-egress-proxy.onrender.com/v1/forecast-payment \
  -H 'Content-Type: application/json' \
  -d '{"counterparty":"0x1111111111111111111111111111111111111111",
       "amount":"0.09","asset":"USDC","chain":"base",
       "context":{"expected_recipient":"0x2222222222222222222222222222222222222222"}}'
```
→ `"verdict":"STOP"` — *paying a wallet other than the one the 402 named.*

Every response also carries a **`signed_receipt`** — an Ed25519 signature over the
verdict that *anyone* can verify with our published public key, Blackwall out of
the loop. Fetch the key at
[`/.well-known/blackwall-receipt-key.json`](https://agent-egress-proxy.onrender.com/.well-known/blackwall-receipt-key.json)
and check it with any RFC 8032 library (or the reference `verify_receipt.py`).
It's neutral proof of what the oracle told you — not an audit note you have to
take on trust. (A short `receipt_id` still travels alongside, as the private
handle for reporting the eventual outcome.)

---

## Wire it in (put a check between "decide to pay" and "sign")

Drop this in front of your x402 signing step. ~10 lines, no dependencies.

**Python**
```python
import urllib.request, json

def blackwall(counterparty, amount, asset="USDC", chain="base", resource=None, expected_recipient=None):
    body = {"counterparty": counterparty, "amount": str(amount), "asset": asset, "chain": chain}
    if resource: body["resource"] = resource
    if expected_recipient: body["context"] = {"expected_recipient": expected_recipient}
    req = urllib.request.Request(
        "https://agent-egress-proxy.onrender.com/v1/forecast-payment",
        data=json.dumps(body).encode(), headers={"Content-Type": "application/json"})
    return json.load(urllib.request.urlopen(req, timeout=15))

# before you sign:
v = blackwall(recipient_from_402, price_from_402, resource=url, expected_recipient=recipient_from_402)
if v["verdict"] == "STOP":
    raise RuntimeError("Black_Wall STOP: " + "; ".join(v["reasons"]))
# HOLD -> route to your spending-cap / confirmation step; GO -> sign.
```

**JavaScript**
```js
async function blackwall(b) {
  const r = await fetch("https://agent-egress-proxy.onrender.com/v1/forecast-payment", {
    method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(b),
  });
  return r.json();
}
const v = await blackwall({ counterparty, amount: String(price), asset: "USDC", chain: "base", resource });
if (v.verdict === "STOP") throw new Error("Black_Wall STOP: " + v.reasons.join("; "));
```

---

## What it checks

One call composes four independent signals into the verdict:

- **OFAC sanctions** — screened against the current SDN digital-currency address list.
- **Counterparty reputation** — settlement count + dispute rate (a no-history wallet scores the prior, not "trusted").
- **Price anomaly** — the quote against what this payee has historically charged (wash-trade-hardened).
- **Recipient integrity + thin-history / sybil guards** — you're paying the wallet the 402 named, backed by enough distinct history to trust.

It's designed to be a **superset of the free sanctions baseline**: everything a
KYT check does, plus reputation and price, in one call. Peer-group ("cross-payee")
pricing — a payee vs what *other* payees charge — is the next layer, activating as
the network accumulates cross-agent data.

Verdict-only. No custody. No lock-in. Try it, wire it, or just steal the checklist.
