security: replace legacy Basis contracts with reviewed v2 generation - #20
Draft
a-shannon wants to merge 13 commits into
Draft
security: replace legacy Basis contracts with reviewed v2 generation#20a-shannon wants to merge 13 commits into
a-shannon wants to merge 13 commits into
Conversation
…n/chaincash-remediation-integration
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
This replaces the production Basis v1 /
layer2-oldcontract surface with anexact, versioned Basis v2 generation for ERG and token reserves. Historical v1
sources remain available only as digest-bound test fixtures; they are no longer
compiled, exposed by production helpers, printed as deployment targets, or
packaged in the main JAR.
This is the on-chain/Scala half of the remediation. The paired tracker changes
are published in BetterMoneyLabs/basis-tracker#12.
Security rationale
The previous production surface mixed legacy contracts, builders, addresses,
and deployment helpers with the active application. The v1 claim identity and
global reserve-state model also could not safely distinguish independent
reserve generations. Keeping those paths callable while adding a new contract
generation would make accidental legacy construction and cross-reserve state
reuse possible.
The v2 design binds every claim to its exact domain: reserve NFT, optional
reserve token id, tracker NFT, owner, and receiver. Tracker and per-reserve AVL
state use separate fixed shapes, and the redemption ABI is frozen across the
contract source, compiled ErgoTree/P2S bytes, Scala tests, and the Rust tracker.
Changes
receipts;
signatures, ordinary redemption, and the emergency branch;
metadata, asset/domain mismatches, and ERG/token variants;
demo paths, and participant-secret helpers;
canonical-LF digests that are stable across Windows and Linux checkouts;
returning.
Validation
BasisV2Spec: 22/22checkouts
36f5ecdad28f5a8bb56b2e5a75348e724af76fb524c27b33e099b7a00a0bd845Boundaries
claim.
run was performed.
ParticipantSecretsSpecwas not run because its local secret fixture is notavailable; all seven non-secret suites are covered.
retirement are handled by the paired tracker PR.