- Trusset issues a loan schedule with the market’s figures: JSON plus a one-page PDF annex. It names no person.
- The bank writes its own contract, attaches the schedule and runs the signing in its own tool.
- The bank reports the signed file as a salted commitment it computes on its side. Trusset never sees the file or its plain hash.
- The borrower checks its own copy against that commitment and accepts with its wallet (an EIP-712 signature).
- When the loan opens, the open confirm binds the agreement to the loan id and stages the commitment.
- The bank records it on chain with its admin wallet through the existing document registry calls.
Modes
The bank sets the mode per market with Set Agreement Policy, or through a standing policy.
Three optional rules sit next to the mode:
REQUIRED is a check in the Trusset backend before it prepares a transaction. A borrower who calls the market contract directly can still open a loan without an agreement; the contract does not know about agreements. A bank that needs more keeps using its borrower access list, as today.
Kinds
The remaining limit is the limit minus the open principal of the wallet’s loans in this market.
Flow
- Request. The borrower requests a
LOANagreement with Create Loan Agreement, or the bank creates aLOANorFRAMEWORKagreement for a wallet, which is issued at once. - Issue. The bank issues the request with Issue Loan Agreement. This freezes the schedule and creates the salt. The bank may lower the amounts or shorten the validity, never raise them past the market rules. With
autoIssueon, a request inside the market rules is issued at once. Issuing a request replaces only the earlier open requests and issued agreements of the same requester for that wallet; it never replaces a signed or accepted agreement. An agreement the bank creates itself replaces the wallet’s open agreements of the same kind. An instance keeps at most 3 open requests per wallet and 25 per market. - Sign. The bank downloads the schedule with Get Loan Schedule, attaches it to its contract and runs the signing in its own tool.
- Report. The bank reports the signed file with Report Signed Agreement: only the salted commitment of the contract and, optionally, of the signing certificate. It may report again until the borrower accepts.
- Accept. The borrower checks its own copy against the commitment and accepts with Accept Loan Agreement, signing the typed data that Get Loan Agreement returns. If its copy differs, it can tell the bank with Report Copy Mismatch.
- Open. The borrower opens the loan as usual. In
REQUIREDmode the build checks the accepted agreement and the figures. - Bind. The open confirm binds the agreement to the loan id and stages
loan-agreement(orframework-agreement) and, when reported,signing-certificatewith the commitment. A later agreement on the same loan stages asloan-agreement-2,signing-certificate-2and so on. ALOANagreement binds to one loan only: when two loans confirm at once, the second answersAGREEMENT_NO_LONGER_ACCEPTED. A staged agreement record cannot be replaced through Stage Loan Document. The confirm answer carriesagreement: { bound, ref, matched, differences, reason }. Paperwork never fails a confirm: the loan is already on chain. - Record. The bank records the staged documents with one signature through Record Staged Document. The registry confirm marks the agreement
RECORDED.
FRAMEWORK agreement runs steps 2 to 5 once. Each later loan within the limit binds at step 7 and is recorded at step 8.
A borrow-more above a LOAN agreement’s principal needs a new LOAN agreement for the new total. It binds to the same loan when the borrow-more is confirmed and names the earlier agreement in supersedes.
States
EXPIREDis read fromexpiresAton every read, so it never lags. ALOANagreement’s offer runs for the policy’svalidityDaysfrom its issue; aFRAMEWORKagreement runs until itsvalidUntil.- A new agreement of the same kind for the same borrower and market, issued while an earlier one is still open (
REQUESTED,ISSUED,SIGNEDorACCEPTED), sets the earlier one toSUPERSEDED. ALOANand aFRAMEWORKagreement can stand side by side.
Salted commitment
The registry stores onebytes32 per document. For an agreement it stores a salted commitment, never the plain hash of the file:
loan.agreement.recorded webhook, so it can archive it with the original and never depend on Trusset for the proof.
Verify a file with its salt. On a Mac or Linux, with the salt as 64 hex characters without 0x:
documentHash without its 0x. The SDK computes the same with lending.agreements.verify(file, salt, commitment), and the Issuer Portal’s Verify a file asks for the salt on a salted record, filled in for the parties.
Get Documents marks a registry record that came from an agreement with hashScheme: SALTED_V1 and its agreementRef, and gives the parties the salt. Records written through the manual document path keep plain SHA-256.
E-signature tools can produce a new file on each download, so the borrower’s copy can differ byte for byte from the bank’s original. The borrower then asks the bank for its original file, or accepts with
copyVerified: false, which the bank sees. A mismatch report notifies the bank, and the bank may report again until the borrower accepts.Acceptance
The borrower accepts with an EIP-712 signature over:certificateCommitment is zero when no certificate was reported. The signature must recover the borrower wallet and be in canonical low-s form. A contract wallet (Safe, ERC-4337, EIP-7702) is checked with EIP-1271 isValidSignature over the typed-data hash. copyVerified is the borrower’s own signed statement; Trusset cannot check it.
Standing policies
A standing policy can carryagreementPolicy: { mode, validityDays, autoIssue, autoIssueMaxAmount, frameworkValidityDays, requestAccess }. Saving one with a mode other than OFF needs the Scale plan. Each change stamps agreementPolicySetAt.
- At adoption. When the bank confirms an adoption, the matching standing policy (deployer first, then collateral token) creates the market’s agreement policy with
source: STANDING_POLICY, only if the market has none yet. The confirm answer carriesagreementPolicyAppliedandagreementPolicyApplyErrorwhen a standing policy carried agreement settings. - On read. When a market has no agreement policy, the policy read and the open build look up the bank’s adopted market and its matching standing policy, and apply it only when the policy is on, the market was adopted at or after
agreementPolicySetAt, and the bank’s plan includes loan agreements. This covers an adoption whose confirm answer was lost after the transaction mined.
- Not retroactive. Markets adopted before the standing policy carried agreement settings are never touched. Set those per market.
- No propagation. Editing a standing policy does not change markets already adopted, as with terms.
- No confirm, no lookup. An adoption that never reached any confirm leg leaves no adoption record, so the lookup cannot find it and the market stays
OFF. A market imported as a controller is not an adoption either; set its policy per market. - Plan upgrades apply later. If the bank’s plan did not include loan agreements at adoption, the policy applies on the first read after an upgrade. The policy read shows
sourceandstandingPolicyId, so this is visible. - A setting made on the market always wins. A standing policy never overwrites a market’s own policy.
Webhooks
Create a hook withhookType: loanAgreement and a webhookUrl on the market with Create Hook. It receives loan.agreement.requested, issued, declined, withdrawn, signed, copy_mismatch, accepted, bound, recorded, expired, revoked and superseded, signed like the other hooks. Each event goes only to hooks of the bank and of the requesting instance on that market.
The payload carries ref, marketAddress, chainRef, kind, status, borrowerWallet, scheduleHash, documentCommitment, copyVerified, loanId, txHash and at. The bank’s hooks also receive salt on recorded, and only while a verified wallet of the bank’s instance still holds the market admin role, read on the chain at delivery. A former bank receives no further events.
What Trusset never receives
- The contract file, the certificate file or their plain SHA-256. Every write route refuses file content, a plain hash and personal data fields.
- Names, addresses or any other personal data. The schedule holds wallet addresses, amounts, dates and market figures only.
externalReference, the one free text field, takes 1 to 64 letters, digits, dots, underscores or hyphens, for your own case number, never personal data. - A key. Every on-chain write, including the registry record, is signed by the wallet that holds the role. The routes return calldata or typed data only.
Plan and credits
E-Signatures are part of the Scale plan. The check runs on the bank’s plan only: when it sets a policy other thanOFF, issues an agreement, or saves a standing policy with agreement settings. A borrower is never blocked by its own plan. Each call on the key face counts as one credit, like every other lending route.
Routes
The bank is any instance with a verified wallet that holds
DEFAULT_ADMIN_ROLE on the market. The borrower side is the instance that requested the agreement, or an instance that holds the borrower wallet as a verified wallet. Every route exists on the Issuer Portal face as well, under /lending-external-securities-v2/markets/{marketId}/....