docs: full audit & sync to protocol main + whitepaper v1.0#21
Open
0xkkkn wants to merge 2 commits into
Open
Conversation
Page-by-page review of every public docs route against the protocol codebase (platform-web3-protocol main) and Whitepaper v1.0 draft. ## Reference (5 pages) - Contracts: restructure to dual-mode (plain mainnet path + confidential FHE path); add SDK-canonical plain-mode addresses (Escrow, receiver, PolicyRegistry, CoverageManager, PoolFactory, InsurancePool template); add deployment-posture explanation (UUPS testnet vs immutable mainnet v1.0); add "Specified, not yet deployed" section (StrategyRouter, OperatorSlashingManager, OperatorSubsidyManager, CoordinatorRegistry, cUSDT, LZ handler family, ParticipationBond); fix IConditionResolver (add getConditionFee 3rd method, mark IERC165); split IUnderwriterPolicy into Plain (uint256/bool) and Confidential (euint64/ebool) variants. - SDK: document all 6 modules (sdk.escrow + escrowPlain, sdk.insurance + insurancePlain, sdk.bridge, sdk.events); fix viem helper signature (walletClientToSigner is async); network type accepts mainnet too. - EscrowModule: subtitle clarifies FHE + plain dual-mode; fix waitForFunded return type (SettlementResult, not void); expand static methods (get/exists/total/redeemMultiple/build). - InsuranceModule: dual-mode note; expose createPool extras (initialManager, guardian, isOpen) + four-role separation note + CoverageInvite (closed pools). - McpServer: fix get_docs sections list (was overview/guides/protocol/ reference/whitepaper/litepaper; actual is overview/guides/protocol/ reference/whitepaper/root); switch links from legacy /get-started/reineira-code to canonical /developer-tools/reineira-code. ## Operate (2 pages) - CoordinatorNetwork: replace "single stake-weighted quorum" claim with the actual four-stage slashing pipeline (5% bond -> 3-day challenge -> 4-day vote -> 14-day expiry, QUORUM_BPS = 1000) per Whitepaper §8.6 and OperatorSlashingManager source. - RunOperator: add chaos-net zero-fee callout (FeeManager pinned to zero bytecode-level until MAINNET_ACTIVATION_BLOCK; operator income comes from OperatorSubsidyManager during chaos-net); fix arithmetic error (35 bps + 15 bps = 50 deducted on 10k USDC, 9,950 remaining — was wrongly stated as 50+30=80 deducted, 9,920 remaining). ## Build (7 pages) - EscrowLifecycle: full event list (FeeStamped + FeeDistributed instead of nonexistent FeeSet; add ConditionSet, CoverageManagerSet); add 4th redeem check (paidAmount >= amount); fix fundFrom signature (escrowId, euint64 amount) — was incorrectly (escrowId, amount, payer); add MAX_BATCH_SIZE = 20 cap note. - ConditionPlugins (Condition Resolvers): add IERC165 inheritance + 3rd method getConditionFee to the interface block + table; callout explaining the no-op fee stub required for each example; fix /developers/reineira-code -> /developer-tools/reineira-code. - InsurancePolicies (Underwriter Policies): show both interface variants (plain IUnderwriterPolicy with uint256/bool returns, FHE IConfidentialUnderwriterPolicy with euint64/ebool); make P2P example import the confidential variant since it uses FHE types. - InsurancePools: add four-role separation callout (Whitepaper §7.2 — Creator/Manager/Guardian/Operator); rewrite privacy section to match Whitepaper Prop 7.2 disclosure bound (per-buyer values encrypted; policy/pool addresses & lifecycle events public). - CrossChain: downgrade LayerZero OFT rail from "Live" to Spec'd v1.0 (handler family is whitepaper-spec, not in code); add chaos-net zero-fee callout; fix same 10k-USDC arithmetic. - GasPerformance: add plain-mode disclaimer (chaos-net launches plain; expect 40-60% of the FHE-mode gas figures). ## RSS (5 pages) - RssWhatIs: note implementation reality — chaos-net retains the legacy privara.storage.* prefix per Whitepaper §6.2; reineira.storage.* becomes canonical at v1.0 mainnet. - RssLicensing: replace "cofhejs glue" with "@cofhe/sdk integration" (post-migration name from cofhejs@0.3 -> @cofhe/sdk@0.5). ## Learn (6 pages) - MentalModel: fix IConditionResolver interface block (add IERC165, add getConditionFee); relabel IUnderwriterPolicy as IConfidentialUnderwriterPolicy (block shows FHE types); update license header to Apache-2.0 per actual source. - Architecture: replace cofhejs with @cofhe/sdk and use encryptInputs([...]).execute() pattern; remove cleartext exists field from Escrow struct (not present in actual code); split storage section to acknowledge testnet UUPS posture vs mainnet-v1.0 immutable posture; note privara.storage.* legacy slot prefix; downgrade LayerZero OFT description. - Security: expand single-quorum description to the actual four-stage pipeline; mark UUPS row as "testnet only" with mainnet immutable posture; mention Safe + TimelockController deploy posture (Whitepaper §10.6); add chaos-net unaudited limitation + Phase 7 review counts + external-audit gate; add CoFHE single-substrate trust limitation (TA2, Open Problem 4.1). - Resilience: refine "always-true resolver" response — the protocol's encrypted predicate still binds owner == msg.sender + paidAmount >= amount + !isRedeemed, so an always-true resolver weakens conditionality but cannot redirect funds; update proxy-admin trust row to reflect Safe + TimelockController testnet posture + immutable mainnet posture. ## Project Status + Get Started (5 pages) - DocsHub: hero copy now lists the four primitives correctly (Escrow / Gate / Insurance / operator-secured cross-chain), no more "Shields" leftover. - Status: replace LZ Handler row "chaos-net Live" with Spec'd v1.0-track (LZOFTHandler family not in repo today); refine OperatorSlashingManager note to the four-stage pipeline parameters; clean CoordinatorRegistry description. ## Developer Tools (4 pages) - BuilderJourney: reineira-code stack updated to Foundry/Hardhat + Solidity + @cofhe/sdk (was Hardhat + Solidity + cofhejs). - ReineiraCode: test harness uses @cofhe/sdk mocks (was cofhejs mocks). - PlatformModules: add missing third package (landing, Next.js + React 19) per platform-modules workspace; clarify app starter has passkey + smart-account auth. ## Research (1 page) - AgenticComposition: align LZOFTHandler row with Whitepaper §9.2 — not in repo today; family is Spec'd v1.0-track. ## Cleanup - Delete two orphaned pages with no route and no nav entry: Governance.tsx (replaced by RSS / Status / Risk coverage) and EnterpriseChecklist.tsx (replaced by Status / Risk coverage). ## Verification - npm install + npm run build: passes (37 per-route HTML stubs generated by route-stubs plugin — no broken routes). - npm run lint: clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Page-by-page audit of every public docs route against the protocol codebase on
platform-web3-protocol/mainand the Whitepaper v1.0 draft. The previous content drifted in three main ways: (1) the SDK address book had grown a plain-mode mainnet path that no docs page mentioned, (2) plugin interfaces had stale signatures (IConditionResolverwas missinggetConditionFee;IUnderwriterPolicywas shown with FHE return types on the plain variant), and (3) several pages framed v1.0-mainnet posture (immutable contracts, LayerZero rail "Live", zero-fee post-activation arithmetic) as already shipped.26 pages updated, 2 orphaned pages deleted, build / lint clean.
Reference (5 pages)
packages/sdk/src/constants/addresses.ts; add deployment-posture explanation (UUPS testnet vs immutable mainnet v1.0); add "Specified, not yet deployed" section (StrategyRouter,OperatorSlashingManager,OperatorSubsidyManager,CoordinatorRegistry,cUSDT, LZ handler family,ParticipationBond); fixIConditionResolver(addgetConditionFee3rd method, markis IERC165); splitIUnderwriterPolicyinto Plain (uint256/bool) and Confidential (euint64/ebool) variants.sdk.escrow+escrowPlain,sdk.insurance+insurancePlain,sdk.bridge,sdk.events); fix viem helper signature (walletClientToSigneris async);networktype accepts mainnet too.waitForFundedreturn type (SettlementResult, notvoid); expand static methods (get/exists/total/redeemMultiple/build).createPoolextras (initialManager,guardian,isOpen) + four-role separation callout +CoverageInvitenote (closed pools).get_docssections list (wasoverview/guides/protocol/reference/whitepaper/litepaper; actual is…/whitepaper/root); switch links from legacy/get-started/reineira-codeto canonical/developer-tools/reineira-code.Operate (2 pages)
QUORUM_BPS = 1000) per Whitepaper §8.6 andOperatorSlashingManager.sol.FeeManagerpinned to zero bytecode-level untilMAINNET_ACTIVATION_BLOCK; operator income comes fromOperatorSubsidyManagerduring chaos-net); fix arithmetic (35 bps + 15 bps = 50 deducted on 10 k USDC, 9,950 remaining — was wrongly stated as 50 + 30 = 80 deducted, 9,920 remaining).Build (7 pages)
FeeStamped+FeeDistributedinstead of nonexistentFeeSet; addConditionSet,CoverageManagerSet); add 4thredeemcheck (paidAmount >= amount); fixfundFromsignature (escrowId, euint64 amount) — was incorrectly(escrowId, amount, payer); addMAX_BATCH_SIZE = 20cap note.is IERC165+getConditionFee3rd method to the interface block and table; callout explaining the no-op fee stub required for each example; fix/developers/reineira-code→/developer-tools/reineira-code.IUnderwriterPolicywithuint256/boolreturns, FHEIConfidentialUnderwriterPolicywitheuint64/ebool); make P2P example import the confidential variant since it uses FHE types.LZOFTHandlerfamily is whitepaper-spec, not in code today); add chaos-net zero-fee callout; fix the same 10 k-USDC arithmetic.RSS (5 pages)
privara.storage.*slot prefix per Whitepaper §6.2;reineira.storage.*becomes canonical at v1.0 mainnet.cofhejs@0.3→@cofhe/sdk@0.5).Learn (6 pages)
IConditionResolverinterface block (addIERC165, addgetConditionFee); relabelIUnderwriterPolicyasIConfidentialUnderwriterPolicy(block shows FHE types); update license header to Apache-2.0 per actual source.cofhejswith@cofhe/sdkand use theencryptInputs([...]).execute()pattern; remove cleartextexistsfield from theEscrowstruct (not present inConfidentialEscrow.sol); split storage section to acknowledge testnet UUPS vs mainnet-v1.0 immutable posture; noteprivara.storage.*legacy slot prefix; downgrade LayerZero OFT description.TimelockControllerdeploy posture (Whitepaper §10.6); add chaos-net unaudited limitation + Phase 7 review counts + external-audit gate; add CoFHE single-substrate trust limitation (TA2, Open Problem 4.1).owner == msg.sender∧paidAmount >= amount∧!isRedeemed, so an always-true resolver weakens conditionality but cannot redirect funds; update proxy-admin trust row to reflect Safe + Timelock testnet posture + immutable mainnet posture.Project Status + Get Started (5 pages)
LZOFTHandlerfamily not in repo today); refineOperatorSlashingManagernote to the four-stage pipeline parameters; clean upCoordinatorRegistrydescription.Developer Tools (4 pages)
reineira-codestack updated to Foundry/Hardhat + Solidity +@cofhe/sdk(was Hardhat + Solidity +cofhejs).@cofhe/sdkmocks (wascofhejsmocks).landing, Next.js + React 19) perplatform-modulesworkspace; clarify app starter has passkey + smart-account auth.Research (1 page)
LZOFTHandlerrow with Whitepaper §9.2 — not in repo today; family is Spec'd v1.0-track.Cleanup
Governance.tsx(its content is now covered by the RSS section + Status + Risk pages) andEnterpriseChecklist.tsx(covered by Status + Risk).Sources of truth used
docs/whitepaper/*.mdpackages/escrow/contracts/core/ConfidentialEscrow.sol,packages/shared/contracts/interfaces/core/IEscrowEvents.solpackages/shared/contracts/interfaces/plugins/IConditionResolver.sol,IUnderwriterPolicy.sol,IConfidentialUnderwriterPolicy.solpackages/orchestration/contracts/core/OperatorSlashingManager.solpackages/sdk/src/constants/addresses.tspackages/mcp-docs/src/server.ts,src/content/contracts.generated.ts,src/content/docs.generated.tsLICENSEplatform-modules/packages/{app,backend,landing}/package.jsonTest plan
npm install(one missing dep:react-helmet-asyncresolved as part of the install).npm run build— 37 per-route HTML stubs generated by theroute-stubsplugin, no Rollup warnings on doc pages.npm run lint— clean./reference/contracts,/build/escrow-lifecycle,/operate/operator-network,/status,/riskin preview and confirm tables / interface blocks render./build/condition-plugins,/operate/coordinator-network, etc.) still work.