GeezerVison is showing github.com — K0 privacy package: eliminate ringsize-2 (fixes #120) by liqdmetal · Pull Request #121 · DEROFDN/derohe
Conversation
Summary
The complete K0 privacy package, consolidated into one reviewable PR.
RingSize-2 transactions expose the signer on-chain by design — the ring is
sender + receiver, and parity selects the sender (Extract_signer). 56.8% of
mainnet txs use ringsize 2. This package eliminates the loophole in three
stages, sequenced so each is independently reviewable and the non-consensus
half ships immediately.
The fixes
Fix A — wallet warning (no hard fork, ships now)
The wallet/API half. When a transfer resolves to ringsize 2, the wallet sets a
PrivacyWarning surfaced through the RPC result. No consensus change.
Fix B1 — consensus min-ring-4 floor (hard fork)
From K0_MIN_RING4_HEIGHT, NORMAL/BURN txs with ringsize < 4 are rejected.
The floor of 4 = sender + receiver + 2 decoys is the smallest meaningful
anonymity set. Hardened against two bypasses found during wargaming:
- fork-boundary dodge — the floor keys off the chain tip, not the
attacker-settable tx.Height (a tx can reference a block 11 back)
- SC_TX type-lie — a ringsize-2 NORMAL transfer stamped
SC_TX (a no-op
execution path) no longer dodges the gate
Fix B2 — uses_signer registry (hard fork)
RingSize-2 SC calls expose the signer the same way. The NoSigner bit (high
bit of the SC_META_DATA Type byte — 33-byte wire format unchanged) marks
contracts that never call SIGNER(), auto-detected at install via AST scan
(ContractUsesSigner). Existing contracts default to uses_signer=true
(behavior preserved). Then:
SC_TX + ringsize 2 + NoSigner → rejected
SC_INSTALL at ringsize < 4 → rejected
After B1+B2, ringsize 2 has no legitimate remaining use.
Why this is one PR now
Previously split across four PRs (#80, #82, #91, #98), each carrying a
4,400-file vendored-dependency diff that made review impractical. This is the
same code consolidated into 16 files / ~1,000 lines, with no vendor noise,
plus the build-manifest fix (upstream's go.mod is 3 lines with no
vendor/modules.txt, so fresh clones don't build).
Tests (22, all green)
blockchain: k0_ringsize (floor reject / not-active / pre-fork), wargame
bypass + SC_TX type-lie, k0_b2 consensus
dvm: ContractUsesSigner (detect / no-false-positive / case-insensitive),
SC_META NoSigner bit, Private+NoSigner coexist
walletapi: ringsize-2 warning set, ring-4 no-warning, Transfer result field
Sequencing note
The fourth stage — Fix C, owner auth via verify_sig so gated contracts can
run at ringsize ≥ 4 — depends on the DVM v9 verify_sig intrinsic and remains
a separate PR (submitted separately against the intrinsics).
Supersedes
Closes the fragmented #80 (Fix A), #82 (Fix B1), #91 (Fix B2) in favour of
this single package. (#98 / Fix C stays open as it targets a different base.)
Branch fix/k0-privacy-package, based on community-dev.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…mod, no vendor/modules.txt)
…PC field (no HF)
RingSize-2 txs expose the signer on-chain by design (Extract_signer). The
wallet/API half of K0: warn when a transfer resolves to ringsize 2, surface
PrivacyWarning to programmatic callers. Ships immediately, no consensus.
…r registry (hard fork)
The consensus half of eliminating ringsize-2 on-chain:
B1 — from K0_MIN_RING4_HEIGHT, NORMAL/BURN txs with ringsize < 4 are
rejected (privacy floor of 4 = sender + receiver + 2 decoys). Hardened
against fork-boundary and SC_TX type-lie bypasses.
B2 — ringsize-2 SC_TX exposes the signer by design; the NoSigner bit
(high bit of SC_META_DATA Type byte, 33-byte wire format unchanged) marks
contracts that never call SIGNER(), auto-detected at install via AST scan.
SC_TX + ringsize 2 + NoSigner is rejected; SC_INSTALL at ringsize < 4 is
rejected. Existing contracts default to uses_signer=true (behavior
preserved).
Tests: k0_ringsize, wargame bypass, k0_b2 consensus, uses-signer detection.
…plements it
Upstream community-dev vendors a readline without KickReader, so the
wallet-cli does not build from a fresh clone. Replace the two call sites
with a no-op (UI shim only, not consensus-relevant).
This was referenced Aug 24, 2026
|
@CaptainDero @Slixe @8lecramm — flagging for review. This is a security fix, not a feature.
The issue: ringsize-2 transactions expose the signer on-chain by design — the ring is sender+receiver, and parity selects the sender (Extract_signer). Over half of mainnet txs currently use ringsize 2.
The fix is three stages, in one reviewable PR (17 files, no vendor noise):
- Fix A (wallet, no hard fork) — warn when a transfer resolves to ringsize 2, surface
PrivacyWarning over RPC. Ships immediately.
- Fix B1 (consensus, hard fork) — from
K0_MIN_RING4_HEIGHT, NORMAL/BURN txs with ringsize < 4 are rejected. Hardened against fork-boundary and SC_TX type-lie bypasses.
- Fix B2 (consensus, hard fork) —
NoSigner bit in SC_META_DATA (33-byte wire format unchanged) auto-detected at install; ringsize-2 SC calls + SC_INSTALL at ring < 4 rejected. Existing contracts default to uses_signer=true, so behavior is preserved.
22 tests green across blockchain/dvm/walletapi. Full tree builds from a fresh clone (the branch also carries the minimal go.mod/go.sum fix — upstream's go.mod is 3 lines with no vendor/modules.txt).
The fourth stage (owner auth via verify_sig so gated contracts run at ringsize >= 4) is a separate PR (#98) because it depends on the DVM v9 intrinsics.
Happy to rebase, split, or adjust the hard-fork height — just let me know what you'd like to see.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Program overview — 8 reviewable PRs (start here)
This fork is a set of 8 flat PRs to community-dev, all mergeable, each with a wargame test attacking its own boundary. Nothing is stacked; every branch diffs cleanly against community-dev (no vendor noise). Suggested read order (dependency-aware, not numeric):
| Order |
PR |
Package |
Consensus? |
One line |
| 1 |
#121 |
K0 privacy (A+B1+B2) |
HF |
ringsize-2 can no longer expose the signer (56.8% of mainnet txs) |
| 2 |
#128 |
DVM intrinsics + SC-auth |
HF |
verify_sig / pedersen / ec_* / verify_adaptor + owner auth |
| 3 |
#126 |
DVM language L1–L9 |
HF |
structured BASIC: loops, subs, arrays, bool, const, ints |
| 4 |
#119 |
C6 call_sc + value-forward |
HF |
a contract calls another; forward DERO/assets |
| 5 |
#94 |
verify_proof PoC + roothash bind |
HF |
true ZK tx verify in-VM (PoC — gas is a policy number) |
| 6 |
#124 |
Supply hard-cap invariant |
HF |
21M ceiling assert at coinbase (no-op on real ~20.89M curve) |
| 7 |
#89 |
Decoy selection + sampler + D6 bins |
no |
client-side ring selection; published activity model |
| 8 |
#86 |
Conformance suite + CI + vectors |
no |
reproducible correctness oracle (first CI for the repo) |
Theme clusters
- Consensus (HF): K0 privacy package: eliminate ringsize-2 (fixes #120) #121, DVM intrinsics: verification + group-arithmetic primitives (verify_sig, commitments, ec_add, ec_mul, verify_adaptor) (fixes #127) #128, DVM v10 language: structured control flow, subroutines, arrays, mapkeys, Bool, Int, CONST (fixes #125) #126, feat(dvm): C6 call_sc + incoming-value forward (fixes #118) #119, feat(dvm): verify_proof PoC with executing-block roothash bind (fixes #93) #94, Supply hard-cap invariant: assert 21M DERO ceiling at coinbase verification (fixes #123) #124 — all semver-gated (>=9 or >=10) so pre-fork contracts can't touch new syntax/intrinsics.
- Non-consensus: feat(walletapi): decoy selection — batch RPC + activity sampler + D6 bins (fixes #88) #89 (wallet/daemon), Conformance test suite + CI + malformed-point decode vectors (fixes #85) #86 (tests/CI) — independent, safe to review/ship separately.
Honest gaps (we don't overclaim)
- feat(dvm): verify_proof PoC with executing-block roothash bind (fixes #93) #94 is a PoC: gas = 2,000,000 policy number (~85ms/op ring-16), roothash bind shipped, cycle-accurate meter open.
- DVM intrinsics: verification + group-arithmetic primitives (verify_sig, commitments, ec_add, ec_mul, verify_adaptor) (fixes #127) #128's
verify_adaptor is the older form on the branch; a true adaptor (separate tweak point T) is validated locally and deliberately held until this set is reviewed.
- feat(dvm): C6 call_sc + incoming-value forward (fixes #118) #119's reentrancy rule (nonzero callee return = failure; data crosses calls via STORE) is validated locally, not pushed.
- No CI runs on these PRs — the only workflow lives on Conformance test suite + CI + malformed-point decode vectors (fixes #85) #86's branch, and GitHub only executes workflows on the default branch. Mergeability is git-level (all
mergeable=true).
If merging
#121 → #128 → #126 → #119 → #94 → #124 (HF), then #89, #86. No branch depends on another's merge, so any order works; this is just least-rework.
Full detail lives in each PR body and research-docs/changes-and-effects.md in the fork.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|