Innovation Blockchain

Documentation · Coston2 testnet prototype · invented data

Documentation Multi-party testbed

Multi-party testbed

Until now one wallet played every role. In the testbed each role is a separate program with its own account and its own files, and the programs run the whole flow between them with real transactions on a local chain. It shows who can do what, and who refuses what.

Local chain only. The testbed runs on a chain on the same computer (anvil, chain id 31337) and refuses any other chain id. It sends nothing to Coston2 or to any other network. All data is invented, and inspector ids start with TEST-. Nothing here is live, reviewed by an outside party or used by a lender. Not legal or financial advice.

The parties of the multi-party testbed Operator runs the capture script, has no account Inspector builds, signs the digest, delivers the folder Lender checks the folder alone, deploys its own vault Relayer posts a record it was handed Wallet gates one per party, one account each Borrower draws and repays with its own account Refused by the gate another account, node control, raw sends Local chain, id 31337 ProofRegistryV2 and each lender’s LoanVaultV2 Harness, not a party reads the chain, holds the clock captures folder signed record signs vault, terms post draw if not own account observes
The parties of the multi-party testbed. Each party is a separate program with its own account and its own files, on a local chain only. A party reaches the chain through its own wallet gate and in no other way. The gate is a stand-in for the keystore a party would hold. The deployer, which deploys the registry once and then has no role, is not drawn.
The same flow in words
  1. The lender hands the schedule to the inspector and notes the engagement: the inspector id and the key id it will accept.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. The borrower draws and repays from the lender’s vault with its own account.
  7. 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.
  8. The harness is not a party. It reads the chain to check what each party reports, and it alone holds the clock.
  9. The deployer, not drawn, deploys the registry once through its own gate. After that it has no role: the registry has no owner.

What it is#

The folder prototype/testbed in the repository. It uses the inspector kit and the signed-record contracts (ProofRegistryV2, LoanVaultV2) as they are, unchanged. It needs Node and Foundry and no packages.

There are two modes. They run the same scenarios with the same code.

ModeA party isWhat keeps a party to its own account and files
Without containersA separate program on one computerIts wallet gate, and the party program's own checks of every path
One container per partyA container of its ownIts wallet gate, and what is mounted: its own network and its own volume

A signature shows who issued a record and that it was not changed. It does not show that the facts in the record are true.

The parties#

PartyWhat it doesAccount
OperatorThe borrower's facility staff. Runs the kit's read-only capture script with the code the inspector gave, and hands the capture files to the inspectorNone. It has no way to the chain
InspectorMakes the job, takes the captures, builds the record, signs its digest, delivers the report folder. Publishes its inspector id and key id. Can relay its own record and revoke its own keyIts own
LenderHands out the schedule. Checks the delivered folder alone, with the key id from its own engagement note. Deploys its own vault, pinned to that key id and to its own schedule hash. Sets terms, pauses, repinsIts own
BorrowerDraws and repays from the lender's vault. Can relay a record, and can choose to withhold oneIts own
RelayerAny third party. Posts a record it was handed. Has no standingIts own
DeployerDeploys the registry once. After that it has no role, because the registry has no ownerIts own

There is a second inspector with an account of its own, and one more whose key is revoked in scenario 8. The hosts are the kit's stand-in tools, and every serial number is invented.

The harness is not a party. It starts the chain, reads it as an observer so that what a party reports is checked against what the chain holds, and holds the clock. No party can move time.

The wallet gate, a stand-in for key custody#

On a local chain the accounts are the chain's unlocked test accounts. Anyone who can reach the chain can send as any of them. So each party gets a wallet gate: a small proxy in front of the chain that limits the party to one account. A party is given the address of its gate, never the address of the chain.

Limit. The gate is a stand-in, and it is labelled as one. On a real network the limit is the keystore each party holds. The gate holds no key and reads none. It knows one address. It shows that a party limited to one account cannot act as another. It says nothing about how a real party keeps a real key.

CallWhat the gate does
A read of the chainPassed on
eth_accountsAnswered by the gate: the party's own address only
eth_sendTransactionPassed on only when the sender is the party's own address. Otherwise FROM_NOT_OWN
eth_sign, personal_signPassed on only for the party's own address. Otherwise SIGNER_NOT_OWN
Node control (anvil_*, hardhat_*, evm_*, debug_*), raw transactions, and any method not on the listMETHOD_REFUSED
A batch with a refused call in itBATCH_HIDES_REFUSED. None of it is passed on

A refused call never reaches the chain. The gate keeps a log of what it passed on and what it refused, and the harness reads that log when it checks a step.

Files between parties#

Each party has a private folder. What passes between parties goes through hand-off folders with one writing role each: the lender's schedule to the inspector, the inspection code to the operator, the captures back to the inspector, the report folder to the lender and the borrower, the signed record to the relayer, and one public folder per publisher.

A reader treats what it is handed as hostile. A link in a hand-off folder is never followed out of that folder. A handed record is checked field by field against its type in the contract before any of it is used. The operator runs its own copy of the capture script; the copy it is handed is compared, never run.

The scenarios#

There are eleven. A scenario passes only when every step went as its story says, for the stated reason. Some other failure does not count.

#ScenarioWho does whatWhat must happen
1clean-passThe lender engages, the operator captures, the inspector builds, signs and delivers, the lender checks alone and opens its vault, a relayer posts, the borrower draws and repaysPASS on chain under the inspector's address. The draw goes through
2lender-checks-aloneOne file of the delivered folder is changed before the lender reads itThe lender's own check says DIFFERENT. Its program opens no vault: DELIVERY_NOT_VERIFIED. Nothing reaches the chain
3relayer-changes-a-fieldThe relayer adds a day to the valid-until time and posts the record with the signature it had. Then it posts the record as it wasThe registry refuses the changed record with SignerMismatch and stores nothing. The true record posts
4wrong-inspector-pinnedThe lender pinned inspector B. Inspector A's valid record is postedThe registry takes A's record. The lender's vault does not read it: NO_RECORD, and a draw is refused with ProofMissing
5other-scheduleA valid record for another schedule hash is postedThe vault reads SCHEDULE_MISMATCH. A draw is refused with ScheduleMismatch
6fail-is-posted-by-the-inspectorThe borrower is handed a FAIL and withholds it. The inspector relays its own recordWhile the FAIL is withheld the vault still allows a draw. Once it is posted the vault reads FAILED and a draw is refused with ProofFailed
7withheld-and-aged-outNobody posts a new record. The harness moves the clock four days onThe lender's maximum record age shuts the vault: STALE, although the record is inside its own validity. A draw is refused with ProofStale
8revoked-keyThe relayer signs a revocation of the inspector's key with its own account. Then the inspector revokes its own key. The lender repinsThe relayer's revocation is refused with SignerMismatch. After the inspector's own: INSPECTOR_REVOKED. After the repin: NO_RECORD, until the new inspector's record is posted
9lender-pausesThe lender pauses its vault, then lifts the pausePAUSED, and a draw is refused with VaultPaused. Allowed again afterwards
10second-fact-requiredThe lender names a second-fact contract for its vaultSECOND_FACT_MISSING, and a draw is refused with SecondFactMissing, until the stand-in holds for this record's digest
11crossing-the-lineParties try what is not theirs to doEvery attempt is refused by the one named in the next table. The vault and the chain are as they were

Crossing the line#

AttemptRefused by
The borrower sends a transaction as the lenderThe gate: FROM_NOT_OWN
The borrower changes the vault's terms from its own accountThe contract: NotLender
The relayer signs as the inspectorThe gate: SIGNER_NOT_OWN
A party impersonates an account, sets a balance, moves the clock or sends a raw transactionThe gate: METHOD_REFUSED
The lender drawsThe contract: NotBorrower
A batch that hides a refused callThe gate: BATCH_HIDES_REFUSED
The relayer reads the inspector's private folderThe party's own program: PATH_NOT_ALLOWED. In containers the folder is not there to read
The lender runs an inspector commandThe party's own program: ROLE_NOT_ALLOWED

How a step is checked#

What a party's program reports is checked against the chain wherever the chain can say it.

A contract refusal is found when the transaction is prepared, so a refused step has no transaction hash.

Run it#

Two commands, both from prototype/testbed. Both start their own chain and stop it again.

node bin/testbed-local.mjs     # every scenario, as separate programs. Needs Node 22 and Foundry
./testbed.sh test              # the same in one container per party, with the separation checked from inside. Needs Docker

The first writes build-output/results.json and build-output/transcript.txt: per scenario and per step, who did what, the transaction hash or the refusal, and who refused. The second builds an image, starts the chain, the gates and the parties, checks the separation from inside each container, runs every scenario, and removes everything it started. It publishes no port.

In containers each party sits alone on its own network with its own volume. It can reach its own gate and nothing else: not the chain, not another party, not the internet. Every container runs as a user without rights, with a read-only root filesystem and no capabilities.

Tests#

Counts as measured on 23 November 2026, from the project's facts file.

SuiteCommandCount
The gate, the hand-offs under a hostile party, and every scenario twice on one chainnode --test37 tests
The separation, checked from inside the containers, then every scenario./testbed.sh test125 checks

The runner is set to run the first suite every cycle, once its image is rebuilt. Its image has no Docker inside, so it does not run the second.

What it shows#

What it does not show#

What comes next#

Neither step below has been done.

  1. The same on Coston2. The same parties and the same scenarios on Flare's Coston2 testnet, with one throwaway keystore per party. The owner creates and funds each keystore himself. No tool and no agent makes, reads or holds a key. The keystore then takes the place of the wallet gate, and the roles are apart by key and not by a stand-in. The clock cannot be moved on a public network, so the stale scenario has to wait out a short maximum age.
  2. The Flare Confidential Compute step. Once the extension reads signed records, its check takes the place of the test mock in scenario 10: a second fact about private inputs, bound to the record's digest. The extension does not check an inspector signature yet. See FCC extension.