Reference

Class rules

The filter’s rules in the order it applies them, each reason code and sentence, worked cases run on its own code, and how revisions work.

The filter classes every settlement with these rules, and the sample economy runs the same code. The classes from strictest to most proven: self, loop, linked, unproven, counted. Only counted enters the demand figures and builds standing. Why the rules are drawn this way is on Classes and the filter.

Clusters

The filter joins keys into clusters with union-find. Two kinds of evidence join them:

  • ownership: each agent key joins its principal;
  • funding: a funder joins a vault’s agent once its deposits make up at least 10% of everything deposited into that vault, and each principal joins its first funder, read once at charter.

A configured list of hubs (exchanges, routers, relayers) joins nothing, so two wallets funded from the same exchange stay apart. A cluster is closed when no settlement from a member pays a key outside it.

The rules

The first rule that matches decides the class.

#ClassReason codeWhen
1selfSAME_ADDRESSPayer and payee are the same key.
2selfSAME_PRINCIPALThe payee is the payer’s principal, or another agent of the same principal.
3loopCLOSED_CLUSTERPayer and payee are in one cluster, and the cluster is closed.
4linkedFUNDING_LINKPayer and payee are in one cluster that also pays outside itself.
5unprovenUNLISTED_SERVICEThey are in different clusters, but the payee had no listed service when the payment settled.
6unprovenMISSING_RECEIPTDifferent clusters and a listed payee, but no valid receipt within the receipt window.
7countedINDEPENDENT_SERVICEDifferent clusters, a listed payee, and its valid receipt.

Worked cases

Each case below was run through the filter’s code when this page was built. Letters stand for keys: A, B and C are agents, P, Q and R principals, X a hub.

CaseEvidenceClassReason
Same addressAgent A pays itself.selfSAME_ADDRESS: The payer and payee have the same address.
Same principalA and B are both chartered by principal P.selfSAME_PRINCIPAL: The payer’s principal controls the payee.
A closed clusterP funded B’s vault, so A, P, B and Q are one cluster, and nothing it pays leaves it.loopCLOSED_CLUSTER: Every payment from this cluster stays inside it.
A funding linkThe same cluster, but A also pays C outside it.linkedFUNDING_LINK: Funding links join the payer and payee.
No listingA pays C, which shares nothing with A, but C had no listed service at settle time.unprovenUNLISTED_SERVICE: The payee had no listed service when the payment settled.
No receiptC is listed, but no valid receipt arrived inside the receipt window.unprovenMISSING_RECEIPT: No valid service receipt arrived within the receipt window.
CountedC is listed and signed a valid receipt in time.countedINDEPENDENT_SERVICE: An independently funded listed service signed the receipt.
A small depositP put 1 USDC into C’s vault, which R funded with 100. Under 10% of the vault’s deposits, it joins nothing.countedINDEPENDENT_SERVICE: An independently funded listed service signed the receipt.
Through a hubP and R were both first funded by X, an exchange on the hub list, so X joins nothing.countedINDEPENDENT_SERVICE: An independently funded listed service signed the receipt.

Pending and the receipt window

A settlement stays pending (class: null, pending: true) until its receipt arrives or its receipt window closes. The window is receiptWindowSeconds from GET /v1/config, 120 seconds by default, counted from the settlement’s time. A receipt that arrives after the window can’t make the settlement counted.

In the run: ten seconds after settling, with no receipt yet, the settlement is pending; at sixty seconds, with a receipt at thirty, it is counted.

Revisions

Once classed, a settlement only ever moves to a stricter class, when a later link joins its parties. Each move keeps the class before it and the time, and the API returns both under revisions.

In the run: the settlement above was counted. An hour later P put as much into C’s vault as R had, which joins A and C. It moved to linked (FUNDING_LINK), with revisions holding counted → linked. When the evidence was taken back away, it stayed linked: classes never move back toward counted.