K0 Fix C: SC-auth via verify_sig — owner auth at ringsize>=4 (fixes #97, stacks on #84) - #98
Closed
liqdmetal wants to merge 3 commits into
Closed
K0 Fix C: SC-auth via verify_sig — owner auth at ringsize>=4 (fixes #97, stacks on #84)#98liqdmetal wants to merge 3 commits into
liqdmetal wants to merge 3 commits into
Conversation
This was referenced Aug 24, 2026
…mmit, verify_commit, asset_balance, ec_add)
…ives + ec_mul + verify_adaptor One reviewable package replacing three stacked PRs (DEROFDN#84 v9, DEROFDN#105 ec_mul, DEROFDN#113 verify_adaptor): v9 (>=9.0.0): verify_sig (Ed25519 auth in SCDATA), hash_to_point, pedersen_commit / verify_commit (confidential settlement), asset_balance (SC reads own balance), ec_add (homomorphic accumulation). ec_mul (>=9.0.0, I3): bn256 G1 scalar multiplication — homomorphic pair of ec_add; strict x<p decode (rejects off-curve encodings). verify_adaptor (>=10.0.0, I4): Schnorr adaptor-signature verification — the cross-chain atomic primitive; strict point decode + low-s scalar (non-malleable). Tests: verify_sig (unit + version gate), ec_mul (homomorphic pair, composition, identity), verify_adaptor (valid/wrong-key/tamper/malformed), pedersen, hash_to_point, asset_balance, ec_add, + 2 wargame (scalar malleability, non-canonical point).
…ics) Ed25519 SC-auth keypair + SignSCData (domain:scid:entrypoint:args) + VerifySCData. Gated contracts authorize via signature at ringsize>=4 — removes the last legitimate use of ringsize-2 / SIGNER().
liqdmetal
force-pushed
the
feature/k0-fix-c
branch
from
August 25, 2026 01:33
3f2c97d to
1af3311
Compare
Author
|
Superseded by PR #128 — Fix C (SC-auth via verify_sig) is now folded into the consolidated intrinsics package, since it builds directly on the verify_sig intrinsic. |
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
The last piece of the K0 sequence: once
verify_sig(DVM v9, PR #84) lets a contract verify Ed25519 signatures in encrypted SCDATA, owner-gated entrypoints no longer need ringsize 2 — the signer is authorized by signature, not by ringsize-2 ring exposure. This PR is the wallet-side half plus the end-to-end demo.Why it completes K0
The ringsize-2 ring exposes the signer by design. The K0 package removes every legitimate use:
verify_sig— signature verification in the VMAfter this, ringsize 2 has no legitimate remaining use — the last reason it existed (owner-gated contracts needing
SIGNER()at ringsize 2) is gone.The implementation
walletapi/sc_auth.go— the wallet-side helper:SCAuthKey: app-level Ed25519 keypair. DERO spend keys are bn256 scalars, so SC-auth is a separate key, persisted by the wallet.SignSCData: builds + signs the call messagedomain:scid:entrypoint:args, bound to the call context so a signature can't be replayed onto another entrypoint or contract.VerifySCData: client-side mirror of the contract'sverify_sigcheck (self-check before broadcast).dvm/fixc_auth_test.go— the full Fix C flow in the simulator:verify_sigauthorizes at ringsize ≥ 4walletapi/sc_auth_test.go— direct unit tests for the helper (round-trip, tamper/wrong-key/malformed rejection, message convention + domain binding) that the dvm simulator test cannot reach due to the dvm↔walletapi import cycle.How a contract uses it
The caller signs
domain:scid:entrypoint:noncewith the owner's Ed25519 key at ringsize ≥ 4 — no SIGNER(), no ringsize-2 exposure, and the caller stays anonymous (only the signature proves authorization).Relationship
verify_sig) — this branch stacks on itBranch:
feature/k0-fix-cin the forkliqdmetal/derohe-improvements-by-liqdmetal(stacked onfeature/dvm-v9-intrinsics). Carries the build-manifest fix (go.mod/go.sum).