Commit Graph
120 Commits
Author SHA1 Message Date
DanSandClaude Opus 4.8 b7060c7de0 hygiene: Phase 3 — dead-code excision (~7,100 lines)
Third phase of the code-hygiene remediation: remove provably-dead code.
Each in-file deletion was adversarially verified (a per-finding investigator
plus a skeptic that greps the tree to refute deletability); the sanity grep
confirms zero dangling references, and the tree builds and self-mines clean.

Removed wholesale:
- src/cc/dapps/ (9 files, ~6,939 lines): a git-tracked but never-built Komodo
  DEX / z-migration tool (hushdex.c, zmigrate.c, cJSON.c, ...). Nothing in
  Makefile.am/configure.ac references it.

In-file dead code:
- pow.cpp: the `#ifdef original_algo` oldRT_CST_RST function (the macro is
  never defined in source or build flags) and two `if ( 0 )` debug blocks.
- walletdb.cpp: the "orphaned staking transaction" cleanup path (deadTxns) —
  DragonX is RandomX PoW with no staking, so the guard is always false and the
  block never runs; also drop the now-unused static/extern decls.
- cc/eval.h: the ProcessCC / Eval::ImportCoin / ImportPayout / DisputePayout
  declarations that have no definition anywhere in the tree.
- rpc/crosschain.cpp: the crosschainproof stub RPC (returned {} unconditionally)
  and its registrations in rpc/server.cpp, rpc/server.h, rpc/client.cpp.
- coins.cpp: the commented-out `//TODO: delete` Sprout PushAnchor template.
- wallet.cpp: the permanently-zero KMD `interest2` term in CreateTransaction.
- rpc/net.cpp: hush_longestchain's always-zero `n` var (num > (n>>1) => num>0)
  and its `if ( 0 )` debug branch.
- hush_nSPV.h / hush_nSPV_fullnode.h: three `if ( 0 && ... )` dead debug branches.
- net.cpp, crypter.h, saplingconsolidation.cpp (dup set_error_code),
  shieldcoinbase.cpp (`donation < 0` on a uint8_t), cclib.cpp (unused
  FAUCET2SIZE): single-line dead-code fixes.

Deliberately NOT touched (verification refuted the audit's "dead on DragonX"
premise): the ~2,250-line HUSH3 checkpoint block, the miner notary/timelock
paths, and hush_gateway.h — all reachable at runtime via -ac_name / -ac_*
args (the inherited Komodo assetchain model), and hush_gateway's
hush_opretvalidate is called from ConnectBlock (consensus). Dropping those
requires a deliberate decision to remove HAC/HUSH3 mode, tracked separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-27 13:20:51 -05:00
DanSandClaude Opus 4.8 aff6101987 hygiene: Phase 2 — DragonX-authored cleanup (13 findings)
Second phase of the code-hygiene remediation, covering the items the
DragonX team introduced or the rebrand missed. No consensus behavior
changes; validated on a local self-mining node.

Log cruft:
- chainparams: route the startup ">>>>>>>>>>" banner and the port line
  through LogPrintf/LogPrint("net") instead of fprintf(stderr).
- pow: drop the fprintf(stderr) hash-mismatch dump that duplicated the
  LogPrintf copy verbatim.
- miner: gate the RandomXDatasetManager per-alloc/per-VM address dumps and
  MemDiag /proc reads behind LogPrint("randomx"); keep a one-line
  "allocated shared dataset (N GB)" summary at default verbosity.

Named constants (single source of truth in wallet.h):
- DEFAULT_AUTOSHIELD_FEE/INTERVAL, MIN_AUTOSHIELD_INTERVAL,
  DEFAULT_AUTOSHIELD_MIN_UTXOS, AUTOSHIELD_MIN/MAX_FEE for the autoshield
  option parsing and help text (were bare 10000/25/5 literals repeated
  across init.cpp and wallet.h).
- AUTO_OP_TARGET_HEIGHT_OFFSET replaces the three copy-pasted
  `blockHeight + 5` async-op scheduling offsets.
- AUTO_OP_EXPIRY_DELTA replaces the three per-file *_EXPIRY_DELTA=15
  constants (sweep/consolidation/autoshield) with one shared value.
- Move DEFAULT_AUTOSHIELD_FEE out of the op header into wallet.h so it no
  longer collides when both headers are included.

Error surfacing:
- init: report clamped/out-of-range -autoshieldinterval/-autoshieldfee via
  InitWarning() (surfaces to GUI/log) instead of fprintf(stderr).

Rebrand / dead foreign-chain code (approved removals):
- server: drop the HUSH3 special-cases in stop() and HelpExampleCli; the
  cli example now shows "dragonx-cli" instead of "hush-cli".
- getinfo (misc): remove the stale dPoW notarization block (notarized,
  prevMoMheight, notarizedhash, notarizedtxid, notarizedtxid_height,
  HUSHnotarized_height, notarized_confirms) — DragonX is a private chain
  from genesis with no active dPoW. Also fixes the hardcoded "HUSH3" that
  made getinfo query a foreign chain's notarization.
- delete the dead Komodo notary RPCs getera/getdragonjson/
  getnotarysendmany/geterablockheights (getera returned 0;
  getnotarysendmany was marked "this is broke") and their registrations.
- remove the dead ASSETCHAINS_EQUIHASH reporting branches in getinfo and
  getmininginfo — DragonX is RandomX-only.

chainparams: document why the upstream Equihash params and the literal
Bitcoin genesis are retained under RandomX (do not "fix" them).

Deferred: the hdSeedOrigin int->string switch in z_autoshieldstatus
(no shared helper exists to reuse; low value).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-27 12:24:04 -05:00
DanSandClaude Opus 5 1ec6590fb7 wallet: add z_autoshieldstatus
Auto-shielding could silently decline to run with no way to ask why. The
destination it resolves was equally invisible: the only evidence was a LogPrintf
emitted once per round, so an operator wanting to know where their mined coinbase
was going had to grep debug.log.

z_autoshieldstatus reports the enable state, whether a round is in flight, the
next height, interval, fee, minimum utxos, and the resolved destination -- plus
the HD seed provenance in both numeric and readable form, whether the seed is
phrase-recoverable, and a disabled_reason explaining why it is off when it is.

That last field is the point. "autoshield": false on its own does not distinguish
an operator who passed -autoshield=0 from a wallet whose seed provenance is not
known-recoverable, and those need different responses.

Mirrors z_sweepstatus in shape and registration.

Verified on all three branches:
  fresh wallet    -> autoshield true, origin 1 "created on an empty wallet",
                     seed_recoverable true, disabled_reason ""
  -autoshield=0   -> disabled_reason "disabled by -autoshield=0"
  upgraded wallet -> autoshield false, origin 4 "predates provenance recording",
                     seed_recoverable false, disabled_reason "HD seed origin is
                     not known-recoverable; back the seed up and pass -autoshield=1"

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-25 06:04:43 +02:00
DanSandClaude Opus 4.8 4caf2fc68f Add BIP39 seed phrases (SilentDragonXLite-compatible) and HD transparent keys
Derive transparent (t-addr) keys from the HD seed and add BIP39 mnemonic seed
phrases that are byte-for-byte compatible with SilentDragonXLite, so the same
24 words recover the same shielded and transparent addresses in either wallet.

HD transparent keys:
- Derive t-keys from the seed at m/44'/coin'/0'/0/i (were random CKeys).
- CHDChain gains a version-gated transparent counter; existing wallets load
  unchanged. GenerateNewKey routes through DeriveNewChildKey when enabled
  (-hdtransparent, default on).
- Restore from a seed hex via -hdseed with gap-limit pre-derivation; birthday
  pinned to genesis so the rescan is not clipped.

BIP39 seed phrases:
- Wire the vendored trezor BIP39 lib (src/crypto/bip39) into the build, fix its
  BIP39_WORDS guard, and disable the insecure mnemonic cache.
- Match SDXLite exactly: English wordlist, empty passphrase, PBKDF2 64-byte
  seed, coin type 141, ZIP-32 m/32'/141'/i' and BIP44 m/44'/141'/0'/0/i. Store
  the 32-byte entropy and expand to the 64-byte seed on demand.
- Restore via -mnemonic, create via -usemnemonic, reveal via z_exportmnemonic.

Verified by gtests including a known-answer BIP39 seed vector and z/t address
derivation checks (src/gtest/test_hdtransparent.cpp, test_mnemonic_compat.cpp).
Docs in doc/hd-transparent-keys.md and doc/seed-phrase.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 01:57:18 -05:00
Duke 9177a51b6d Remove getbalance64 #473 2025-10-16 11:14:01 -04:00
Duke cae942a5c9 z_listlockunspent 2025-08-20 15:15:36 -04:00
Duke 51462777c8 Remove dead code 2025-07-24 09:07:44 -04:00
Duke e0821acab4 Remove dead code 2025-07-24 08:56:10 -04:00
onryo 58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke b41785a684 Delete more CCs #381 2024-02-10 22:56:34 -05:00
Duke 9e0ac062fa Delete a lot of CC stuff #381 2024-01-30 11:23:35 -05:00
Duke bb8a3c57a4 Delete auction/faucet/heir CC rpcs #381 2024-01-30 10:48:21 -05:00
Duke 86104c4ef7 Remove oracles RPCs 2024-01-29 12:04:59 -05:00
Duke 3a3c67e0fc Delete many things we do not want or need 2024-01-13 00:06:09 -05:00
Duke de7a5fb6d7 remove cc payments and rewards 2024-01-12 20:47:46 -05:00
Duke 657bb1e25e remove dice, channels, lotto 2024-01-11 22:30:50 -05:00
Duke a23ab58af6 Start removing unused gateway code 2024-01-07 13:20:17 -08:00
Duke 765487bb14 Remove unused code 2024-01-06 23:30:19 -08:00
Duke 20fdc0e4fe Get rid of deprecation entirely which allows current code to run past block height 5555555 2023-12-27 12:57:35 -05:00
Duke b03c8f3108 Remove unused code 2023-06-17 21:31:05 -04:00
Duke e033a2e6eb Update copyrights to 2023 2023-02-09 18:06:03 -05:00
Jonathan "Duke" Leto 5d2307a709 Update copyrights to 2022 2022-09-19 15:45:30 -07:00
Jonathan "Duke" Leto 5c8c7507ec Add z_consolidationstatus RPC 2022-09-06 05:55:03 -07:00
Jonathan "Duke" Leto 4aedeb557b Add z_sweepstatus RPC 2022-08-27 10:35:08 -07:00
Jonathan "Duke" Leto 0ee1d068c1 These haven't existed for a long time 2022-06-26 17:21:33 -07:00
Duke Leto 0c6e5945a6 Add listaddresses as a new replacement for getaddressesbyaccount; cleanup 2021-09-01 20:26:59 -04:00
Duke Leto 4a536d62dc Update copyrights 2021-04-17 13:03:22 -04:00
Duke Leto 000ef4ac91 Keeping HUSH on the down low 2021-01-27 13:39:27 -05:00
Duke Leto b58c15b9fb update copyrights 2020-12-10 07:45:36 -05:00
Duke Leto 6a30b40415 Once men turned their thinking over to machines in the hope that this would set them free.
But that only permitted other men with machines to enslave them.

      --  Reverend Mother Gaius Helen Mohiam
2020-12-09 07:23:08 -05:00
Duke Leto d8677c2a21 Hush dat rpc 2020-12-04 09:46:03 -05:00
Duke Leto ce3039d96c Delete the failed jl777 experiment called JUMBLR 2020-10-25 21:32:27 -04:00
Duke Leto 7524c64024 Our intrepid warrior gazed at his Dragon and both knew what was needed 2020-10-25 19:06:09 -04:00
Duke Leto be16f80abc Hush Full Node is now GPLv3
Any projects which want to use Hush code from now on will need to be licensed as
GPLv3 or we will send the lawyers: https://www.softwarefreedom.org/

Notably, Komodo (KMD) is licensed as GPLv2 and is no longer compatible to receive
code changes, without causing legal issues. MIT projects, such as Zcash, also cannot pull
in changes from the Hush Full Node without permission from The Hush Developers,
which may in some circumstances grant an MIT license on a case-by-case basis.
2020-10-21 07:28:10 -04:00
Duke Leto a7f88a87aa Update copyright URL to be https 2020-09-20 13:17:38 -04:00
Duke Leto 5412da7d71 Connect z_listreceivedaddress to the outside world 2020-09-09 11:42:52 -04:00
Duke Leto 2fbcca4167 add rescan rpc 2020-06-13 10:14:51 -04:00
Duke Leto a7250280d0 Remove deprecated Sprout benchmarking RPCs 2020-02-27 11:06:58 -05:00
Duke Leto cc3e1c11d7 Use global mempool nullifier count, not local wallet nullifier count 2020-01-02 10:56:14 -05:00
Duke Leto 148e86a33b Remove unneeded RPCs 2019-12-22 05:03:11 -05:00
Duke Leto 94e2d1aedf src/rcp/server.h upstream changes 2019-12-12 17:33:26 -05:00
jl777 e9cdff1a28 genminingCSV 2019-08-05 07:00:28 -11:00
Mihailo Milenkovic bc665882ed nSPV modifications for CC and other fixes (#29) 2019-07-24 16:33:03 +02:00
jl777 28e10d71bf First version of mempool request 2019-07-15 02:04:19 -11:00
jl777 6cb639c2b7 nspv_listtransactions initial 2019-07-13 01:49:05 -11:00
jl777 ea155ad656 Merge branch 'FSM' into jl777 2019-07-08 17:56:27 -11:00
jl777 24b67c623b Small fixes and logout 2019-07-06 19:41:55 -11:00
jl777 ffd7509692 nspv_send -> spend 2019-07-05 22:13:06 -11:00
jl777 085f99d44d Add coinaddr to utxos 2019-07-05 00:35:44 -11:00
jl777 591185a0b3 Rest of client side low level rpc, incl messages 2019-07-04 00:29:18 -11:00