Documentation Flows
Flows
The eight flows of the prototype as diagrams. Under each one the same steps are written out in words.
In every diagram, dark boxes are parties, filled grey boxes are steps off the chain, outlined boxes are contracts, dashed boxes are files or records, boxes with a heavy line are Flare's own network, and the tinted box is the extension's machine or the second fact planned for it. No diagram is wider than three columns.
The first three flows are the signed record: built and tested on a local chain, not deployed by the owner on Coston2 yet. The extension flow is registry v1, the earlier demo shown on Coston2.
From the inspection to the loan gate#
The whole path, from a GPU answering with its serial number to a draw being allowed or refused.
The same flow in words
- The inspector reads every host of the facility with the capture script.
- The inspector kit matches the serial numbers to the collateral schedule, adds the findings and builds the report and the proof record. It prints the record digest.
- The inspector signs the digest once, with his own key and his own tool. The kit checks the signature and files it. The signature shows who issued the record and that it was not changed. It does not show that the facts are true.
- The lender gets the report folder. With the key id from the engagement letter it can check the folder alone, with no chain.
- Anyone relays the signed record to the registry. The registry recomputes the digest from the fields, recovers the signer from the signature, and files the record under the signing address.
- The lender’s vault is pinned to one signing address and one schedule hash. It reads only that key’s record.
- The borrower asks the vault for a draw. The vault allows it only when every check of the lender’s gate passes.
- Later package: a second fact about private inputs, checked by the Flare Confidential Compute extension and bound to the record digest. The vault has a place for it. Nothing fills that place yet.
A signed record, from the digest to a draw#
Who does what with the signature, and what the registry and the vault do with it. A signature shows who issued the record and that it was not changed. It does not show that the facts are true. Details: Report and proof record and Contracts.
The same flow in words
inspect buildbuilds the record from the job’s files and prints its digest: SHA-256 over 15 words of 32 bytes. It signs nothing.- The inspector signs that digest himself with
cast wallet sign, from his own keystore. The kit never opens a key. inspect signrecomputes the digest, checks the form of the signature, askscast wallet verifywhether that key signed it, and files the signature in the job folder.inspect verifyrebuilds every output from the evidence, recomputes the digest and checks the signer against the key id the caller gives.- Anyone may relay the record, the signing address and the signature to the registry with
submit. The relayer has no standing. - The registry recomputes the digest from the fields it is given and recovers the signer. If the signature does not recover to the named address, or any other rule fails, it reverts with a named error and stores nothing.
- A record that passes is stored in the slot of that facility and that signer. Only a later record from the same signer replaces it.
- The lender’s vault reads only the slot of the address the lender pinned, and only for the schedule hash the lender pinned.
- The borrower draws when every check of the vault passes. The lender can change the pin, the maximum age and the required procedures, and can pause.
One inspection with the inspector kit#
What the inspector does, and which file each step produces. Details: Inspector kit.
The same flow in words
inspect newstarts the job folder: the schedule, an empty findings file, the capture script and a code for this inspection.- On each GPU host the capture script runs read-only queries and writes one file with the serial numbers, a telemetry snapshot, the time and the code.
- The capture files go into the job’s
captures/folder. The inspector enters findings infindings.json. inspect buildmatches serials to the schedule, checks each capture, rates every exception, writes the report, the proof record and the evidence index, and prints the record digest.- The inspector signs the digest himself, with his own key. The kit signs nothing.
inspect signchecks the signature and files it, so the record and the report carry it.inspect verifyrebuilds everything from the evidence files, recomputes the digest and checks the signature.
What the vault checks before a draw#
The order of the checks of the lender's vault and the error each one gives. Details: Contracts.
The same flow in words
- The amount must be above zero, or the draw reverts with
ZeroAmount. - The lender must not have paused the vault, or
VaultPaused. - The registry must hold a record for the facility in the slot of the pinned signing address, or
ProofMissing. A record signed by any other address is not read. - The pinned address must not be revoked, or
InspectorRevoked. - The record’s schedule hash must equal the one the lender pinned, or
ScheduleMismatch. - The block time must not be past the record’s valid-until, or past the inspection date plus the lender’s maximum age, or
ProofStale. No transaction is needed for a record to go stale: the clock does it. - The result must not be FAIL, or
ProofFailed. - The record must cover every procedure the lender requires, or
ScopeTooNarrow. - A PASS_WITH_EXCEPTIONS record lets a draw through only if the lender allowed it, or
ProofHasExceptions. - If the lender named a second-fact contract, it must answer true for this record’s digest, or
SecondFactMissing. - The amount must fit under the credit limit, or
CreditLimitExceeded. - Otherwise the draw goes through and the vault emits
DrawAllowedwith the record’s digest and the pinned address.
A check through the extension, registry v1#
Who sends what when a record is checked against the private coverage file. This is the earlier demo. Details: FCC extension.
The same flow in words
- The provisioner sends the coverage file to the machine as a direct action, encrypted to the machine’s key and signed.
- The inspector calls
requestVerificationwith the proof record and pays the fee. - Flare’s data providers relay the instruction. It reaches the machine only above 50 % of signing weight.
- The machine compares the record with the coverage file against the threshold (80 % in the demo) and signs the result with the machine’s key.
- Anyone fetches the result from the machine’s proxy and calls
submitResult. - The contract recovers the signer and asks FlareTeeManager whether it is a machine of this extension in production.
- If so, the record goes to registry v1. That registry takes records from this contract and from nobody else.
A repayment proven through the Flare Data Connector#
How a payment on another ledger is credited to a loan. Details: Repayment proof.
The same flow in words
- The borrower pays on the XRP Ledger testnet. The payment’s memo carries the loan’s 32-byte reference.
- The client prepares a request of type
Payment. It only reads, and handles no key. - The request and its fee go to FdcHub on Coston2.
- Flare’s data providers check the payment and agree on it in a voting round.
- After the round the proof is fetched and handed to
creditRepayment. Anyone may do this. - The ledger checks the proof with Flare’s verification contract, checks the receiving address and the reference, and credits the loan once.
- The vault counts only repayments the ledger has credited. The borrower cannot report one.
One cycle of the runner#
What the automatic container does every two hours. Details: Runner.
The same flow in words
- A timer starts a cycle every two hours, while the computer the container lives on is awake.
- The runner runs nine of the repository’s test suites as they are.
- It plays the next of twelve scenarios: a whole invented inspection made with the inspector kit.
- Its test wallet signs the record digest the kit prints.
inspect signfiles the signature, andinspect verifymust pass with that wallet’s address before anything is posted. - It posts the record to its own registry, which checks the signature again before it stores anything. This does not pass through Flare Confidential Compute.
- It reads what its vault does with a draw, and compares that with what the scenario said should happen.
- It writes the feed and uploads it to its own Cloudflare Pages project.
- The test activity page reads that feed in your browser.
The parties of the multi-party testbed#
Each role as a separate program with its own account, on a local chain only. Details: Multi-party testbed.
The same flow in words
- The lender hands the schedule to the inspector and notes the engagement: the inspector id and the key id it will accept.
- The inspector makes the job and gives the operator the inspection code. The operator runs the capture script on the stand-in hosts and hands the captures back. The operator has no account and no way to the chain.
- The inspector builds the record, signs its digest with its own account through its own gate, and delivers the report folder. A signature shows who issued the record and that it was not changed. It does not show that the facts are true.
- The lender checks the delivered folder alone, with the key id from its own engagement note. Only then does it deploy its own vault, pinned to that key and to its own schedule hash.
- The inspector hands the signed record to a relayer, who posts it. The relayer has no standing: the registry refuses a record with a changed field with
SignerMismatch. - The borrower draws and repays from the lender’s vault with its own account.
- Each wallet gate passes on only what its one party sends or signs as itself. Another party’s address, a node-control method, a raw transaction or a batch that hides one of these is refused and never reaches the chain.
- The harness is not a party. It reads the chain to check what each party reports, and it alone holds the clock.
- The deployer, not drawn, deploys the registry once through its own gate. After that it has no role: the registry has no owner.