
ERC-8320 · BACKING
A lender's question about a backing claim is short: does it clear my threshold? This reader answers it for any issuer's claim written to the backing.credit.v2 schema published in ERC-8320, from facts anyone can check.
| ALLOWED | The claim checks out and the consumer's policy is met. |
|---|---|
| BLOCKED | The claim checks out and the policy is not met. Every failed condition is listed. |
| NOT_VERIFIED | Something needed to answer is missing, unknown or does not check out. |
Integrity. The schema hashes to its published schemaHash, and the claim's
schemaId, schemaHash and contentHash match the schema and the exact
payload bytes.
Lifecycle and author. The claim is ACTIVE, not past validUntil, and signed by an
author the consumer trusts.
Envelope and data. The payload describes this claim and conforms to the schema.
What it cannot measure, it says so. No coverage figures, an appraised amount whose VALUATION claim has not been resolved, or two currencies without a rate from the consumer: NOT_VERIFIED, never a guess.
The consumer's policy. Freshness of the data, a clean encumbrance, and coverage against the minimum ratio, in exact decimal arithmetic.
The policy (trusted authors, minimum ratio, maximum data age, any FX rate) belongs to whoever runs the reader. The issuer and the registry operator do not set it.
Node 20 or later. The schema and samples come from the ERC repository; the reader refuses to run if the schema bytes do not match the published hash.
mkdir erc8320-reader && cd erc8320-reader
for f in threshold.mjs threshold.test.mjs package.json example-claim.json example-policy.json; do
curl -sfO https://registry.factos.co/tools/erc8320/$f
done
mkdir v2 && for f in backing.credit.v2.schema.json sample-receivables-pool-nominal.json \
sample-collateral-appraised.json sample-guarantee.json; do
curl -sf -o v2/$f https://raw.githubusercontent.com/ethereum/ERCs/master/assets/erc-8320/examples/backing/$f
done
npm install
npm test # 10 cases: ALLOWED, BLOCKED and each NOT_VERIFIED path
npm run threshold # the synthetic example
For a real claim: node threshold.mjs --payload p.json --claim c.json --policy pol.json,
where c.json holds the fields returned by the registry's
getClaim(assetId, BACKING, version). Exit code 0 ALLOWED, 1 BLOCKED, 2 NOT_VERIFIED.
| threshold.mjs | The reader |
|---|---|
| threshold.test.mjs | Tests |
| package.json | Dependencies: ajv, js-sha3 |
| example-claim.json | Synthetic on-chain claim fields |
| example-policy.json | Synthetic consumer policy |