FACTOS
A reference tool. Code a consumer runs on its own machine, against its own policy. CC0. The examples it ships with are synthetic.

ERC-8320 · BACKING

Threshold reader

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.

ALLOWEDThe claim checks out and the consumer's policy is met.
BLOCKEDThe claim checks out and the policy is not met. Every failed condition is listed.
NOT_VERIFIEDSomething needed to answer is missing, unknown or does not check out.

What it checks, in order

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.

Run 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.

Files

threshold.mjsThe reader
threshold.test.mjsTests
package.jsonDependencies: ajv, js-sha3
example-claim.jsonSynthetic on-chain claim fields
example-policy.jsonSynthetic consumer policy
Not included: reading the claim from a chain and resolving a VALUATION reference; both are a consumer integration step. The reader measures a published claim against the consumer's own rule. It is not investment advice and not a recommendation, and it does not certify that the backing exists or that a right is valid or enforceable.