---
referrals: 3
kind: program
payer: domain:acme.example
code: acme_mcp
category: ai_native
status: open
at: 2026-10-30T00:00:00Z
net_of: tax
---
# Acme MCP server referral

Rates, amounts and names in this file are placeholders, not recommendations or market rates. Each party sets its own terms.

In plain words: an MCP server earns a flat 3.00 when it connects a customer, and 11% of the customer's first purchase if that follows within 30 days. Only Ed25519 tokens count, so anyone can check them against the server's public key.

Change first: `payer`, `code` and both amounts. Your server signs with its own key, kept on its own machine. Its public key goes in its party record.

## Rules

### connect_bounty

- on: connect
- basis: flat
- amount: 3.00
- asset: USD
- once_per: customer

### first_purchase

- on: purchase
- basis: percent
- rate: 11%
- of: net
- once_per: customer
- requires.event: connect
- requires.within_days: 30

## Attribution

- model: last_touch
- window_days: 30
- allowed_kinds: mcp_connect, tool_call
- token.signed: ed25519

## Settlement

- holdback_days: 30
- clawback_days: 60
- cycle: monthly
- payout_asset: USD
- rails: ach

## Example

Made-up lines. The server's token rides in `_meta["md.referrals/token"]` on an MCP request. A second token on the same event was changed after signing, so its signature does not check out. The key in the party line is the public test key in `/vectors.json`: anyone can sign with it, so it says nothing, and yours must be your own.

To run it, save this file as `REFERRALS.md` and these lines as `referrals.jsonl`, then run `node referrals.mjs run REFERRALS.md referrals.jsonl --as-of 2027-01-15T00:00:00Z`.

As of: 2027-01-15T00:00:00Z

```jsonl
{"type":"party","at":"2026-10-30T00:00:00Z","handle":"domain:mcpserver.example","party_kind":"mcp_server","keys":[{"kid":"k1","kty":"OKP","crv":"Ed25519","x":"11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo"}]}
{"type":"agreement","code":"mcp_srv","partner":"domain:mcpserver.example"}
{"type":"event","at":"2026-11-03T12:05:00Z","kind":"connect","source":"manual:connect_1","customer":"cu_091a2b3c4d5e6f70","carrier":"mcp_meta","tokens":["rf1.acme_mcp.mcp_srv.c4n8w.tnxdc0.dam.ek1.j04jNTqkXQUyKNiV_qPXp7T-bJyca5GmwNrpDmzWGizk9IIAVIZi_PSS0-Uxgx1nZcCy6UAXgoL8xoaMeICNBA","rf1.acme_mcp.mcp_srv.c4n8x.tnxddo.dam.ek1.RcyC89JuZ9-9gWfftrB0yK1tQFL4PAKPChnuHrnjCujFPY4uUEPsDFHG8Ye2AYTv3-4l6a8jquWi387JJFbnCw"]}
{"type":"event","at":"2026-11-20T09:00:00Z","kind":"purchase","source":"billing:ord_601","customer":"cu_091a2b3c4d5e6f70","amount":"200.00","net":"200.00","asset":"USD"}
```

## Worked result

Computed by `run_ledger` as of 2027-01-15T00:00:00Z, on the made-up lines above. Computed amounts are arithmetic on the records and terms you sent. They do not say what anyone owes. Your contract decides that.

| Event | Who | Working | Computed | Note |
|---|---|---|---|---|
| connect, 2026-11-03 | mcp_srv | Flat 3.00 | 3.00 |  |
| connect, 2026-11-03 | mcp_srv | The token does not meet the program's signing rule, or its signature does not check out. | 0.00 | X09 |
| purchase, 2026-11-20 | mcp_srv | 11% of 200.00 | 22.00 |  |
| purchase, 2026-11-20 | mcp_srv | The token does not meet the program's signing rule, or its signature does not check out. | 0.00 | X09 |

| Payee | Asset | Earned | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|
| mcp_srv | USD | 25.00 | 0.00 | 25.00 | 0.00 | 25.00 |


## Why these settings

`token.signed: ed25519` means a payer and a partner both get the same answer from the signature, which an HMAC can't give, since only its key holder can check it.
