---
referrals: 3
kind: program
payer: domain:acme.example
code: acme_skill
category: ai_native
status: open
at: 2026-10-30T00:00:00Z
net_of: tax
crit: step
---
# Acme skill author royalty

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

In plain words: a skill's author earns 13% of a referred customer's net payments for three months, then 7% for three more, then nothing. A copied skill pays its author, never the copier.

Change first: `payer`, `code`, the rates and the months. The author signs the token, and the skill's frontmatter names the author's code.

## Rules

### author_royalty

- on: payment
- basis: percent
- rate: 13%
- of: net
- recurring.months: 6
- step: [{"after_months":3,"rate":"7%"}]

## Attribution

- model: last_touch
- window_days: 30
- allowed_kinds: skill_install, tool_install
- token.signed: signed

## Settlement

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

## Example

Made-up lines. A skill install brings a customer who pays on the 5th of each month. The rate steps down in February, three months after the first payment. In May the six months have run out. The signature uses the public test key in `/vectors.json`, so it says nothing.

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-06-15T00:00:00Z`.

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

```jsonl
{"type":"agreement","code":"author","partner":"domain:author.example"}
{"type":"event","at":"2026-11-05T10:00:00Z","kind":"payment","source":"billing:inv_501","customer":"cu_f8091a2b3c4d5e6f","amount":"100.00","net":"100.00","asset":"USD","token":"rf1.acme_skill.author.i9k1m.tntcw0.das.h.ez53wELc-C3c2f-yFsQpvw"}
{"type":"event","at":"2026-12-05T10:00:00Z","kind":"payment","source":"billing:inv_502","customer":"cu_f8091a2b3c4d5e6f","amount":"100.00","net":"100.00","asset":"USD"}
{"type":"event","at":"2027-01-05T10:00:00Z","kind":"payment","source":"billing:inv_503","customer":"cu_f8091a2b3c4d5e6f","amount":"100.00","net":"100.00","asset":"USD"}
{"type":"event","at":"2027-02-05T10:00:00Z","kind":"payment","source":"billing:inv_504","customer":"cu_f8091a2b3c4d5e6f","amount":"100.00","net":"100.00","asset":"USD"}
{"type":"event","at":"2027-05-05T10:00:00Z","kind":"payment","source":"billing:inv_507","customer":"cu_f8091a2b3c4d5e6f","amount":"100.00","net":"100.00","asset":"USD"}
```

## Worked result

Computed by `run_ledger` as of 2027-06-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 |
|---|---|---|---|---|
| payment, 2026-11-05 | author | 13% of 100.00 | 13.00 |  |
| payment, 2026-12-05 | author | 13% of 100.00 | 13.00 |  |
| payment, 2027-01-05 | author | 13% of 100.00 | 13.00 |  |
| payment, 2027-02-05 | author | 7% of 100.00 | 7.00 |  |
| payment, 2027-05-05 | author | This is past the rule's recurring months. | 0.00 | recurring |

| Payee | Asset | Earned | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|
| author | USD | 46.00 | 0.00 | 46.00 | 0.00 | 46.00 |


## Why these settings

A rate that steps down and an end date give the author real pay for the customers it brought, without a claim that runs for the life of the account.
