21 Commits

Author SHA1 Message Date
4d72e5fc30 wallet: fix sweep-scheduler wedge and unsynchronized driver mutation
The zaddr-sweep op cleared fSweepRunning/nextSweep only on the sweepComplete
success path (inside main_impl), so a cancelled or throwing sweep left
fSweepRunning stuck true. Since fSweepRunning now also gates consolidation and
the default-on autoshield, a persistently failing sweep (e.g. a corrupt-witness
note) would wedge all three background ops for the session.

Move the scheduler bookkeeping into main() so it runs on every terminal state
(success/failure/exception/cancel), guarded by op id. Preserve the intended
"keep draining every block until swept" model: on a successful-but-incomplete
round the flag stays set and nextSweep is not advanced; on completion OR on
failure/exception the flag is released and nextSweep backs off one interval, so
a failing sweep no longer retries every block or wedges the other ops.

Also fix RunSaplingSweep to take cs_wallet itself (was AssertLockHeld, a no-op
in release builds) since ChainTip does not hold it there and the driver mutates
scheduler state + enqueues -- matching RunSaplingConsolidation and
RunAutoShieldCoinbase.

sweepComplete is recorded via a new member; saplingSweepOperationId made public.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-21 18:55:16 -05:00
ca730a5d98 wallet: fix consolidation-scheduler wedge (ran every block; dead mutual-exclusion)
The Sapling auto-consolidation scheduler never advanced nextConsolidation after
init and never set fConsolidationRunning, so once the tip passed the init
threshold `-consolidation` dispatched a consolidation op every block instead of
once per -consolidationinterval, and every guard that reads fConsolidationRunning
(in RunSaplingSweep, and in the new autoshield driver) was dead.

Mirror the intended scheduler model:
- RunSaplingConsolidation sets fConsolidationRunning=true before dispatch and
  self-guards with `if (fConsolidationRunning) return;`.
- The consolidation op advances nextConsolidation = consolidationInterval +
  tipHeight and clears fConsolidationRunning on every terminal state
  (success/failure/exception/cancel), guarded by op id so only the current op
  mutates scheduler state.
- saplingConsolidationOperationId moved to public so the op can read it.

Restores the documented once-per-interval cadence and makes the
sweep/consolidation/autoshield mutual-exclusion guards effective.

Note: the sweep op has the same latent wedge (fSweepRunning/nextSweep are
cleared only on the sweepComplete success path, so a cancelled or throwing
sweep leaves fSweepRunning stuck true) - left for a follow-up; this commit is
the template to port.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-21 18:28:17 -05:00
2ebbbc777c wallet: add default-on auto-shield-coinbase; drain miner coinbase into a z-addr
On this ac_private=1 chain miners accumulate one transparent coinbase UTXO per
block (the only transparent output the chain permits). It had to be shielded
manually via z_shieldcoinbase, and left unshielded it is the sole persistent
metadata leak on the chain and the source of miner UTXO-fragmentation send
failures.

Add AsyncRPCOperation_autoshieldcoinbase: a periodic, default-on wallet op
driven from CWallet::ChainTip alongside sweep/consolidation, draining matured
coinbase into a wallet-owned Sapling z-address in size-bounded batches.

- Enqueue-only driver (RunAutoShieldCoinbase): takes only cs_wallet in the
  notify context; all gathering runs on the async worker under LOCK2(cs_main,
  cs_wallet).
- Dedicated op (not a reuse of z_shieldcoinbase) so it never toggles mining.
- Default-ON but conditional: silent no-op on -disablewallet, external
  -mineraddress, non-mining, or locked wallets (explicit IsLocked() guard).
- Destination is reuse-then-create; -autoshieldaddress override is
  spend-key-validated at init so funds cannot be stranded.
- Sweep-model bookkeeping: advances nextAutoShield and clears the running flag
  on every terminal state; an op-id guard stops a stale op clobbering scheduler
  state; a self-guard stops cancel/re-enqueue churn.
- Sietch-padded output shape matches manual z_shieldcoinbase txns.

Config: -autoshield (default true), -autoshieldinterval, -autoshieldaddress,
-autoshieldfee (range-validated), -autoshieldminutxos.

Incorporates fixes from an 8-angle code review: CAmount fee type with init-time
range validation, op-id-guarded flag bookkeeping, driver self-guard, and a
tipHeight-consistent NU-activation guard.

Note: the fConsolidationRunning / nextConsolidation consolidation-scheduler
wedge is a pre-existing bug, left for a separate change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-21 02:06:09 -05:00
1c3523aac1 build(win): add -Wa,-mbig-obj to the mingw cross-compile flags
Large template/boost-heavy TUs (e.g. asyncrpcoperation.cpp) exceed the standard
PE/COFF ~32k-section limit under mingw-w64, which makes GNU ld emit
"dangerous relocation" on .pdata and crash (SIGSEGV) at link. The bigobj COFF
variant lifts that limit; this is the same flag Bitcoin Core sets for its mingw
host. Fixes the Windows daemon cross-compile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 16:56:13 -05:00
d0657d38b4 Merge dev into dragonx: DragonX rebrand + security/consensus hardening + IBD speedups
# Conflicts:
#	contrib/init/dragonxd.conf
#	contrib/init/dragonxd.init
#	contrib/init/dragonxd.openrc
#	contrib/init/dragonxd.openrcconf
#	contrib/init/dragonxd.service
2026-07-21 18:58:33 -05:00
8976e020e9 packaging: don't fail the .deb build when optional lintian is absent
build-debian-package.sh warns at startup that lintian is optional, but then
called `lintian -i ...` unconditionally at the end. Under `set -e` that aborted
with exit 127 on hosts without lintian — after the .deb had already been built.
Guard the call with `command -v lintian` so the build exits 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 16:04:08 -05:00
9c715f68eb depends: fix libsodium build breaking on git.savannah.gnu.org 502
libsodium's autogen.sh fetches config.sub/config.guess from git.savannah.gnu.org
gitweb, which is frequently down (currently returns 502). curl saved the HTML
error page over config.sub, so libsodium's configure died with
"cannot run /bin/bash ./build-aux/config.sub" and the whole build failed.

autoreconf -ivf (run earlier in autogen.sh) already installs valid config.sub/
config.guess from the build host, so set DO_NOT_UPDATE_CONFIG_SCRIPTS=1 (the
script's own opt-out) to skip the fragile download. Validated: the full build
now completes and produces working dragonxd/dragonx-cli/dragonx-tx.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 16:02:04 -05:00
e3247d946e cleanup: rebrand residual user-facing "HUSH" strings to DragonX
Sweeps the leftover coin-name strings in RPC help text, RPC output, and log
messages that the currency-unit change didn't cover:

- RPC help: "mining reward amount in HUSH" -> DRAGONX (mining.cpp x2);
  "at least minbal HUSH" -> DRAGONX (rpcwallet.cpp); "the HUSH address" /
  "(string) HUSH address" -> DragonX (rawtransaction.cpp)
- RPC output: the SMART_CHAIN_SYMBOL[0]==0 ? "HUSH" : SYMBOL coin-name fallback
  (crosschain/misc/mining/blockchain) -> "DRAGONX"; the notarizations JSON key
  make_pair("HUSH", ...) -> "DRAGONX"
- Logs: "HUSH blocktime changing", "stopping HUSH HTTP/REST/RPC",
  "HUSH raw magic=" -> DragonX

Left untouched (verified): the 82 "HUSH3"/ishush3 chain-symbol consensus checks;
hush_globals.h CURRENCIES[] price-oracle basket (internal lookup, dead feature
on DragonX); hush.h notarization debug printf; a commented-out cout in main.cpp.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 15:37:57 -05:00
ffb753057a cleanup: rebrand currency unit, depends mirrors, seeds; drop Hush-history files
Follow-up to the doc rebrand, addressing the previously out-of-scope legacy:

- Currency unit: strCurrencyUnits (chainparams.cpp) and CURRENCY_UNIT
  (amount.cpp) "HUSH" -> "DRAGONX". Both are display-only (RPC help + metrics);
  no logic comparisons, verified.
- depends mirrors: libsodium/boost/utfcpp fetched from git.hush.is/attachments;
  repointed to canonical upstream (GitHub release / archives.boost.io / GitHub
  tag) with the existing sha256 hashes verified to match those sources.
- Seeds: nodes_main.txt now lists the five node[1-5].dragonx.is IPs (DNS-resolved)
  instead of Hush nodes; regenerated src/chainparamsseeds.h (was compiling Hush
  seed IPs as the fixed fallback); generate-seeds.py header now says DragonX;
  hush_seed_nodes.txt updated to DragonX seeds.
- Deleted Hush-history / wrong-for-DragonX files: contrib/snapshot/ (block-500000
  Hush airdrop, ~10MB), notary_seeds.txt (Hush notaries; DragonX isn't notarized),
  and the Hush emission scripts hush_supply, hush_supply_old, hush_halvings,
  hush_block_subsidy_per_halving (hardcode Hush's 340000/12.5 economics).

Kept: hush_scanner (engine invoked by dragonx_scanner) and the "The Hush
developers" copyright headers (lineage credit).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 14:13:31 -05:00
46693a355a docs: rebrand documentation, packaging, and helper scripts to DragonX
The docs/packaging were largely un-rebranded Hush3 content, with several
docs stating facts that are wrong for DragonX. This rewrites them against
the verified DragonX source state.

Corrections (not just branding):
- PoW: RandomX (CPU), not Equihash/ASIC — README, overview.md, randomx.md
- Privacy: private from genesis (ac_private=1, Sapling@height1), not "as of
  block 340000" — overview.md, payment-api.md
- Removed the false "coinbase must be shielded" consensus claim
  (shield-coinbase.md, payment-api.md); coinbase is directly spendable
- Fixed default fee 0.0001 (was 0.0010000, 10x); stratum port 22769 (was 19031)
- datadir ~/.hush/DRAGONX, DRAGONX.conf, dragonxd/dragonx-cli/dragonx-tx,
  git.dragonx.is throughout; branch model dev->dragonx
- Softened the inherited dPoW reorg claim (no live DragonX notary infra)

Packaging: fix build-debian-package.sh + gen-manpages.sh to use the dragonx
binaries/manpages; rename bash-completions to dragonx*; drop hush-arrakis-chain
from the package. Keep /usr/share/hush (hardcoded in the binary for params).

Also: README links/logo, ObsidianDragon + SilentDragonXAndroid wallets,
networking/init/dev-process/contrib/util rebrand, and leftover helper scripts.
Delete legacy duplicates (hushd.* init/service, HUSH3.conf examples,
OLD_WALLETS.md, hsc.md) and rename hush-uri.bat -> dragonx-uri.bat.

Out of scope (noted, not changed): historical changelog/copyright, the Hush
mainnet airdrop snapshot, seed data files, depends/ source mirrors, and the
in-code strCurrencyUnits="HUSH".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 13:59:06 -05:00
bf3c33c53a revert(net): remove header-accept RandomX check; keep nMinimumChainWork + #8
An adversarial re-review found the header-accept RandomX check (b9fdc7981 +
7e9b2c661 header-PoW + d2124a303 defer) to be a persistent source of
consensus-liveness bugs: it derives the RandomX key from the ACTIVE chain
(hush_chainactive), the wrong branch for reorg/side-branch/catch-up headers, so
it repeatedly false-rejected validly-mined headers and DoS(100)-hard-banned
honest peers (IBD-tail catch-up and deep-reorg cases); the defer fix and an
extend-tip fix each addressed one case while leaving/creating others (an
extend-tip variant re-opened an unbounded post-IBD side-branch flood). It only
mitigated a low-harm resource DoS -- forged headers bloat mapBlockIndex memory/
disk but are never SELECTED (nMinimumChainWork) and the full RandomX + target
check still runs at block-connect. Revert to fCheckPOW=0 at header-accept
(original behavior). A comment in AcceptBlockHeader records that any re-attempt
must derive the key from the header's OWN ancestry (pindexPrev->GetAncestor),
never the active chain.

Also hardens two issues the same review found:
- #8 IBD header cap now bounds against the VALIDATED chainActive.Height()
  (attacker-hard) instead of pindexBestHeader, which a forward-extending flood
  advanced in lockstep, defeating the cap.
- opreturn_burn only emits a change output above the dust threshold; a sub-dust
  change made the returned tx non-standard/unrelayable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 20:24:45 -05:00
5951ee118a fix(net): cap per-peer headers during IBD (header-flood DoS)
Audit #8. The HEADERS handler accepted unbounded headers per peer with no
cumulative cap; during IBD (fCheckPOW=0) a peer could flood cost-free PoW-less
headers into mapBlockIndex/leveldb (never selected -- nMinimumChainWork gates
that -- but still memory/disk growth). Add a per-peer nHeadersProcessed counter
in CNodeState; while IsInitialBlockDownload(), if one peer exceeds
2*max(pindexBestHeader height, checkpoint height) + 200000 headers,
Misbehaving(100) and drop it. The cap is ~2x the chain length, so honest sync
never approaches it; inert post-IBD (the RandomX header check handles forged
headers there).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 18:54:35 -05:00
d2124a3038 fix(pow): defer RandomX header check when key block not yet connected
Follow-on to the post-IBD header-PoW verification (b9fdc7981 + 7e9b2c661).
CheckRandomXSolution derives the RandomX key from the block at
keyHeight = ((height-lag)/interval)*interval, looked up on the ACTIVE chain
(hush_chainactive), so that block must be CONNECTED. When a post-IBD node's
block tip lags the header tip by more than ~one RandomX interval -- the normal
IBD tail, or any node catching up -- the key block is not connected yet, so
GetRandomXKey returns empty. The old code returned an error, making
CheckBlockHeader DoS(100)-ban the honest peer that sent a perfectly valid tip
header we simply could not verify yet.

Observed live: a node finishing a mainnet reindex banned the pool box + seeds
and stalled ~2000 blocks short of the tip. Fix: on an empty key, DEFER (return
true) instead of error -- the header is fully RandomX-verified at block-connect,
where the key block is always connected (blocks connect in order,
keyHeight <= height-lag < the connected tip). Flood protection is preserved for
synced nodes (key present -> real check) and bounded during catch-up by the
per-peer IBD header cap + nMinimumChainWork.

Validated on the live 3.14M-block chain: the affected node caught up the full
~2135-block gap to the tip with zero peer bans (was stalled + banned before).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 18:54:35 -05:00
b5050d06c0 fix(wallet): opreturn_burn return change + widen txfee to CAmount
#10 (HIGH) opreturn_burn selected UTXOs for nAmount+txfee but pushed only the
burn vout and returned - so the entire selected-input surplus was silently paid
as miner fee (e.g. a 500-coin UTXO burning 10 lost ~490). Push a change output
for (inputs - nAmount - txfee). Also widen the int32_t txfee (which truncated
large CAmount fees) to CAmount and MoneyRange-validate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:21:28 -05:00
a520441e3a fix(rpc): guard z_validateaddress against null pwalletMain under -disablewallet
#11 (HIGH) z_validateaddress locked LOCK2(cs_main, pwalletMain->cs_wallet) with
no availability guard; under -disablewallet pwalletMain is NULL, so the member
deref SIGSEGVs the daemon (execute() only catches std::exception). Use the
null-safe LOCK2 idiom already used by sibling RPCs so validation still works
without a wallet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:21:28 -05:00
11704e6023 fix(nspv): add missing length lower-bounds before request/vopret reads
nSPV handlers (gated behind non-default -nspv_msg) read request[1]/vopret[1]
before confirming the peer sent >=2 bytes:

#6 (MEDIUM) NSPV_UTXOS/NSPV_TXIDS evaluated request[1] whenever len<69 (incl
len==1); the 4351d5b73 value-clamp left this lower bound open. The TXIDS/MEMPOOL
else-branch debug prints also read request[1] unconditionally. Add len>=2 guards
/ drop request[1] from the prints.

#7 (LOW) NSPV_MEMPOOL_CCEVALCODE read vopret[1] on a possibly-1-byte vector.
Guard with vopret.size()>=2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:21:28 -05:00
7e9b2c6615 fix(net): verify RandomX at correct height in AcceptBlockHeader + cap locator
header-pow: AcceptBlockHeader passed the caller's reused *ppindex (and a height
derived from it, ==0 for a new header) to CheckBlockHeader instead of the
header's own local pindex + real height. Post-IBD this made
RandomXValidationRequired(0) false, so CheckRandomXSolution returned true WITHOUT
verifying (and the fRandomXVerified short-circuit could fire on an unverified
header) - silently defeating the header-flood PoW gate from b9fdc7981. Resolve
pindexPrev up-front, pass real height (parent+1) and the local (NULL) pindex so
the post-IBD RandomX check actually runs; IBD stays fast (fCheckPOW=0).
Stability-tested: 303 valid headers accepted across a 4-node RandomX net,
0 false rejects / bans.

#9 (MEDIUM) GETBLOCKS/GETHEADERS deserialized an unbounded CBlockLocator.vHave
(~130k hashes) and scanned it linearly under cs_main with no ban - a
message-thread liveness DoS. Add MAX_LOCATOR_SZ=101 + Misbehaving, matching the
adjacent vInv/headers caps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:21:28 -05:00
fc06a43dd7 fix(consensus): bound OP_RETURN opretlen + clamp notary pubkeys array
Defensive-audit findings (adversarially verified + fleet stability-tested):

#4 (CRITICAL) hush_voutupdate trusted an attacker-decoded OP_RETURN length
(opretlen, up to 65535 via OP_PUSHDATA2) with no check against the real script
length, driving up to ~64KB out-of-bounds reads through hush_stateupdate ->
hush_eventadd_opreturn -> hush_kvupdate (persisted to disk, leaked via kvsearch
RPC, reliable crash on block connect). Reject any opret claiming more bytes than
remain in the script, at the single taint source.

#5 (HIGH) notary-ratification loop did memcpy(pubkeys[numvalid++],..) into a
fixed uint8_t[64][33] with no bound; >64 crafted vouts smashed the stack. Clamp
numvalid < 64.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 11:21:28 -05:00
ddf6a35680 Rebrand cleanups: getpeerinfo help example + 1.0.3 debian changelog entry
net.cpp: getpeerinfo help address example 18030->21768 and 'Hush server'->'DragonX server'. debian/changelog: prepend 1.0.3 release entry summarizing IBD speedups, witness fix, bulk streaming, seed phrases, assumeutxo removal. NOTE net.cpp change needs a daemon rebuild to surface in runtime RPC help. Staged on 176; not pushed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 08:07:23 +02:00
9cb6424799 Fix dragonx-cli -rpcport help default: 18030 (hush) -> 21769 (DragonX)
The -rpcport help string in bitcoin-cli.cpp hardcoded hush's 18030; the actual default (BaseParams().RPCPort()) is DragonX's 21769, so this was misleading help text only (the CLI already connects to 21769). Set to 21769 and regenerated doc/man/dragonx-cli.1 from the rebuilt binary. NOTE: a separate hush 18030 leftover remains in src/rpc/net.cpp:357 (getpeerinfo help example address) - daemon RPC help, out of scope here. Staged on 176; not pushed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 08:07:23 +02:00
1c6f64b87e Harvest DragonX packaging + legal artifacts from compliant-rebrand
Legal: correct GPLv3 LICENSE (fixes garbled 'GENERAL GENERAL'), AUTHORS DragonX attribution, COPYING. Packaging: man pages REGENERATED from the 1.0.3 binaries via help2man (dragonxd/dragonx-cli/dragonx-tx.1 -> v1.0.3, correct dates), wired into doc/man/Makefile.am (dist_man1_MANS), orphaned hush*.1 removed. Init/openrc/systemd scripts, Debian packaging (control/changelog/copyright rebranded hush->dragonx + install stubs), example confs taken from origin/compliant-rebrand (c05134e77). REMAINING follow-ups: (1) debian/changelog still tops at 1.0.0 - add a 1.0.3 entry; (2) dragonx-cli --help hardcodes rpcport default 18030 (hush) - fix the HelpMessage string in source then regen. Staged on 176 for review; not pushed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 08:07:23 +02:00
116 changed files with 1594 additions and 311454 deletions

View File

@@ -1,8 +1,8 @@
<!--- Remove text and sections that do not apply --> <!--- Remove text and sections that do not apply -->
This issue tracker is only for technical issues related to hushd This issue tracker is only for technical issues related to dragonxd
General Hush questions and/or support requests and are best directed to [Telegram](https://hush.is/telegram_support) General DragonX questions and/or support requests are best directed to [Telegram](https://dragonx.is/tg) or [Matrix](https://dragonx.is/matrix).
### Describe the issue ### Describe the issue
@@ -23,9 +23,9 @@ Tell us what should happen
Tell us what happens instead including any noticable error output (any messages displayed on-screen when e.g. a crash occurred) Tell us what happens instead including any noticable error output (any messages displayed on-screen when e.g. a crash occurred)
### The version of Hush you were using: ### The version of DragonX you were using:
Run `hushd --version` to find out Run `dragonxd --version` to find out
### Machine specs: ### Machine specs:
- OS name + version: - OS name + version:
@@ -38,7 +38,7 @@ Run `hushd --version` to find out
### Any extra information that might be useful in the debugging process. ### Any extra information that might be useful in the debugging process.
This includes the relevant contents of `~/.hush/HUSH3/debug.log` or `~/.komodo/HUSH3/debug.log` if you have a legacy install. You can paste raw text, attach the file directly in the issue or link to the text via a pastebin type site. This includes the relevant contents of `~/.hush/DRAGONX/debug.log`. You can paste raw text, attach the file directly in the issue or link to the text via a pastebin type site.
Please also include any non-standard things you did during compilation (extra flags, dependency version changes etc.) if applicable. Please also include any non-standard things you did during compilation (extra flags, dependency version changes etc.) if applicable.
Beware that usernames and IP addresses and other metadata is definitely in this log file! Beware that usernames and IP addresses and other metadata is definitely in this log file!

237
README.md
View File

@@ -1,31 +1,51 @@
<p align="center"> <p align="center">
<img src="doc/hush/hush0.png"> <img src="doc/dragonx/logo_dragonx_128.png" alt="DragonX" width="128">
</p> </p>
<h1 align="center">DragonX</h1>
<p align="center"><b>A fully-private, RandomX CPU-mineable cryptocurrency.</b></p>
<h3> <h3 align="center">
| Introduction | Install | Compile | FAQ | Documentation | | Introduction | Build | Run | Mine |
| :---: | :---: | :---: | :---: | :---: | | :---: | :---: | :---: | :---: |
| [What is Hush?](#what-is-hush) | [Windows 10 - Video Tutorial](#install-on-windows-10) | [Build on Debian or Ubuntu](#build-on-debian-or-ubuntu) | [Where can I buy Hush?](#where-can-i-buy-hush) | [Cross compiling Windows binaries](#windows-cross-compiled-on-linux) | [What is DragonX?](#what-is-dragonx) | [Build from source](#build-from-source) | [Run a node](#running-a-node) | [CPU mining](#cpu-mining-randomx) |
| [Why not GitHub?](#banned-by-github) | [Build on Mac](#build-on-mac) | [Build on Arch](#build-on-arch) | [Can I mine with CPU or GPU?](#can-i-mine-with-cpu-or-gpu) | [Hush DevOps for pools and CEXs](https://git.hush.is/hush/docs/src/branch/master/advanced/devops.md) | [Key facts](#key-facts) | [Install a release](#installing-dragonx-binaries) | [Fastest sync](#fastest-way-to-sync-bootstrap) | [Wallets](#wallets) |
| [What is HushChat?](#what-is-hushchat) | [Debian and Ubuntu](#installing-hush-binaries) | [Build on Fedora](#build-on-fedora) | [Claiming funds from old Hush wallets](https://git.hush.is/hush/hush3/src/branch/master/doc/OLD_WALLETS.md) | [Earn Hush bounty](#earn-hush-bounty)
| [What is SilentDagon?](#what-is-silentdagon) | [Raspberry Pi](#install-on-arm-architecture) | [Build on Ubuntu 16.04 or older](#building-on-ubuntu-16-04-and-older-systems) | [Where can I spend Hush?](#where-can-i-spend-hush) | [Cross compiling from amd64 to arm64](https://git.hush.is/hush/docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md)
</h3> </h3>
# What is Hush? # What is DragonX?
Hush implements Extreme Privacy via blockchain tech. We have our own DragonX implements extreme privacy via blockchain technology. It is **private from
genesis block. We are not a chain fork (copy) of another coin. We are based on genesis**: every ordinary transaction is shielded (`z2z`), so your transaction metadata
Bitcoin code, with sophisticated zero-knowledge mathematics added for privacy. stays private. DragonX is based on Bitcoin code with Zcash's zero-knowledge Sapling
This keeps your transaction metadata private! cryptography, and its defining feature is **RandomX Proof-of-Work — it is mined with a
CPU**, not ASICs or GPUs.
# What is this repository? DragonX has its own genesis block. Its lineage is Bitcoin → Zcash → Komodo → Hush → DragonX;
it is a fork of the [Hush](https://git.hush.is/hush/hush3) full node, with the Proof-of-Work
changed from Equihash to RandomX and privacy enforced from the very first block.
This software is the Hush node and command-line client. It downloads and stores This software is the DragonX full node and command-line client. It downloads and stores the
the entire history of Hush transactions; depending on the speed of your entire history of DragonX transactions; depending on your computer and network connection
computer and network connection, it will likely take a few hours at least, but this can take a while, so most users start from the [bootstrap snapshot](#fastest-way-to-sync-bootstrap).
some people report full nodes syncing in less than 1.5 hours.
**DragonX is experimental software.** Use at your own risk, just like Bitcoin.
# Key facts
| | |
| --- | --- |
| Ticker | **DRAGONX** |
| Proof-of-Work | **RandomX** (CPU-mineable) |
| Privacy | fully private from genesis (`ac_private=1`, Sapling active at height 1) |
| Block time | 36 seconds |
| Block reward | 3 DRAGONX, halving every 3,500,000 blocks |
| Max block size | 4 MB |
| RPC port | 21769 |
| P2P port | 18030 |
| Data directory | `~/.hush/DRAGONX` (Linux) |
| Config file | `DRAGONX.conf` |
| Binaries | `dragonxd`, `dragonx-cli`, `dragonx-tx` |
# Fastest way to sync (bootstrap) # Fastest way to sync (bootstrap)
@@ -42,86 +62,42 @@ checksums and (once a release key is published) its cryptographic signature, the
you near the chain tip. If you prefer to sync from the network instead, a larger you near the chain tip. If you prefer to sync from the network instead, a larger
`-dbcache` (e.g. `-dbcache=2048`) noticeably speeds up the initial block download. `-dbcache` (e.g. `-dbcache=2048`) noticeably speeds up the initial block download.
# Banned by GitHub # Build from source
In working on this release, Duke Leto was suspended from Github, which gave Hush developers Building uses 3 build processes by default; you need ~2GB of RAM for each.
the impetus to completely leave that racist and censorship-loving platform. Hush now has it's own [git.hush.is](https://git.hush.is/hush) Gitea instance,
because we will not be silenced by Microsoft. All Hush software will be released from git.hush.is and hush.is, downloads from any other
domains should be assumed to be backdoored.
**Hush is unfinished and highly experimental.** Use at your own risk! Just like Bitcoin. ### Debian or Ubuntu
# Build on Debian or Ubuntu
```sh ```sh
# install build dependencies
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib \ sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git zlib1g-dev wget \ autoconf libtool ncurses-dev unzip git zlib1g-dev wget \
bsdmainutils automake curl unzip nano libsodium-dev cmake bsdmainutils automake curl unzip nano libsodium-dev cmake
# clone git repo git clone https://git.dragonx.is/DragonX/dragonx
git clone https://git.hush.is/hush/hush3 cd dragonx
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3 ./build.sh -j3
``` ```
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-linux
# Build on Arch ### Arch
```sh ```sh
# install build dependencies
sudo pacman -S gcc libsodium lib32-zlib unzip wget git python rust curl autoconf cmake sudo pacman -S gcc libsodium lib32-zlib unzip wget git python rust curl autoconf cmake
# clone git repo git clone https://git.dragonx.is/DragonX/dragonx
git clone https://git.hush.is/hush/hush3 cd dragonx
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3 ./build.sh -j3
``` ```
# Build on Fedora ### Fedora
```sh ```sh
# install build dependencies
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libtool ncurses-devel patch -y sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libtool ncurses-devel patch -y
# clone git repo git clone https://git.dragonx.is/DragonX/dragonx
git clone https://git.hush.is/hush/hush3 cd dragonx
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3 ./build.sh -j3
``` ```
# Install on Windows 10 ### macOS
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-windows Install Xcode Command Line Tools and [Homebrew](https://brew.sh/), then:
# Install on ARM Architecture
Use this if you have a Raspberry Pi or similar computer. Currently, any ARMv7 machine will not be able to build this repo, because the underlying tech (zcash and the zksnark library) do not support that instruction set. This also means that old RaspberryPi devices will not work, unless they have a newer ARMv8-based Raspberry Pi. Raspberry Pi 4 and newer are known to work.
1. [Download the latest Debian package with the AARCH64 designation from the releases page](https://git.hush.is/hush/hush3/releases).
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-aarch64.deb`.
1. Run with: `hushd`.
If you would like to compile this for ARM yourself, then please refer to the [Cross compiling a Hush full node daemon from AMD64 to ARM64(aarch64) CPU architecture with Docker](https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md) documentation to do that.
# Building On Ubuntu 16.04 and older systems
Some older compilers may not be able to compile modern code, such as gcc 5.4 which comes with Ubuntu 16.04 by default. Here is how to install gcc 7 on Ubuntu 16.04. Run these commands as root:
```
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt update && \
apt-get install -y gcc-7 g++-7 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60
```
# Build on Mac
Install Xcode Command Line Tools and [Homebrew](https://brew.sh/), then install dependencies:
```sh ```sh
xcode-select --install xcode-select --install
@@ -131,10 +107,8 @@ brew install gcc autoconf automake pkgconf libtool cmake curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env" source "$HOME/.cargo/env"
# clone git repo git clone https://git.dragonx.is/DragonX/dragonx
git clone https://git.hush.is/hush/hush3 cd dragonx
cd hush3
# Build (uses 3 build processes, you need 2GB of RAM for each)
# Make sure libtool gnubin and cargo are on PATH # Make sure libtool gnubin and cargo are on PATH
export PATH="$HOME/.cargo/bin:/usr/local/opt/libtool/libexec/gnubin:$PATH" export PATH="$HOME/.cargo/bin:/usr/local/opt/libtool/libexec/gnubin:$PATH"
./build.sh -j3 ./build.sh -j3
@@ -147,77 +121,92 @@ export PATH="$HOME/.cargo/bin:/usr/local/opt/libtool/libexec/gnubin:$PATH"
./build.sh --mac-release -j$(sysctl -n hw.ncpu) ./build.sh --mac-release -j$(sysctl -n hw.ncpu)
``` ```
# Installing Hush binaries ### Windows (cross-compiled on Linux)
1. [Download the release](https://git.hush.is/hush/hush3/releases) with a .deb file extension. ```sh
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-amd64.deb`.
1. Run with: `hushd`.
# Windows (cross-compiled on Linux)
Get dependencies:
```ssh
sudo apt-get install \ sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib libdb++-dev \ build-essential pkg-config libc6-dev m4 g++-multilib libdb++-dev \
autoconf libtool ncurses-dev unzip git zip \ autoconf libtool ncurses-dev unzip git zip \
zlib1g-dev wget bsdmainutils automake mingw-w64 cmake libsodium-dev zlib1g-dev wget bsdmainutils automake mingw-w64 cmake libsodium-dev
git clone https://git.dragonx.is/DragonX/dragonx
cd dragonx
./util/build-win.sh -j$(nproc)
``` ```
Downloading Git source repo, building and running Hush: ### ARM (Raspberry Pi)
Any ARMv7 machine cannot build this repo because the underlying zk-SNARK library does not
support that instruction set. You need an ARMv8-based board (Raspberry Pi 4 or newer). Either
install an `aarch64` release package (see below) or cross-compile from amd64.
# Installing DragonX binaries
1. [Download a release](https://git.dragonx.is/DragonX/dragonx/releases) with a `.deb` extension.
1. Install it, substituting the version you downloaded:
`sudo dpkg -i dragonx-VERSION-amd64.deb` (or `-aarch64.deb` on ARM).
1. Run with: `dragonxd`.
# Running a node
Start the daemon:
```sh ```sh
# pull ./src/dragonxd
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
./util/build-win.sh -j$(nproc)
# Run a HUSH node
./src/hushd
``` ```
# Official Explorers It stores data in `~/.hush/DRAGONX` and reads `~/.hush/DRAGONX/DRAGONX.conf`. Query it with
`./src/dragonx-cli`, for example:
The links for the Official Hush explorers: ```sh
* [explorer.hush.is](https://explorer.hush.is) ./src/dragonx-cli getinfo
```
# What is SilentDragon? To run DragonX as a background service, see [doc/dragonxd-systemd.md](doc/dragonxd-systemd.md).
* [SilentDragon](https://git.hush.is/hush/SilentDragon) is a desktop wallet for HUSH full node.<br> # CPU mining (RandomX)
* [SilentDragonLite](https://git.hush.is/hush/SilentDragonLite) is a desktop wallet that does not require you to download the full blockchain.
* [SilentDragonAndroid](https://git.hush.is/hush/SilentDragonAndroid) is a wallet for Android devices.
* [SilentDragonPaper](https://git.hush.is/hush/SilentDragonPaper) is a paper wallet generator that can be run completely offline.
# What is HushChat? DragonX is CPU-mineable via RandomX (the same algorithm family as Monero); ASICs and GPUs do
not apply. To mine with your node, enable generation and choose how many threads to use:
HushChat is a protocol inspired by the design of Signal Protocol, it uses many of the same cryptography and ideas, but does not actually use any code from Signal. Signal requires phone numbers and is a centralized service. HushChat is completely anonymous and decentralized and requires absolutely no metadata be given to any centralized third parties. ```sh
# mine with 4 CPU threads
./src/dragonxd -gen=1 -genproclimit=4
```
# Can I mine with CPU or GPU? or add to `DRAGONX.conf`:
Hush cannot be efficiently mined with CPU or GPU, only ASIC mining is recommended. HUSH uses Equihash (200,9) algo, as does Zcash, Horizen or Komodo. ```
gen=1
genproclimit=4
```
# Where can I buy Hush? Mining rewards arrive as transparent coinbase, which is directly spendable; you can optionally
move it into the shielded pool with `z_shieldcoinbase` (see
[doc/shield-coinbase.md](doc/shield-coinbase.md)). For more on the algorithm and its tuning
options, see [doc/randomx.md](doc/randomx.md).
1. https://nonkyc.io/market/HUSH_BTC # Wallets
1. https://tradeogre.com/exchange/BTC-HUSH
# Where can I spend Hush? The DragonX full node includes a built-in wallet, managed via `dragonx-cli` (see
[doc/wallet-backup.md](doc/wallet-backup.md) and [doc/seed-phrase.md](doc/seed-phrase.md)).
AgoraX market: https://agorax.is Graphical and mobile wallets:
# Earn Hush bounty * **[ObsidianDragon](https://git.dragonx.is/DragonX/ObsidianDragon/releases)** — desktop wallet, available in both full-node and light-wallet modes.
* **[SilentDragonXAndroid](https://git.dragonx.is/DragonX/SilentDragonXAndroid/releases)** — wallet for Android devices.
Developers can earn bounty by fixing bugs or solving feature requests listed in `Issues->Label`: DragonX light and mobile wallets use BIP39 seed phrases that are compatible with the full
- https://git.hush.is/hush/hush3/issues node — see [doc/seed-phrase.md](doc/seed-phrase.md).
- https://git.hush.is/hush/SilentDragon/issues
- https://git.hush.is/hush/SilentDragonLite/issues
![Logo](doc/hush/earnhush.png "Hush Bounty") # Support and links
# Support and Socials * Website: https://dragonx.is
* Source code: https://git.dragonx.is/DragonX
* Telegram: [https://hush.is/tg](https://hush.is/tg) * Block explorer: https://explorer.dragonx.is
* Matrix: [https://hush.is/matrix](https://hush.is/matrix) * Issues / bounties: https://git.dragonx.is/DragonX/dragonx/issues
* Twitter: [https://hush.is/twitter](https://hush.is/twitter) * Telegram: https://dragonx.is/tg
* PeerTube [https://hush.is/peertube](https://hush.is/peertube) * Matrix: https://dragonx.is/matrix
* Twitter / X: https://twitter.com/DragonXchain
# License # License

View File

@@ -1,16 +1,14 @@
# Hush Contrib # DragonX Contrib
This is mostly very old stuff inherited from Bitcoin and Zcash! This directory contains various supporting tools and scripts. Much of this is
old material inherited from the Bitcoin/Zcash/Komodo/Hush lineage, so not every
script is guaranteed to work. Please fix bugs and report anything you find.
Do not expect all scripts to work! # DragonX Tools
Please fix bugs and report things you find.
# Hush Tools
## block\_time.pl ## block\_time.pl
Estimate when a Hush block will happen. Estimate when a DragonX block will happen.
Example: Example:
@@ -19,65 +17,49 @@ Example:
## gen-zaddrs.pl ## gen-zaddrs.pl
Generate zaddrs in bulk, by default 50 at a time. Prints out a zaddr one per line. Generate zaddrs in bulk, by default 50 at a time. Prints out a zaddr one per line.
Useful on a fully-private chain where shielded addresses are the norm.
Example: Example:
./contrib/gen-zaddrs.pl # generate 50 zaddrs ./contrib/gen-zaddrs.pl # generate 50 zaddrs
./contrib/gen-zaddrs.pl 500 # generate 500 zaddrs ./contrib/gen-zaddrs.pl 500 # generate 500 zaddrs
## Wallet Tools
### [BitRPC](/contrib/bitrpc) ###
Allows for sending of all standard Bitcoin commands via RPC rather than as command line args.
### [SpendFrom](/contrib/spendfrom) ###
Use the raw transactions API to send coins received on a particular
address (or addresses).
## Repository Tools ## Repository Tools
### [Developer tools](/contrib/devtools) ### ### [Verify-Commits](/contrib/verify-commits)
Specific tools for developers working on this repository. Tool to verify that merge commits were signed by a developer.
Contains the script `github-merge.sh` for merging github pull requests securely and signing them using GPG.
### [Verify-Commits](/contrib/verify-commits) ### ### [Linearize](/contrib/linearize)
Tool to verify that every merge commit was signed by a developer using the above `github-merge.sh` script.
### [Linearize](/contrib/linearize) ###
Construct a linear, no-fork, best version of the blockchain. Construct a linear, no-fork, best version of the blockchain.
### [Qos](/contrib/qos) ### ### [Qos](/contrib/qos)
A Linux bash script that sets up traffic control (tc) to limit the outgoing
bandwidth for connections to the DragonX network. This lets you run an
always-on dragonxd instance and have another local dragonxd connect to it and
receive blocks from it.
A Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Bitcoin network. This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. ### [Seeds](/contrib/seeds)
Utility to generate the seed node array that is compiled into the client.
### [Seeds](/contrib/seeds) ###
Utility to generate the pnSeed[] array that is compiled into the client.
## Build Tools and Keys ## Build Tools and Keys
### [Debian](/contrib/debian) ### ### [Debian](/contrib/debian)
Contains files used to package bitcoind/bitcoin-qt Contains files used to package dragonxd for Debian-based Linux systems.
for Debian-based Linux systems. If you compile bitcoind/bitcoin-qt yourself, there are some useful files here.
### [Gitian-descriptors](/contrib/gitian-descriptors) ### ### [Gitian-descriptors](/contrib/gitian-descriptors)
Gavin's notes on getting gitian builds up and running using KVM. Legacy notes on getting gitian builds running. Note that the real DragonX build
path is `./build.sh` together with the `depends/` system; gitian is legacy.
### [Gitian-downloader](/contrib/gitian-downloader) ### [Gitian-downloader](/contrib/gitian-downloader)
Various PGP files of core developers. Various PGP files of developers.
### [MacDeploy](/contrib/macdeploy) ### ### [MacDeploy](/contrib/macdeploy)
Scripts and notes for Mac builds. Scripts and notes for Mac builds.
## Test and Verify Tools ## Test and Verify Tools
### [TestGen](/contrib/testgen) ### ### [TestGen](/contrib/testgen)
Utilities to generate test vectors for the data-driven Bitcoin tests. Utilities to generate test vectors for the data-driven base58 tests.
### [Test Patches](/contrib/test-patches) ### ### [Verify SF Binaries](/contrib/verifysfbinaries)
These patches are applied when the automated pull-tester Legacy SourceForge-era signature verification script (unused for DragonX).
tests each pull and when master is tested using jenkins.
### [Verify SF Binaries](/contrib/verifysfbinaries) ###
This script attempts to download and verify the signature file SHA256SUMS.asc from SourceForge.

View File

@@ -5,7 +5,7 @@
use warnings; use warnings;
use strict; use strict;
my $cli = "./src/hush-cli"; my $cli = "./src/dragonx-cli";
my $coin = shift || ''; my $coin = shift || '';
unless (-e $cli) { unless (-e $cli) {
die "$cli does not exist, aborting"; die "$cli does not exist, aborting";

View File

@@ -8,17 +8,17 @@ use strict;
# Given a block height, estimate when it will happen # Given a block height, estimate when it will happen
my $block = shift || die "Usage: $0 123"; my $block = shift || die "Usage: $0 123";
my $coin = shift || ''; my $coin = shift || '';
my $hush = "./src/hush-cli"; my $cli = "./src/dragonx-cli";
unless (-e $hush) { unless (-e $cli) {
die "$hush does not exist, aborting"; die "$cli does not exist, aborting";
} }
if ($coin) { if ($coin) {
$hush .= " -ac_name=$coin"; $cli .= " -ac_name=$coin";
} }
my $blockcount = qx{$hush getblockcount}; my $blockcount = qx{$cli getblockcount};
unless ($blockcount = int($blockcount)) { unless ($blockcount = int($blockcount)) {
print "Invalid response from $hush\n"; print "Invalid response from $cli\n";
exit 1; exit 1;
} }
@@ -28,7 +28,7 @@ if ($block <= $blockcount) {
my $diff = $block - $blockcount; my $diff = $block - $blockcount;
# TODO: support custom blocktimes # TODO: support custom blocktimes
# assumes HACs use default blocktime of 60s # assumes HACs use default blocktime of 60s
my $minpb = $coin ? 1 : 1.25; # 75s in minutes for HUSH3 my $minpb = $coin ? 1 : 0.6; # 36s in minutes for DragonX
my $minutes = $diff*$minpb; my $minutes = $diff*$minpb;
my $seconds = $minutes*60; my $seconds = $minutes*60;
my $now = time; my $now = time;
@@ -38,7 +38,7 @@ if ($block <= $blockcount) {
if ($coin) { if ($coin) {
print "$coin Block $block will happen at roughly:\n"; print "$coin Block $block will happen at roughly:\n";
} else { } else {
print "Hush Block $block will happen at roughly:\n"; print "DragonX Block $block will happen at roughly:\n";
} }
print "$ldate Eastern # $then\n"; print "$ldate Eastern # $then\n";
print "$gmdate GMT # $then\n"; print "$gmdate GMT # $then\n";

View File

@@ -11,7 +11,7 @@ from hashlib import sha256
# based on https://github.com/KMDLabs/pos64staker/blob/master/stakerlib.py#L89 # based on https://github.com/KMDLabs/pos64staker/blob/master/stakerlib.py#L89
def addr_convert(prefix, address, prefix_bytes): def addr_convert(prefix, address, prefix_bytes):
rmd160_dict = {} rmd160_dict = {}
# ZEC/HUSH/etc have 2 prefix bytes, BTC/KMD only have 1 # ZEC/DRAGONX/etc have 2 prefix bytes, BTC/KMD only have 1
# NOTE: any changes to this code should be verified against https://dexstats.info/addressconverter.php # NOTE: any changes to this code should be verified against https://dexstats.info/addressconverter.php
ripemd = b58decode_check(address).hex()[2*prefix_bytes:] ripemd = b58decode_check(address).hex()[2*prefix_bytes:]
net_byte = prefix + ripemd net_byte = prefix + ripemd
@@ -23,7 +23,7 @@ def addr_convert(prefix, address, prefix_bytes):
return(final.decode()) return(final.decode())
if len(sys.argv) < 2: if len(sys.argv) < 2:
sys.exit('Usage: %s hushv2address' % sys.argv[0]) sys.exit('Usage: %s dragonxv2address' % sys.argv[0])
address = sys.argv[1] address = sys.argv[1]
# convert given address to a KMD address # convert given address to a KMD address

View File

@@ -1,209 +0,0 @@
## HUSH3.conf configuration file. Lines beginning with # are comments.
# Network-related settings:
# Run a regression test network
#regtest=0
# Run a test node (which means you can mine with no peers)
#testnode=1
#set a custom client name/user agent
#clientName=GoldenSandtrout
# Rescan from block height
#rescan=123
# Connect via a SOCKS5 proxy
#proxy=127.0.0.1:9050
# Automatically create Tor hidden service
#listenonion=1
#Use separate SOCKS5 proxy to reach peers via Tor hidden services
#onion=1.2.3.4:9050
# Only connect to nodes in network <net> (ipv4, ipv6, onion or i2p)"));
#onlynet=<net>
#Tor control port to use if onion listening enabled
#torcontrol=127.0.0.1:9051
# Bind to given address and always listen on it. Use [host]:port notation for IPv6
#bind=<addr>
# Bind to given address and allowlist peers connecting to it. Use [host]:port notation for IPv6
#allowbind=<addr>
##############################################################
## Quick Primer on addnode vs connect ##
## Let's say for instance you use addnode=4.2.2.4 ##
## addnode will connect you to and tell you about the ##
## nodes connected to 4.2.2.4. In addition it will tell ##
## the other nodes connected to it that you exist so ##
## they can connect to you. ##
## connect will not do the above when you 'connect' to it. ##
## It will *only* connect you to 4.2.2.4 and no one else.##
## ##
## So if you're behind a firewall, or have other problems ##
## finding nodes, add some using 'addnode'. ##
## ##
## If you want to stay private, use 'connect' to only ##
## connect to "trusted" nodes. ##
## ##
## If you run multiple nodes on a LAN, there's no need for ##
## all of them to open lots of connections. Instead ##
## 'connect' them all to one node that is port forwarded ##
## and has lots of connections. ##
## Thanks goes to [Noodle] on Freenode. ##
##############################################################
# Use as many addnode= settings as you like to connect to specific peers
#addnode=69.164.218.197
#addnode=10.0.0.2:8233
# Alternatively use as many connect= settings as you like to connect ONLY to specific peers
#connect=69.164.218.197
#connect=10.0.0.1:8233
# Listening mode, enabled by default except when 'connect' is being used
#listen=1
# Maximum number of inbound+outbound connections.
#maxconnections=
#
# JSON-RPC options (for controlling a running hushd process)
#
# server=1 tells node to accept JSON-RPC commands (set as default if not specified)
#server=1
# Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.
# This option can be specified multiple times (default: bind to all interfaces)
#rpcbind=<addr>
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
# These will automatically be created for you
#rpcuser=user
#rpcpassword=supersecretpassword
# How many seconds node will wait for a complete RPC HTTP request.
# after the HTTP connection is established.
#rpcclienttimeout=30
# By default, only RPC connections from localhost are allowed.
# Specify as many rpcallowip= settings as you like to allow connections from other hosts,
# either as a single IPv4/IPv6 or with a subnet specification.
# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED,
# because the rpcpassword is transmitted over the network unencrypted and also because anyone
# that can authenticate on the RPC port can steal your keys + take over the account running hushd
#rpcallowip=10.1.1.34/255.255.255.0
#rpcallowip=1.2.3.4/24
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96
# Listen for RPC connections on this TCP port:
#rpcport=1234
# You can use hushd to send commands to hushd
# running on another host using this option:
#rpcconnect=127.0.0.1
# Transaction Fee
# Send transactions as zero-fee transactions if possible (default: 0)
#sendfreetransactions=0
# Create transactions that have enough fees (or priority) so they are likely to # begin confirmation within n blocks (default: 1).
# This setting is overridden by the -paytxfee option.
#txconfirmtarget=n
# Miscellaneous options
# Enable mining at startup
#gen=1
# Set the number of threads to be used for mining (-1 = all cores).
#genproclimit=1
# Specify a different Equihash solver (e.g. "tromp") to try to mine
# faster when gen=1.
#equihashsolver=default
# Pre-generate this many public/private key pairs, so wallet backups will be valid for
# both prior transactions and several dozen future transactions.
#keypool=100
# Pay an optional transaction fee every time you send a tx. Transactions with fees
# are more likely than free transactions to be included in generated blocks, so may
# be validated sooner. This setting does not affect private transactions created with
# 'z_sendmany'.
#paytxfee=0.00
#Rewind the chain to specific block height. This is useful for creating snapshots at a given block height.
#rewind=555
#Stop the chain a specific block height. This is useful for creating snapshots at a given block height.
#stopat=1000000
#Set an address to use as change address for all transactions. This value must be set to a 33 byte pubkey. All mined coins will also be sent to this address.
#pubkey=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392
# Disable clearnet (ipv4 and ipv6) connections to this node
#clearnet=0
# Disable ipv4
#disableipv4=1
# Disable ipv6
#disableipv6=1
# Enable transaction index
#txindex=1
# Enable address index
#addressindex=1
# Enable timestamp index
#timestampindex=1
# Enable spent index
#spentindex=1
# Enable shielded stats index
#zindex=1
# Attempt to salvage a corrupt wallet
# salvagewallet=1
# Mine all blocks to this address (not good for your privacy and not recommended!)
# Disallowed if clearnet=0
# mineraddress=XXX
# Disable wallet
#disablewallet=1
# Allow mining to an address that is not in the current wallet
#minetolocalwallet=0
# Delete all wallet transactions
#zapwallettxes=1
# Enable sapling consolidation
# consolidation=1
# Enable stratum server
# stratum=1
# Run a command each time a new block is seen
# %s in command is replaced by block hash
#blocknotify=/my/awesome/script.sh %s
# Run a command when wallet gets a new tx
# %s in command is replaced with txid
#walletnotify=/my/cool/script.sh %s
# Run a command when tx expires
# %s in command is replaced with txid
#txexpirynotify=/my/elite/script.sh %s
# Execute this commend to send a tx
# %s is replaced with tx hex
#txsend=/send/it.sh %s

View File

@@ -1 +0,0 @@
DEBIAN/examples/HUSH3.conf

View File

@@ -1,3 +0,0 @@
usr/bin/hushd
usr/bin/hush-cli
usr/bin/hush-tx

View File

@@ -1,3 +0,0 @@
DEBIAN/manpages/hush-cli.1
DEBIAN/manpages/hush-tx.1
DEBIAN/manpages/hushd.1

View File

@@ -1,11 +1,11 @@
# bash programmable completion for hush-cli(1) # bash programmable completion for dragonx-cli(1)
# Copyright (c) 2012-2016 The Bitcoin Core developers # Copyright (c) 2012-2016 The Bitcoin Core developers
# Copyright (c) 2018-2020 The Hush developers # Copyright (c) 2018-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying # Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# call $hush-cli for RPC # call $dragonx-cli for RPC
_hush_rpc() { _dragonx_rpc() {
# determine already specified args necessary for RPC # determine already specified args necessary for RPC
local rpcargs=() local rpcargs=()
for i in ${COMP_LINE}; do for i in ${COMP_LINE}; do
@@ -15,25 +15,25 @@ _hush_rpc() {
;; ;;
esac esac
done done
$hush_cli "${rpcargs[@]}" "$@" $dragonx_cli "${rpcargs[@]}" "$@"
} }
# Add wallet accounts to COMPREPLY # Add wallet accounts to COMPREPLY
_hush_accounts() { _dragonx_accounts() {
local accounts local accounts
# Accounts are deprecated in hush # Accounts are deprecated in dragonx
#accounts=$(_hush_rpc listaccounts | awk -F '"' '{ print $2 }') #accounts=$(_dragonx_rpc listaccounts | awk -F '"' '{ print $2 }')
accounts="\\\"\\\"" accounts="\\\"\\\""
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) ) COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$accounts" -- "$cur" ) )
} }
_hush_cli() { _dragonx_cli() {
local cur prev words=() cword local cur prev words=() cword
local hush_cli local dragonx_cli
# save and use original argument to invoke hush-cli for -help, help and RPC # save and use original argument to invoke dragonx-cli for -help, help and RPC
# as hush-cli might not be in $PATH # as dragonx-cli might not be in $PATH
hush_cli="$1" dragonx_cli="$1"
COMPREPLY=() COMPREPLY=()
_get_comp_words_by_ref -n = cur prev words cword _get_comp_words_by_ref -n = cur prev words cword
@@ -63,7 +63,7 @@ _hush_cli() {
if ((cword > 3)); then if ((cword > 3)); then
case ${words[cword-3]} in case ${words[cword-3]} in
addmultisigaddress) addmultisigaddress)
_hush_accounts _dragonx_accounts
return 0 return 0
;; ;;
getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock) getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock)
@@ -92,7 +92,7 @@ _hush_cli() {
return 0 return 0
;; ;;
move|setaccount) move|setaccount)
_hush_accounts _dragonx_accounts
return 0 return 0
;; ;;
esac esac
@@ -108,7 +108,7 @@ _hush_cli() {
return 0 return 0
;; ;;
getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany) getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany)
_hush_accounts _dragonx_accounts
return 0 return 0
;; ;;
esac esac
@@ -132,12 +132,12 @@ _hush_cli() {
# only parse -help if senseful # only parse -help if senseful
if [[ -z "$cur" || "$cur" =~ ^- ]]; then if [[ -z "$cur" || "$cur" =~ ^- ]]; then
helpopts=$($hush_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) helpopts=$($dragonx_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' )
fi fi
# only parse help if senseful # only parse help if senseful
if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then if [[ -z "$cur" || "$cur" =~ ^[a-z] ]]; then
commands=$(_hush_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }') commands=$(_dragonx_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }')
fi fi
COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$helpopts $commands" -- "$cur" ) )
@@ -150,7 +150,7 @@ _hush_cli() {
;; ;;
esac esac
} && } &&
complete -F _hush_cli hush-cli complete -F _dragonx_cli dragonx-cli
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@@ -1,15 +1,15 @@
# bash programmable completion for hush-tx(1) # bash programmable completion for dragonx-tx(1)
# Copyright (c) 2016 The Bitcoin Core developers # Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying # Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
_hush_tx() { _dragonx_tx() {
local cur prev words=() cword local cur prev words=() cword
local hush_tx local dragonx_tx
# save and use original argument to invoke hush-tx for -help # save and use original argument to invoke dragonx-tx for -help
# it might not be in $PATH # it might not be in $PATH
hush_tx="$1" dragonx_tx="$1"
COMPREPLY=() COMPREPLY=()
_get_comp_words_by_ref -n =: cur prev words cword _get_comp_words_by_ref -n =: cur prev words cword
@@ -27,15 +27,15 @@ _hush_tx() {
if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then
# only options (or an uncompletable hex-string) allowed # only options (or an uncompletable hex-string) allowed
# parse hush-tx -help for options # parse dragonx-tx -help for options
local helpopts local helpopts
helpopts=$($hush_tx -help | sed -e '/^ -/ p' -e d ) helpopts=$($dragonx_tx -help | sed -e '/^ -/ p' -e d )
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) )
else else
# only commands are allowed # only commands are allowed
# parse -help for commands # parse -help for commands
local helpcmds local helpcmds
helpcmds=$($hush_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^ [a-z]/ p' -e d ) helpcmds=$($dragonx_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^ [a-z]/ p' -e d )
COMPREPLY=( $( compgen -W "$helpcmds" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$helpcmds" -- "$cur" ) )
fi fi
@@ -46,7 +46,7 @@ _hush_tx() {
return 0 return 0
} && } &&
complete -F _hush_tx hush-tx complete -F _dragonx_tx dragonx-tx
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@@ -8,8 +8,8 @@ Exit
:RegExport :RegExport
Set RegFile="%Temp%\~etsaclu.tmp" Set RegFile="%Temp%\~etsaclu.tmp"
Set "hush=%~dp0" Set "dragonx=%~dp0"
set "hush=%hush:\=\\%" set "dragonx=%dragonx:\=\\%"
If Exist %RegFile% ( If Exist %RegFile% (
Attrib -R -S -H %RegFile% & Del /F /Q %RegFile% Attrib -R -S -H %RegFile% & Del /F /Q %RegFile%
@@ -17,19 +17,19 @@ If Exist %RegFile% (
) )
> %RegFile% Echo Windows Registry Editor Version 5.00 > %RegFile% Echo Windows Registry Editor Version 5.00
>> %RegFile% Echo. >> %RegFile% Echo.
>> %RegFile% Echo [HKEY_CLASSES_ROOT\hush] >> %RegFile% Echo [HKEY_CLASSES_ROOT\dragonx]
>> %RegFile% Echo @="URL:hush protocol" >> %RegFile% Echo @="URL:dragonx protocol"
>> %RegFile% Echo "URL Protocol"="" >> %RegFile% Echo "URL Protocol"=""
>> %RegFile% Echo. >> %RegFile% Echo.
>> %RegFile% Echo [HKEY_CLASSES_ROOT\hush\DefaultIcon] >> %RegFile% Echo [HKEY_CLASSES_ROOT\dragonx\DefaultIcon]
>> %RegFile% Echo @="silentdragon.exe" >> %RegFile% Echo @="silentdragon.exe"
>> %RegFile% Echo. >> %RegFile% Echo.
>> %RegFile% Echo [HKEY_CLASSES_ROOT\hush\Shell] >> %RegFile% Echo [HKEY_CLASSES_ROOT\dragonx\Shell]
>> %RegFile% Echo. >> %RegFile% Echo.
>> %RegFile% Echo [HKEY_CLASSES_ROOT\hush\Shell\Open] >> %RegFile% Echo [HKEY_CLASSES_ROOT\dragonx\Shell\Open]
>> %RegFile% Echo. >> %RegFile% Echo.
>> %RegFile% Echo [HKEY_CLASSES_ROOT\hush\Shell\Open\Command] >> %RegFile% Echo [HKEY_CLASSES_ROOT\dragonx\Shell\Open\Command]
>> %RegFile% Echo @="%hush%silentdragon.exe \"%%1\"" >> %RegFile% Echo @="%dragonx%silentdragon.exe \"%%1\""
Start /Wait %systemroot%\Regedit.exe /S %RegFile% Start /Wait %systemroot%\Regedit.exe /S %RegFile%
Del %RegFile% Del %RegFile%

View File

@@ -1,17 +1,17 @@
# bash programmable completion for hushd(1) # bash programmable completion for dragonxd(1)
# Copyright (c) 2012-2017 The Bitcoin Core developers # Copyright (c) 2012-2017 The Bitcoin Core developers
# Copyright (c) 2016-2017 The Zcash developers # Copyright (c) 2016-2017 The Zcash developers
# Copyright (c) 2018 The Hush developers # Copyright (c) 2018 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying # Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
_hushd() { _dragonxd() {
local cur prev words=() cword local cur prev words=() cword
local hushd local dragonxd
# save and use original argument to invoke hushd for -help # save and use original argument to invoke dragonxd for -help
# it might not be in $PATH # it might not be in $PATH
hushd="$1" dragonxd="$1"
COMPREPLY=() COMPREPLY=()
_get_comp_words_by_ref -n = cur prev words cword _get_comp_words_by_ref -n = cur prev words cword
@@ -35,7 +35,7 @@ _hushd() {
# only parse -help if senseful # only parse -help if senseful
if [[ -z "$cur" || "$cur" =~ ^- ]]; then if [[ -z "$cur" || "$cur" =~ ^- ]]; then
local helpopts local helpopts
helpopts=$($hushd -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' ) helpopts=$($dragonxd -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, "="); print $1 }' )
COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) )
fi fi
@@ -47,7 +47,7 @@ _hushd() {
;; ;;
esac esac
} && } &&
complete -F _hushd hushd complete -F _dragonxd dragonxd
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@@ -11,19 +11,19 @@
BRANCH=$1 BRANCH=$1
git clone https://git.hush.is/hush/hush3 git clone https://git.dragonx.is/DragonX/dragonx
cd hush3 cd dragonx
git checkout $BRANCH git checkout $BRANCH
# You need 2GB of RAM per core, don't use too many # You need 2GB of RAM per core, don't use too many
# (GB of RAM)/2 - 1 is the optimal core count for compiling Hush # (GB of RAM)/2 - 1 is the optimal core count for compiling DragonX
# `nproc` tells you how many cores you have # `nproc` tells you how many cores you have
JOBS=$2 JOBS=$2
JOBZ=$(nproc) # if build.sh fails, we can use many more jobs with make JOBZ=$(nproc) # if build.sh fails, we can use many more jobs with make
# Want to fix this parrallel-only build system bug we inherited ? you are a new hush dev # Want to fix this parrallel-only build system bug we inherited ? you are a new DragonX dev
# Sometimes the parrallel build fails because of a race condition, so # Sometimes the parrallel build fails because of a race condition, so
# we do it a few times to Make Really Sure # we do it a few times to Make Really Sure
./build.sh -j$JOBS;make -j$JOBZ;make -j$JOBZ;make -j$JOBZ ./build.sh -j$JOBS;make -j$JOBZ;make -j$JOBZ;make -j$JOBZ
./src/hushd &> hush.log & ./src/dragonxd &> dragonx.log &
# You can give the entire or parts of this file to Hush developers for debugging, # You can give the entire or parts of this file to DragonX developers for debugging,
# but there is a lot of metadata!!! We don't want any more than we need to fix bugz # but there is a lot of metadata!!! We don't want any more than we need to fix bugz
tail -f hush.log tail -f dragonx.log

View File

@@ -4,8 +4,8 @@
use warnings; use warnings;
use strict; use strict;
my $hush = "./src/hush-cli"; my $cli = "./src/dragonx-cli";
my $znew = "$hush z_getnewaddress"; my $znew = "$cli z_getnewaddress";
my $count = 1; my $count = 1;
my $howmany = shift || 50; my $howmany = shift || 50;

View File

@@ -1,4 +1,8 @@
### Gavin's notes on getting gitian builds up and running using KVM:### ### Notes on getting gitian builds up and running using KVM:###
Note: These are legacy notes inherited from upstream. The real, supported DragonX
build path is `./build.sh` together with the `depends/` system; gitian is legacy
and is retained here only for historical reference.
These instructions distilled from: These instructions distilled from:
[ https://help.ubuntu.com/community/KVM/Installation]( https://help.ubuntu.com/community/KVM/Installation) [ https://help.ubuntu.com/community/KVM/Installation]( https://help.ubuntu.com/community/KVM/Installation)
@@ -20,7 +24,7 @@ Sanity checks:
Once you've got the right hardware and software: Once you've got the right hardware and software:
git clone git://github.com/bitcoin/bitcoin.git git clone https://git.dragonx.is/DragonX/dragonx.git
git clone git://github.com/devrandom/gitian-builder.git git clone git://github.com/devrandom/gitian-builder.git
mkdir gitian-builder/inputs mkdir gitian-builder/inputs
cd gitian-builder/inputs cd gitian-builder/inputs
@@ -62,5 +66,5 @@ Here's a description of Gavin's setup on OSX 10.6:
5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above: 5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above:
export USE_LXC=1 export USE_LXC=1
git clone git://github.com/bitcoin/bitcoin.git git clone https://git.dragonx.is/DragonX/dragonx.git
... etc ... etc

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env perl
# Copyright 2016-2020 The Hush developers
# Released under the GPLv3
use strict;
use warnings;
my $x = 12.5 * 100000000;
my $n = 0;
while ($n<=31) {
#printf "$n,%.16g,%.16g,%.16g\n", $x, $x*0.90, $x*0.1;
printf "$n,%d,%d,%d\n", $x, $x*0.90, $x*0.1;
$x = $x / 2;
$n++;
exit if ($x <= 0);
}

View File

@@ -1,22 +0,0 @@
#!/usr/bin/env perl
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
use strict;
use warnings;
my $x = 340_000;
my $n = 0;
my $r = 12_500_000_000;
while ($n<=32) {
printf "%d,%d,%d\n", $n+1, $r, $x + 1680000*$n;
# blocktime halving at block 340000
if ($n==0) {
$r = 3.125 * 100_000_000;
} else {
$r /= 2;
}
$n++;
}

View File

@@ -1,27 +1,17 @@
# This is a list of nodes which hushd attempts to connect to automatically # This is a list of nodes which dragonxd attempts to connect to automatically
# at start up time. You can check to see if they are up/down with: # at start up time. You can check to see if they are up/down with:
# cd contrib; cat hush_seed_nodes.txt | ./hush_scanner # cd contrib; cat hush_seed_nodes.txt | ./hush_scanner
# IP/tor/i2p seeds from src/chainparamsseeds.h # IP seeds from src/chainparamsseeds.h
185.241.61.43 212.56.41.63
87.251.76.166 194.140.198.176
45.82.68.233 212.56.41.47
87.251.76.33 144.126.147.165
137.74.4.198 176.126.87.241
149.28.102.219
155.138.228.68
107.174.70.251
# hush_scanner uses nc which cannot deal with these
# iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p
# [2a0c:b641:6f1:34::2]
# [2a0c:b641:6f1:c::2]
# Hostname Seeds from src/hush_utils.h # Hostname Seeds from src/hush_utils.h
node1.hush.is node1.dragonx.is
node2.hush.is node2.dragonx.is
node3.hush.is node3.dragonx.is
node4.hush.is node4.dragonx.is
node5.hush.is node5.dragonx.is
node6.hush.is
node7.hush.is
node8.hush.is

View File

@@ -1,218 +0,0 @@
#!/usr/bin/env perl
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
use warnings;
use strict;
my $supply = 0.0;
my $block = 0; # Block 0 in Hush Smart chains is the BTC genesis block
my $puposhis = 100_000_000;
my $subsidy0 = 1_250_000_000;
my $halvings = 0;
my $initial = 6178674 * $puposhis;
my $interval = 1_680_000; # ~4 years of 75s blocks
my $stop = shift || -1;
my $totalfr = 0; # total paid out to FR address
if ($stop eq 'help' or $stop =~ m/-h/) {
die <<HELP;
# Simulate the total supply on Hush v3 mainnet
# Block Reward: Total Coinbase In Block
# Subsidy : Coinbase Earned by Miner
# FR : Founders Reward (10%)
# Block Reward = Subsidy + FR
Usage: ./hush_supply &> supply.csv
./hush_supply HEIGHT &> supply.csv # stop at HEIGHT
# This will generate CSV in the form of:
# block, supply, reward, subsidy, fr, totalfr, halvings
HELP
}
printf "# block, supply, reward, subsidy, fr, totalfr, halvings\n";
# Block Reward Amounts in puposhis
# The non-integral amounts cannot be represented exactly
# 12.5 * 100000000 = 1250000000
# 12.5 * 100000000 / 2 = 625000000
# 12.5 * 100000000 / 4 = 312500000
# 12.5 * 100000000 / 8 = 156250000
# 12.5 * 100000000 / 16 = 78125000
# 12.5 * 100000000 / 32 = 39062500
# 12.5 * 100000000 / 64 = 19531250
# 12.5 * 100000000 / 128 = 9765625
# 12.5 * 100000000 / 256 = 4882812.5
# 12.5 * 100000000 / 512 = 2441406.25
# 12.5 * 100000000 / 1024 = 1220703.125
# 12.5 * 100000000 / 2048 = 610351.5625
# 12.5 * 100000000 / 4096 = 305175.78125
# 12.5 * 100000000 / 8192 = 152587.890625
# 12.5 * 100000000 / 16384 = 76293.9453125
# 12.5 * 100000000 / 32768 = 38146.97265625
# 12.5 * 100000000 / 65536 = 19073.486328125
# Hush Halving Heights and Block Rewards
# 1,12500000000,340000
# 2,312500000,2020000
# 3,156250000,3700000
# 4,78125000,5380000
# 5,39062500,7060000
# 6,19531250,8740000
# 7,9765625,10420000
# 8,4882812,12100000
# 9,2441406,13780000
# 10,1220703,15460000
# 11,610351,17140000
# 12,305175,18820000
# 13,152587,20500000
# 14,76293,22180000
# 15,38146,23860000
# 16,19073,25540000
# 17,9536,27220000
# 18,4768,28900000
# 19,2384,30580000
# 20,1192,32260000
# 21,596,33940000
# 22,298,35620000
# 23,149,37300000
# 24,74,38980000
# 25,37,40660000
# 26,18,42340000
# 27,9,44020000
# 28,4,45700000
# 29,2,47380000
# 30,1,49060000
# 31,0,50740000
sub hush_block_reward
{
my $reward = 0;
my $height = shift;
my $halvings = 0;
if ($height >= 50740000) {
$reward = 0;
$halvings = 31;
} elsif ($height >= 49060000) {
$reward = 1;
$halvings = 30;
} elsif ($height >= 47380000) {
$reward = 1;
$halvings = 29;
} elsif ($height >= 45700000) {
$reward = 2;
$halvings = 28;
} elsif ($height >= 44020000) {
$reward = 4;
$halvings = 27;
} elsif ($height >= 42340000) {
$reward = 9;
$halvings = 26;
} elsif ($height >= 40660000) {
$reward = 18;
$halvings = 25;
} elsif ($height >= 38980000) {
$reward = 37;
$halvings = 24;
} elsif ($height >= 37380000) {
$reward = 74;
$halvings = 23;
} elsif ($height >= 35620000) {
$reward = 149;
$halvings = 22;
} elsif ($height >= 33940000) {
$reward = 298;
$halvings = 21;
} elsif ($height >= 32260001) {
$reward = 596;
$halvings = 20;
} elsif ($height >= 30580000) {
$reward = 1192;
$halvings = 19;
} elsif ($height >= 28900000) {
$reward = 2384;
$halvings = 18;
} elsif ($height >= 27220000) {
$reward = 4768;
$halvings = 17;
} elsif ($height >= 25540000) {
$reward = 9536;
$halvings = 16;
} elsif ($height >= 23860000) {
$reward = 19073; # 0.486328125 deviation
$halvings = 15;
} elsif ($height >= 22180000) {
$reward = 38146; # 0.97265625 deviation
$halvings = 14;
} elsif ($height >= 20500000) {
$reward = 76293; # 0.9453125 deviation
$halvings = 13;
} elsif ($height >= 18820000) {
$reward = 152587; # 0.890625 deviation
$halvings = 12;
} elsif ($height >= 17140000) {
$reward = 305175; # 0.78125sat deviation
$halvings = 11;
} elsif ($height >= 15460000) {
$reward = 610351; # 0.5625sat deviation
$halvings = 10;
} elsif ($height >= 13780000) {
$reward = 1220703; # 0.125sat deviation
$halvings = 9
} elsif ($height >= 12100000) {
$reward = 2441406; # 0.25sat deviation
$halvings = 8
} elsif ($height >= 10420000) {
$reward = 4882812; # 0.5sat deviation
$halvings = 7;
} elsif ($height >= 8740000) {
$reward = 9765625; # last exact reward
$halvings = 6;
} elsif ($height >= 7060000) {
$reward = 19531250; # 0.1953125 HUSH
$halvings = 5;
} elsif ($height >= 5380000) {
$reward = 39062500; # 0.390625 HUSH
$halvings = 4;
} elsif ($height >= 3700000) {
$reward = 78125000; # 0.78125 HUSH
$halvings = 3;
} elsif ($height >= 2020000) {
$reward = 156250000; # 1.5625 HUSH
$halvings = 2;
} elsif ($height >= 340000) {
$reward = 312500000; # 3.125 HUSH
$halvings = 1;
} elsif ($height >= 128) {
$reward = 1250000000; # 12.5 HUSH
}
return ($reward,$halvings);
}
# Block reward is 0 at the 31st halving
while ($halvings <= 30) {
$block++;
my ($reward,$halvings) = hush_block_reward($block);
my $fr = int($reward / 10);
my $subsidy = $reward - $fr;
if($block == 1) {
# initial airdrop of funds from HUSH v2 network @ Block 500000
$reward = $initial;
$subsidy= $reward;
$fr = 0;
}
$supply += $reward;
$totalfr += $fr;
# all values in puposhis
# block, current supply, block reward amount, fr, totalfr, number of halvings
printf "%d,%d,%d,%d,%d,%d,%d\n", $block, $supply, $reward, $subsidy, $fr, $totalfr, $halvings;
exit(0) if $block == $stop;
exit(0) if ($block > 128 && $reward == 0);
exit(-1) if ($supply >= 21_000_000*$puposhis);
}

View File

@@ -1,33 +0,0 @@
#!/usr/bin/env perl
# Copyright 2016-2020 The Hush developers
# Released under the GPLv3
use warnings;
use strict;
my $supply = 0.0;
my $block = 0;
my $satoshis = 100_000_000;
my $amount = int(12.5*$satoshis);
my $halvings = 0;
# Usage: ./hush_supply &> supply.csv
# Use this to calculate when supply hits a certain value
#while ($supply <= 21_000_000*$satoshis) {
# Use this to calculate when block rewards end
while ($halvings <= 64 && $amount >= 1) {
$block++;
if ($block < 5) {
$amount = 40_000 * $satoshis;
} else {
# Halving every 840000 blocks
if ($block % 840_000 == 0) {
$amount /= 2;
$halvings++;
}
$amount = int(12.5*$satoshis) / (2**$halvings);
}
$supply += $amount;
# block, current supply, block reward amount, number of halvings
printf "%s,%s,%s,%s\n", $block,$supply / $satoshis, $amount / $satoshis, $halvings;
}

View File

@@ -2,11 +2,11 @@
Sample configuration files for: Sample configuration files for:
SystemD: hushd.service SystemD: dragonxd.service
Upstart: hushd.conf Upstart: dragonxd.conf
OpenRC: hushd.openrc OpenRC: dragonxd.openrc
hushd.openrcconf dragonxd.openrcconf
CentOS: hushd.init CentOS: dragonxd.init
have been made available to assist packagers in creating node packages here. have been made available to assist packagers in creating node packages here.

View File

@@ -1,4 +1,4 @@
description "Hush Daemon" description "DragonX Daemon"
start on runlevel [2345] start on runlevel [2345]
stop on starting rc RUNLEVEL=[016] stop on starting rc RUNLEVEL=[016]
@@ -9,7 +9,7 @@ env HUSHD_GROUP="hush"
env HUSHD_PIDDIR="/var/run/dragonxd" env HUSHD_PIDDIR="/var/run/dragonxd"
# upstart can't handle variables constructed with other variables # upstart can't handle variables constructed with other variables
env HUSHD_PIDFILE="/var/run/dragonxd/dragonxd.pid" env HUSHD_PIDFILE="/var/run/dragonxd/dragonxd.pid"
env HUSHD_CONFIGFILE="/etc/hush/hush.conf" env HUSHD_CONFIGFILE="/etc/dragonx/DRAGONX.conf"
env HUSHD_DATADIR="/var/lib/dragonxd" env HUSHD_DATADIR="/var/lib/dragonxd"
expect fork expect fork

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# dragonxd The hush core server. # dragonxd The DragonX core server.
# #
# #
# chkconfig: 345 80 20 # chkconfig: 345 80 20

View File

@@ -8,7 +8,7 @@ else
HUSHD_DEFAULT_DATADIR="/var/lib/dragonxd" HUSHD_DEFAULT_DATADIR="/var/lib/dragonxd"
fi fi
HUSHD_CONFIGFILE=${HUSHD_CONFIGFILE:-/etc/hush/hush.conf} HUSHD_CONFIGFILE=${HUSHD_CONFIGFILE:-/etc/dragonx/DRAGONX.conf}
HUSHD_PIDDIR=${HUSHD_PIDDIR:-/var/run/dragonxd} HUSHD_PIDDIR=${HUSHD_PIDDIR:-/var/run/dragonxd}
HUSHD_PIDFILE=${HUSHD_PIDFILE:-${HUSHD_PIDDIR}/dragonxd.pid} HUSHD_PIDFILE=${HUSHD_PIDFILE:-${HUSHD_PIDDIR}/dragonxd.pid}
HUSHD_DATADIR=${HUSHD_DATADIR:-${HUSHD_DEFAULT_DATADIR}} HUSHD_DATADIR=${HUSHD_DATADIR:-${HUSHD_DEFAULT_DATADIR}}
@@ -18,8 +18,8 @@ HUSHD_BIN=${HUSHD_BIN:-/usr/bin/dragonxd}
HUSHD_NICE=${HUSHD_NICE:-${NICELEVEL:-0}} HUSHD_NICE=${HUSHD_NICE:-${NICELEVEL:-0}}
HUSHD_OPTS="${HUSHD_OPTS:-${HUSH_OPTS}}" HUSHD_OPTS="${HUSHD_OPTS:-${HUSH_OPTS}}"
name="Hush Full Node Daemon" name="DragonX Full Node Daemon"
description="Hush cryptocurrency P2P network daemon" description="DragonX cryptocurrency P2P network daemon"
command="/usr/bin/dragonxd" command="/usr/bin/dragonxd"
command_args="-pid=\"${HUSHD_PIDFILE}\" \ command_args="-pid=\"${HUSHD_PIDFILE}\" \

View File

@@ -1,7 +1,7 @@
# /etc/conf.d/dragonxd: config file for /etc/init.d/dragonxd # /etc/conf.d/dragonxd: config file for /etc/init.d/dragonxd
# Config file location # Config file location
#HUSHD_CONFIGFILE="/etc/hush/hush.conf" #HUSHD_CONFIGFILE="/etc/dragonx/DRAGONX.conf"
# What directory to write pidfile to? (created and owned by $HUSHD_USER) # What directory to write pidfile to? (created and owned by $HUSHD_USER)
#HUSHD_PIDDIR="/var/run/dragonxd" #HUSHD_PIDDIR="/var/run/dragonxd"

View File

@@ -1,15 +1,17 @@
[Unit] [Unit]
Description=Hush: Speak And Transact Freely Description=DragonX: private RandomX-mined full node
After=network.target After=network.target
[Service] [Service]
# The 'hush' service user/group is intentional for packaging compatibility;
# renaming it is a separate decision.
User=hush User=hush
Group=hush Group=hush
Type=forking Type=forking
PIDFile=/var/lib/dragonxd/dragonxd.pid PIDFile=/var/lib/dragonxd/dragonxd.pid
ExecStart=/usr/bin/dragonxd -daemon -pid=/var/lib/dragonxd/dragonxd.pid \ ExecStart=/usr/bin/dragonxd -daemon -pid=/var/lib/dragonxd/dragonxd.pid \
-conf=/etc/hush/hush.conf -datadir=/var/lib/dragonxd -disablewallet -conf=/etc/dragonx/DRAGONX.conf -datadir=/var/lib/dragonxd -disablewallet
Restart=always Restart=always
PrivateTmp=true PrivateTmp=true

View File

@@ -1,59 +0,0 @@
description "Hush Daemon"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
env HUSHD_BIN="/usr/bin/hushd"
env HUSHD_USER="hush"
env HUSHD_GROUP="hush"
env HUSHD_PIDDIR="/var/run/hushd"
# upstart can't handle variables constructed with other variables
env HUSHD_PIDFILE="/var/run/hushd/hushd.pid"
env HUSHD_CONFIGFILE="/etc/hush/hush.conf"
env HUSHD_DATADIR="/var/lib/hushd"
expect fork
respawn
respawn limit 5 120
kill timeout 60
pre-start script
# this will catch non-existent config files
# hushd will check and exit with this very warning, but it can do so
# long after forking, leaving upstart to think everything started fine.
# since this is a commonly encountered case on install, just check and
# warn here.
if ! grep -qs '^rpcpassword=' "$HUSHD_CONFIGFILE" ; then
echo "ERROR: You must set a secure rpcpassword to run hushd."
echo "The setting must appear in $HUSHD_CONFIGFILE"
echo
echo "This password is security critical to securing wallets "
echo "and must not be the same as the rpcuser setting."
echo "You can generate a suitable random password using the following"
echo "command from the shell:"
echo
echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"
echo
exit 1
fi
mkdir -p "$HUSHD_PIDDIR"
chmod 0755 "$HUSHD_PIDDIR"
chown $HUSHD_USER:$HUSHD_GROUP "$HUSHD_PIDDIR"
chown $HUSHD_USER:$HUSHD_GROUP "$HUSHD_CONFIGFILE"
chmod 0660 "$HUSHD_CONFIGFILE"
end script
exec start-stop-daemon \
--start \
--pidfile "$HUSHD_PIDFILE" \
--chuid $HUSHD_USER:$HUSHD_GROUP \
--exec "$HUSHD_BIN" \
-- \
-pid="$HUSHD_PIDFILE" \
-conf="$HUSHD_CONFIGFILE" \
-datadir="$HUSHD_DATADIR" \
-disablewallet \
-daemon

View File

@@ -1,67 +0,0 @@
#!/usr/bin/env bash
#
# hushd The hush core server.
#
#
# chkconfig: 345 80 20
# description: hushd
# processname: hushd
#
# Source function library.
. /etc/init.d/functions
# you can override defaults in /etc/sysconfig/hushd, see below
if [ -f /etc/sysconfig/hushd ]; then
. /etc/sysconfig/hushd
fi
RETVAL=0
prog=hushd
# you can override the lockfile via HUSHD_LOCKFILE in /etc/sysconfig/hushd
lockfile=${HUSHD_LOCKFILE-/var/lock/subsys/hushd}
# hushd defaults to /usr/bin/hushd, override with HUSHD_BIN
hushd=${HUSHD_BIN-/usr/bin/hushd}
# hushd opts default to -disablewallet, override with HUSHD_OPTS
hushd_opts=${HUSHD_OPTS--disablewallet}
start() {
echo -n $"Starting $prog: "
daemon $DAEMONOPTS $hushd $hushd_opts
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
;;
restart)
stop
start
;;
*)
echo "Usage: service $prog {start|stop|status|restart}"
exit 1
;;
esac

View File

@@ -1,87 +0,0 @@
#!/sbin/runscript
# backward compatibility for existing gentoo layout
#
if [ -d "/var/lib/hush/.hush" ]; then
HUSHD_DEFAULT_DATADIR="/var/lib/hush/.hush"
else
HUSHD_DEFAULT_DATADIR="/var/lib/hushd"
fi
HUSHD_CONFIGFILE=${HUSHD_CONFIGFILE:-/etc/hush/hush.conf}
HUSHD_PIDDIR=${HUSHD_PIDDIR:-/var/run/hushd}
HUSHD_PIDFILE=${HUSHD_PIDFILE:-${HUSHD_PIDDIR}/hushd.pid}
HUSHD_DATADIR=${HUSHD_DATADIR:-${HUSHD_DEFAULT_DATADIR}}
HUSHD_USER=${HUSHD_USER:-${HUSH_USER:-hush}}
HUSHD_GROUP=${HUSHD_GROUP:-hush}
HUSHD_BIN=${HUSHD_BIN:-/usr/bin/hushd}
HUSHD_NICE=${HUSHD_NICE:-${NICELEVEL:-0}}
HUSHD_OPTS="${HUSHD_OPTS:-${HUSH_OPTS}}"
name="Hush Full Node Daemon"
description="Hush cryptocurrency P2P network daemon"
command="/usr/bin/hushd"
command_args="-pid=\"${HUSHD_PIDFILE}\" \
-conf=\"${HUSHD_CONFIGFILE}\" \
-datadir=\"${HUSHD_DATADIR}\" \
-daemon \
${HUSHD_OPTS}"
required_files="${HUSHD_CONFIGFILE}"
start_stop_daemon_args="-u ${HUSHD_USER} \
-N ${HUSHD_NICE} -w 2000"
pidfile="${HUSHD_PIDFILE}"
# The retry schedule to use when stopping the daemon. Could be either
# a timeout in seconds or multiple signal/timeout pairs (like
# "SIGKILL/180 SIGTERM/300")
retry="${HUSHD_SIGTERM_TIMEOUT}"
depend() {
need localmount net
}
# verify
# 1) that the datadir exists and is writable (or create it)
# 2) that a directory for the pid exists and is writable
# 3) ownership and permissions on the config file
start_pre() {
checkpath \
-d \
--mode 0750 \
--owner "${HUSHD_USER}:${HUSHD_GROUP}" \
"${HUSHD_DATADIR}"
checkpath \
-d \
--mode 0755 \
--owner "${HUSHD_USER}:${HUSHD_GROUP}" \
"${HUSHD_PIDDIR}"
checkpath -f \
-o ${HUSHD_USER}:${HUSHD_GROUP} \
-m 0660 \
${HUSHD_CONFIGFILE}
checkconfig || return 1
}
checkconfig()
{
if ! grep -qs '^rpcpassword=' "${HUSHD_CONFIGFILE}" ; then
eerror ""
eerror "ERROR: You must set a secure rpcpassword to run hushd."
eerror "The setting must appear in ${HUSHD_CONFIGFILE}"
eerror ""
eerror "This password is security critical to securing wallets "
eerror "and must not be the same as the rpcuser setting."
eerror "You can generate a suitable random password using the following"
eerror "command from the shell:"
eerror ""
eerror "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"
eerror ""
eerror ""
return 1
fi
}

View File

@@ -1,33 +0,0 @@
# /etc/conf.d/hushd: config file for /etc/init.d/hushd
# Config file location
#HUSHD_CONFIGFILE="/etc/hush/hush.conf"
# What directory to write pidfile to? (created and owned by $HUSHD_USER)
#HUSHD_PIDDIR="/var/run/hushd"
# What filename to give the pidfile
#HUSHD_PIDFILE="${HUSHD_PIDDIR}/hushd.pid"
# Where to write hushd data (be mindful that the blockchain is large)
#HUSHD_DATADIR="/var/lib/hushd"
# User and group to own hushd process
#HUSHD_USER="hush"
#HUSHD_GROUP="hush"
# Path to hushd executable
#HUSHD_BIN="/usr/bin/hushd"
# Nice value to run hushd under
#HUSHD_NICE=0
# Additional options (avoid -conf and -datadir, use flags above)
HUSHD_OPTS="-disablewallet"
# The timeout in seconds OpenRC will wait for hushd to terminate
# after a SIGTERM has been raised.
# Note that this will be mapped as argument to start-stop-daemon's
# '--retry' option, which means you can specify a retry schedule
# here. For more information see man 8 start-stop-daemon.
HUSHD_SIGTERM_TIMEOUT=60

View File

@@ -1,22 +0,0 @@
[Unit]
Description=Hush: Speak And Transact Freely
After=network.target
[Service]
User=hush
Group=hush
Type=forking
PIDFile=/var/lib/hushd/hushd.pid
ExecStart=/usr/bin/hushd -daemon -pid=/var/lib/hushd/hushd.pid \
-conf=/etc/hush/hush.conf -datadir=/var/lib/hushd -disablewallet
Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5
[Install]
WantedBy=multi-user.target

View File

@@ -1,9 +1,5 @@
### MacDeploy ### ### MacDeploy ###
For Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package:
sudo easy_install argparse
This script should not be run manually, instead, after building as usual: This script should not be run manually, instead, after building as usual:
make deploy make deploy
@@ -11,5 +7,4 @@ This script should not be run manually, instead, after building as usual:
During the process, the disk image window will pop up briefly where the fancy During the process, the disk image window will pop up briefly where the fancy
settings are applied. This is normal, please do not interfere. settings are applied. This is normal, please do not interfere.
When finished, it will produce `Bitcoin-Core.dmg`. When finished, it will produce `DragonX.dmg`.

View File

@@ -1,8 +0,0 @@
103.6.12.117
95.213.238.99
77.75.121.139
139.162.45.144
152.89.105.66
152.89.104.58
5.53.120.34
139.99.208.141

View File

@@ -1,5 +1,5 @@
### Qos ### ### Qos ###
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Hush network. It limits outbound TCP traffic with a source or destination port of 18030, but not if the destination IP is within a LAN (defined as 192.168.x.x). This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the DragonX network. It limits outbound TCP traffic with a source or destination port of 18030, but not if the destination IP is within a LAN (defined as 192.168.x.x).
This means one can have an always-on hushd instance running, and another local hushd/bitcoin-qt instance which connects to this node and receives blocks from it. This means one can have an always-on dragonxd instance running, and another local dragonxd instance which connects to this node and receives blocks from it.

View File

@@ -3,22 +3,23 @@
# Distributed under the GPLv3 software license, see the accompanying # Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# This script is used to generate the checkpoint data used by the SilentDragon Android SDK # This script is used to generate the checkpoint data used by the SilentDragonX Android SDK
# https://git.hush.is/fekt/hush-android-wallet-sdk/src/branch/main/sdk-lib/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet # https://git.dragonx.is/DragonX/SilentDragonXAndroid
# (checkpoint format follows the upstream co.electriccoin.zcash/checkpoint/mainnet layout)
use warnings; use warnings;
use strict; use strict;
my $hush = "./src/hush-cli"; my $cli = "./src/dragonx-cli";
my $getblock= "$hush getblock"; my $getblock= "$cli getblock";
my $gethash = "$hush getblockhash"; my $gethash = "$cli getblockhash";
my $gettree = "$hush getblockmerkletree"; my $gettree = "$cli getblockmerkletree";
my $start = shift || 1390000; my $start = shift || 1390000;
my $end = shift || 1422000; my $end = shift || 1422000;
my $stride = shift || 10000; my $stride = shift || 10000;
my $blocks = qx{$hush getblockcount}; my $blocks = qx{$cli getblockcount};
if($?) { if($?) {
print "ERROR, is hushd running? exiting...\n"; print "ERROR, is dragonxd running? exiting...\n";
exit 1; exit 1;
} }

View File

@@ -3,7 +3,8 @@
# Distributed under the GPLv3 software license, see the accompanying # Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# This script is used to generate the data used by the silentdragonlite-cli checkpoints.rs file # This script is used to generate the data used by a light-wallet checkpoints.rs file.
# The checkpoint format follows the upstream silentdragonlite-cli reference:
# https://git.hush.is/hush/silentdragonlite-cli/src/branch/master/lib/src/lightclient/checkpoints.rs#L24 # https://git.hush.is/hush/silentdragonlite-cli/src/branch/master/lib/src/lightclient/checkpoints.rs#L24
use warnings; use warnings;
@@ -12,16 +13,16 @@ use strict;
# call this script like this to generate checkpoints for another chain: # call this script like this to generate checkpoints for another chain:
# CLI=./src/hac-cli ./contrib/sdl_checkpoints.pl ... # CLI=./src/hac-cli ./contrib/sdl_checkpoints.pl ...
my $hush = $ENV{CLI} || "./src/hush-cli"; my $cli = $ENV{CLI} || "./src/dragonx-cli";
my $gethash = "$hush getblockhash"; my $gethash = "$cli getblockhash";
my $gettree = "$hush getblockmerkletree"; my $gettree = "$cli getblockmerkletree";
my $start = shift || 300000; my $start = shift || 300000;
my $end = shift || 840000; my $end = shift || 840000;
my $stride = shift || 10000; my $stride = shift || 10000;
my $blocks = qx{$hush getblockcount}; my $blocks = qx{$cli getblockcount};
if($?) { if($?) {
print "ERROR, is hushd running? exiting...\n"; print "ERROR, is dragonxd running? exiting...\n";
exit 1; exit 1;
} }

View File

@@ -1,10 +1,8 @@
# Seeds # Seeds
Utility to generate the seeds.txt list that is compiled into the client Utility to generate the seeds.txt list that is compiled into the client
(see [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) and other utilities in [contrib/seeds](hush/hush3/src/branch/master/contrib/seeds/)). (see [src/chainparamsseeds.h](../../src/chainparamsseeds.h) and other utilities in [contrib/seeds](.)).
## Updating seeds ## Updating seeds
Update [contrib/seeds/nodes_main.txt](hush/hush3/src/branch/master/contrib/seeds/nodes_main.txt) and run `make seeds` in the hush root directory of this repo (not the directory of this README) to update [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) then commit the result. Update [contrib/seeds/nodes_main.txt](nodes_main.txt) and run `make seeds` in the DragonX root directory of this repo (not the directory of this README) to update [src/chainparamsseeds.h](../../src/chainparamsseeds.h) then commit the result.

View File

@@ -167,9 +167,9 @@ def main():
g.write('// Instead, update contrib/seeds/nodes_main.txt then run\n') g.write('// Instead, update contrib/seeds/nodes_main.txt then run\n')
g.write('// ./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h\n') g.write('// ./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h\n')
g.write('// OR run: make seeds\n') g.write('// OR run: make seeds\n')
g.write('#ifndef HUSH_CHAINPARAMSSEEDS_H\n') g.write('#ifndef DRAGONX_CHAINPARAMSSEEDS_H\n')
g.write('#define HUSH_CHAINPARAMSSEEDS_H\n') g.write('#define DRAGONX_CHAINPARAMSSEEDS_H\n')
g.write('// List of fixed seed nodes for the Hush network\n') g.write('// List of fixed seed nodes for the DragonX network\n')
g.write('// Each line contains a BIP155 serialized address.\n') g.write('// Each line contains a BIP155 serialized address.\n')
g.write('//\n') g.write('//\n')
with open(os.path.join(indir,'nodes_main.txt'), 'r', encoding="utf8") as f: with open(os.path.join(indir,'nodes_main.txt'), 'r', encoding="utf8") as f:

View File

@@ -1,38 +1,14 @@
# node1.hush.is # node1.dragonx.is
103.69.128.148 212.56.41.63
# node2.hush.is # node2.dragonx.is
194.29.100.179 194.140.198.176
# node3.hush.is # node3.dragonx.is
45.132.75.69 212.56.41.47
# node4.hush.is # node4.dragonx.is
170.205.39.39 144.126.147.165
# lite.hushpool.is # node5.dragonx.is
149.28.102.219 176.126.87.241
# lite2.hushpool.is
155.138.228.68
# wtfistheinternet.hush.is
107.174.70.251
# arrakis.hush.is
178.250.189.141
# torv3
b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion
dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion
vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion
# ipv6
2a0c:b641:6f1:18e::2
2406:ef80:3:1269::1
2406:ef80:2:3b59::1
2406:ef80:1:146e::1
2406:ef80:4:2132::1
# i2p
7oumuppuzgbzlkahavx7qrtjnvbhkixjqdmeg7f6fhndgfhz7mlq.b32.i2p

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
### TestGen ### ### TestGen ###
Utilities to generate test vectors for the data-driven Hush tests. Utilities to generate test vectors for the data-driven DragonX tests.
Usage: Usage:

View File

@@ -1,5 +1,14 @@
### Verify SF Binaries ### ### Verify SF Binaries ###
This script attempts to download the signature file `SHA256SUMS.asc` from https://bitcoin.org.
This is a legacy SourceForge-era script inherited from upstream and is not used
for DragonX releases. It originally attempted to download a signature file
`SHA256SUMS.asc` from an upstream release host and verify the binaries listed in
it.
For DragonX, release artifacts and checksums are published via the DragonX
project host at https://git.dragonx.is/DragonX and https://dragonx.is . The
script would need to be pointed at those locations before it could be useful; it
is retained here only for historical reference.
It first checks if the signature passes, and then downloads the files specified in the file, and checks if the hashes of these files match those that are specified in the signature file. It first checks if the signature passes, and then downloads the files specified in the file, and checks if the hashes of these files match those that are specified in the signature file.

View File

@@ -1,12 +1,10 @@
package=boost package=boost
$(package)_version=1_72_0 $(package)_version=1_72_0
#$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(subst _,.,$($(package)_version))/source/ $(package)_download_path=https://archives.boost.io/release/$(subst _,.,$($(package)_version))/source
#$(package)_file_name=$(package)_$($(package)_version).tar.bz2 $(package)_file_name=$(package)_$($(package)_version).tar.bz2
$(package)_download_file=$(package)_$($(package)_version).tar.bz2
$(package)_sha256_hash=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722 $(package)_sha256_hash=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722
$(package)_download_path=https://git.hush.is/attachments
$(package)_file_name=7b13759e-8623-4e48-ae08-f78502f4b6a5
$(package)_download_file=7b13759e-8623-4e48-ae08-f78502f4b6a5
$(package)_patches=fix-Solaris.patch ignore_wnonnull_gcc_11.patch range_enums_clang_16.patch $(package)_patches=fix-Solaris.patch ignore_wnonnull_gcc_11.patch range_enums_clang_16.patch
define $(package)_set_vars define $(package)_set_vars

View File

@@ -1,8 +1,8 @@
package=libsodium package=libsodium
$(package)_version=1.0.18 $(package)_version=1.0.18
$(package)_download_path=https://git.hush.is/attachments $(package)_download_path=https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE
$(package)_file_name=0d9f589e-a9f9-4ddb-acaa-0f1b423b32eb $(package)_file_name=libsodium-1.0.18.tar.gz
$(package)_download_file=0d9f589e-a9f9-4ddb-acaa-0f1b423b32eb $(package)_download_file=libsodium-1.0.18.tar.gz
$(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1 $(package)_sha256_hash=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1
$(package)_dependencies= $(package)_dependencies=
$(package)_config_opts= $(package)_config_opts=
@@ -16,8 +16,12 @@ define $(package)_set_vars
endef endef
endif endif
# libsodium's autogen.sh otherwise fetches config.sub/config.guess from
# git.savannah.gnu.org gitweb, which is frequently down (502) and writes the error
# page over config.sub, breaking configure. autoreconf -ivf (run first) already
# installs valid copies, so tell autogen.sh to skip the download.
define $(package)_preprocess_cmds define $(package)_preprocess_cmds
cd $($(package)_build_subdir); ./autogen.sh cd $($(package)_build_subdir); DO_NOT_UPDATE_CONFIG_SCRIPTS=1 ./autogen.sh
endef endef
define $(package)_config_cmds define $(package)_config_cmds

View File

@@ -1,7 +1,7 @@
$(package)_version=3.1 $(package)_version=3.1
$(package)_download_path=https://git.hush.is/attachments $(package)_download_path=https://github.com/nemtrif/utfcpp/archive/refs/tags
$(package)_file_name=11822fe4-3846-4ce4-9c84-ba0877a7b186 $(package)_file_name=utfcpp-3.1.tar.gz
$(package)_download_file=11822fe4-3846-4ce4-9c84-ba0877a7b186 $(package)_download_file=v3.1.tar.gz
$(package)_sha256_hash=ab531c3fd5d275150430bfaca01d7d15e017a188183be932322f2f651506b096 $(package)_sha256_hash=ab531c3fd5d275150430bfaca01d7d15e017a188183be932322f2f651506b096
define $(package)_stage_cmds define $(package)_stage_cmds

View File

@@ -1,7 +1,7 @@
# Hush Core (hushd) Software Contribution Guidelines # DragonX Core (dragonxd) Software Contribution Guidelines
Thank you for reaching out and trying to make Hush an even better software application and cryptocoin platform. These contribution guidelines shall help you figuring out where you can be helpful and how to easily get started. Thank you for reaching out and trying to make DragonX an even better software application and cryptocoin platform. These contribution guidelines shall help you figuring out where you can be helpful and how to easily get started.
## Table of Contents ## Table of Contents
@@ -14,15 +14,13 @@ Thank you for reaching out and trying to make Hush an even better software appli
0. [Community](#community) 0. [Community](#community)
## Types of contributions we're looking for ## Types of contributions we're looking for
There are many ways you can directly contribute to Hush: There are many ways you can directly contribute to DragonX:
* Debug and test the Hush Core code * Debug and test the DragonX Core code
* Find and fix bugs * Find and fix bugs
* Improve suboptimal code * Improve suboptimal code
* Extend our software * Extend our software
* Perform a secure code review of Hush Full Node and other Hush-related software * Perform a secure code review of DragonX Full Node and other DragonX-related software
We have a curated list of projects with details about difficulty level and languages involved: https://git.hush.is/hush/projects
Interested in making a contribution? Read on! Interested in making a contribution? Read on!
@@ -31,15 +29,14 @@ Interested in making a contribution? Read on!
Before we get started, here are a few things we expect from you (and that you should expect from others): Before we get started, here are a few things we expect from you (and that you should expect from others):
* Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and projects, which means we likely have different perspectives on "how free software and open source is done." Try to listen to others rather than convince them that your way is correct. * Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and projects, which means we likely have different perspectives on "how free software and open source is done." Try to listen to others rather than convince them that your way is correct.
* Open Source Guides are released with a [Contributor Code of Conduct](./code_of_conduct.md). By participating in this project, you agree to abide by its terms.
* If you open a pull request, please ensure that your contribution does not increase test failures. If there are additional test failures, you will need to address them before we can merge your contribution. * If you open a pull request, please ensure that your contribution does not increase test failures. If there are additional test failures, you will need to address them before we can merge your contribution.
* When adding content, please consider if it is widely valuable. Please don't add references or links to things you or your employer have created as others will do so if they appreciate it. * When adding content, please consider if it is widely valuable. Please don't add references or links to things you or your employer have created as others will do so if they appreciate it.
## How to contribute ## How to contribute
If you'd like to contribute, start by searching through the [issues](https://git.hush.is/hush/hush3/issues) and [pull requests](https://git.hush.is/hush/hush3/pulls) to see whether someone else has raised a similar idea or question. If you'd like to contribute, start by searching through the [issues](https://git.dragonx.is/DragonX/dragonx/issues) and [pull requests](https://git.dragonx.is/DragonX/dragonx/pulls) to see whether someone else has raised a similar idea or question.
If you don't see your idea listed, and you think it can contribute to Hush, do one of the following: If you don't see your idea listed, and you think it can contribute to DragonX, do one of the following:
* **If your contribution is minor,** such as a fixing a typo, open a pull request. * **If your contribution is minor,** such as a fixing a typo, open a pull request.
* **If your contribution is major,** such as a new feature or bugfix, start by opening an issue first. That way, other contributors can weigh in on the discussion before you do any work. * **If your contribution is major,** such as a new feature or bugfix, start by opening an issue first. That way, other contributors can weigh in on the discussion before you do any work.
@@ -49,9 +46,9 @@ Don't write shitty code. Do not emulate "jl777 code style" from Komodo, we consi
## Setting up your environment ## Setting up your environment
The Hush Core (hushd) is mainly written in C++ with specific modules written in C. Follow the [Install](https://git.hush.is/hush/hush3/src/branch/master/INSTALL.md) instructions to build hushd from sources. For more informations about the Hush Platform and a full API documentation please visit the official [Hush Developer documentation](https://faq.hush.is/rpc/) DragonX Core (dragonxd) is mainly written in C++ with specific modules written in C. See the build instructions in the [README](../README.md) to build dragonxd from sources.
Other Hush software is written in Rust or Go. We avoid Javascript at all costs. Other DragonX software is written in Rust or Go. We avoid Javascript at all costs.
## Contribution review process ## Contribution review process

View File

@@ -1,6 +1,6 @@
# Being a Hush Developer # Being a DragonX Developer
## Compiling Hush ## Compiling DragonX
Normal compiling is as simple as: Normal compiling is as simple as:
@@ -20,7 +20,7 @@ Divide how many GBs of RAM you have by 2, subtract one. Use that many jobs.
## Dealing with dependency changes ## Dealing with dependency changes
Let's say you change a dependency and want the compile to notice. If your Let's say you change a dependency and want the compile to notice. If your
change is outside of the main Hush source code, in ./src, simply running change is outside of the main DragonX source code, in ./src, simply running
`make` will not notice, and sometimes not even `build.sh`. You can always `make` will not notice, and sometimes not even `build.sh`. You can always
do a fresh clone or `make clean`, but that will take a lot of time. Those do a fresh clone or `make clean`, but that will take a lot of time. Those
methods are actually best for Continuous Integration systems, but to help methods are actually best for Continuous Integration systems, but to help
@@ -54,14 +54,14 @@ If `make clean` produces a compilation error, you just experienced it.
## Switching branches ## Switching branches
Switching branches and doing partial compiles in Hush source code Switching branches and doing partial compiles in DragonX source code
can introduce weird bugs, which are fixed by running `build.sh` again. can introduce weird bugs, which are fixed by running `build.sh` again.
Additionally, it's a good idea to run `make clean` before you switch Additionally, it's a good idea to run `make clean` before you switch
between branches. between branches.
## Partial compiles ## Partial compiles
At any point, you can modify hush source code and then use `make` or `build.sh` At any point, you can modify DragonX source code and then use `make` or `build.sh`
to do a partial compile. The first is faster but the latter is more likely to to do a partial compile. The first is faster but the latter is more likely to
work correctly in all circustances. Sometimes partial compiles break weird work correctly in all circustances. Sometimes partial compiles break weird
build system dependencies, and you must do a `make clean` first, or even build system dependencies, and you must do a `make clean` first, or even
@@ -75,14 +75,14 @@ of a dependency or something inside of Rust, you will need `build.sh` .
## Generating new unix man pages ## Generating new unix man pages
Make sure that you have updated all version numbers in hushd and compiled, then Make sure that you have updated all version numbers in dragonxd and compiled, then
to generate new unix man pages for that version : to generate new unix man pages for that version :
./util/gen-manpages.sh ./util/gen-manpages.sh
## Generating new debian packages ## Generating new debian packages
After successfully compiling Hush, you can generate a debian package of these binaries with: After successfully compiling DragonX, you can generate a debian package of these binaries with:
./util/build-debian-package.sh ./util/build-debian-package.sh
@@ -113,9 +113,8 @@ port) are ways to prevent them from communicating. This is good because these
two HACs will eventually chain fork due to their different consensus rules and two HACs will eventually chain fork due to their different consensus rules and
ban each other, wasting time, bandwidth and sanity. ban each other, wasting time, bandwidth and sanity.
An example of doing this can be seen in the commit An example of this pattern in the Git history is the commit which added the
https://git.hush.is/hush/hush3/commit/d39503c13b7419620d138050899705ced557eef9 `-ac_burn` consensus changing option; search the log for `ac_burn` to find it.
which added the `-ac_burn` consensus changing option.
The chain magic value is the CRC32 checksum of every non-default consensus The chain magic value is the CRC32 checksum of every non-default consensus
option the HAC uses. option the HAC uses.
@@ -128,4 +127,4 @@ modify `src/miner.cpp` to do whatever they want.
If you think something else should be in this guide, please send your suggestions! If you think something else should be in this guide, please send your suggestions!
Gitea: https://git.hush.is/hush/hush3 Gitea: https://git.dragonx.is/DragonX/dragonx

View File

@@ -1,71 +0,0 @@
## Claiming Funds From Old Hush Wallets
Hush migrated to a new mainnet after Block 500,000 on the old Hush blockchain.
Funds in addresses as of Block 500,000 were transported to our new chain. About
31,000 addresses with at least 0.00000001 HUSH were transported to the new Hush
mainnet.
To claim funds on the new chain, there are few options.
### Funds on exchanges
Firstly, no bueno! Not your keys, not your coins. It's best not to store coins
on exchanges. But in this case, you lucked out! There is nothing to do to claim
new coins if you have coins on an exchange that supports the new Hush chain.
The exchange will follow the instructions from the next section and you will
magically have funds on the new chain. Note that old Hush addresses started
with `t1` and now they begin with `R`.
To see what an old HUSH v2 address looks like on the new chain, this online tool
can be used: https://dexstats.info/addressconverter.php
or this command line tool: https://git.hush.is/hush/hush3/src/master/contrib/convert_address.py
### Using an old wallet.dat
Backup your old HUSH wallet.dat, and backup any current wallet.dat that is in
~/.komodo/HUSH3/
OR
~/.hush/HUSH3/
There is no way to lose funds, as long as you have backups!!! Make sure
to make backups. Do not skip this step.
Make sure any/all GUI wallets are stopped! Also make sure your old Hush node
and new Hush3 node are stopped:
cd hush3
./src/hush-cli stop
Do not copy wallets or move wallets while your full node is running! This could
corrupt your wallet!
Now copy your old Hush wallet.dat to
~/.hush/HUSH3/
with a command like
# DO NOT RUN THIS WITHOUT MAKING BACKUPS!
cp ~/.hush/wallet.dat ~/.hush/HUSH3/
The reason this works is that both old HUSH and new HUSH are still Bitcoin Protocol
coins, which both use secp256k1 public keys. Now start your HUSH3 node again,
with this special CLI argument that will clear out transactions from your wallet:
cd hush3
./src/hushd -zapwallettxes
This will cause a full history rescan, which will take some time. Once it's complete,
you can see your funds with this command:
./src/hush-cli getwalletinfo
NOTE: Do not use this wallet except to send funds to a new wallet!
### Private Keys
You can also transport funds one address at a time via private keys.

View File

@@ -1,7 +0,0 @@
rpcuser=dontuseweakusernameoryougetrobbed
rpcpassword=dontuseweakpasswordoryougetrobbed
txindex=1
server=1
rpcworkqueue=64
addnode=1.2.3.4
addnode=5.6.7.8

View File

@@ -1,6 +1,6 @@
# CJDNS support in Hush # CJDNS support in DragonX
It is possible to run Hush over CJDNS, an encrypted IPv6 network that It is possible to run DragonX over CJDNS, an encrypted IPv6 network that
uses public-key cryptography for address allocation and a distributed hash table uses public-key cryptography for address allocation and a distributed hash table
for routing. for routing.
@@ -9,7 +9,7 @@ for routing.
CJDNS is like a distributed, shared VPN with multiple entry points where every CJDNS is like a distributed, shared VPN with multiple entry points where every
participant can reach any other participant. All participants use addresses from participant can reach any other participant. All participants use addresses from
the `fc00::/8` network (reserved IPv6 range). Installation and configuration is the `fc00::/8` network (reserved IPv6 range). Installation and configuration is
done outside of Hush, similarly to a VPN (either in the host/OS or on done outside of DragonX, similarly to a VPN (either in the host/OS or on
the network router). See https://github.com/cjdelisle/cjdns#readme and the network router). See https://github.com/cjdelisle/cjdns#readme and
https://github.com/hyperboria/docs#hyperboriadocs for more information. https://github.com/hyperboria/docs#hyperboriadocs for more information.
@@ -17,7 +17,7 @@ Compared to IPv4/IPv6, CJDNS provides end-to-end encryption and protects nodes
from traffic analysis and filtering. from traffic analysis and filtering.
Used with Tor and I2P, CJDNS is a complementary option that can enhance network Used with Tor and I2P, CJDNS is a complementary option that can enhance network
redundancy and robustness for both the Hush network and individual nodes. redundancy and robustness for both the DragonX network and individual nodes.
Each network has different characteristics. For instance, Tor is widely used but Each network has different characteristics. For instance, Tor is widely used but
somewhat centralized. I2P connections have a source address and I2P is slow. somewhat centralized. I2P connections have a source address and I2P is slow.
@@ -30,7 +30,7 @@ To install and set up CJDNS, follow the instructions at
https://github.com/cjdelisle/cjdns#how-to-install-cjdns. https://github.com/cjdelisle/cjdns#how-to-install-cjdns.
You need to initiate an outbound connection to a peer on the CJDNS network You need to initiate an outbound connection to a peer on the CJDNS network
before it will work with your Hush node. This is described in steps before it will work with your DragonX node. This is described in steps
["2. Find a friend"](https://github.com/cjdelisle/cjdns#2-find-a-friend) and ["2. Find a friend"](https://github.com/cjdelisle/cjdns#2-find-a-friend) and
["3. Connect your node to your friend's ["3. Connect your node to your friend's
node"](https://github.com/cjdelisle/cjdns#3-connect-your-node-to-your-friends-node) node"](https://github.com/cjdelisle/cjdns#3-connect-your-node-to-your-friends-node)
@@ -65,19 +65,19 @@ with some additional setup.
The network connection can be checked by running `./tools/peerStats` from the The network connection can be checked by running `./tools/peerStats` from the
CJDNS directory. CJDNS directory.
## Run Hush with CJDNS ## Run DragonX with CJDNS
Once you are connected to the CJDNS network, the following Hush Once you are connected to the CJDNS network, the following DragonX
configuration option makes CJDNS peers automatically reachable: configuration option makes CJDNS peers automatically reachable:
``` ```
-cjdnsreachable -cjdnsreachable
``` ```
When enabled, this option tells Hush that it is running in an When enabled, this option tells DragonX that it is running in an
environment where a connection to an `fc00::/8` address will be to the CJDNS environment where a connection to an `fc00::/8` address will be to the CJDNS
network instead of to an [RFC4193](https://datatracker.ietf.org/doc/html/rfc4193) network instead of to an [RFC4193](https://datatracker.ietf.org/doc/html/rfc4193)
IPv6 local network. This helps Hush perform better address management: IPv6 local network. This helps DragonX perform better address management:
- Your node can consider incoming `fc00::/8` connections to be from the CJDNS - Your node can consider incoming `fc00::/8` connections to be from the CJDNS
network rather than from an IPv6 private one. network rather than from an IPv6 private one.
- If one of your node's local addresses is `fc00::/8`, then it can choose to - If one of your node's local addresses is `fc00::/8`, then it can choose to
@@ -93,20 +93,18 @@ Make automatic outbound connections only to CJDNS addresses. Inbound and manual
connections are not affected by this option. It can be specified multiple times connections are not affected by this option. It can be specified multiple times
to allow multiple networks, e.g. onlynet=cjdns, onlynet=i2p, onlynet=onion. to allow multiple networks, e.g. onlynet=cjdns, onlynet=i2p, onlynet=onion.
CJDNS support was added to Hush in version 3.9.3 and there may be fewer There may be fewer CJDNS peers than Tor or IP ones. You can use
CJDNS peers than Tor or IP ones. You can use `hush-cli -addrinfo` to see the `dragonx-cli -addrinfo` to see the number of CJDNS addresses known to your node.
number of CJDNS addresses known to your node.
In general, a node can be run with both an onion service and CJDNS (or any/all In general, a node can be run with both an onion service and CJDNS (or any/all
of IPv4/IPv6/onion/I2P/CJDNS), which can provide a potential fallback if one of of IPv4/IPv6/onion/I2P/CJDNS), which can provide a potential fallback if one of
the networks has issues. There are a number of ways to configure this; see the networks has issues. There are a number of ways to configure this; see
[doc/tor.md](https://git.hush.is/hush/hush3/src/branch/master/doc/tor.md) for [doc/tor.md](tor.md) for details.
details.
## CJDNS-related information in Hush ## CJDNS-related information in DragonX
There are several ways to see your CJDNS address in Hush: There are several ways to see your CJDNS address in DragonX:
- in the "localaddresses" output of RPC `getnetworkinfo` - in the "localaddresses" output of RPC `getnetworkinfo`
To see which CJDNS peers your node is connected to, use `hush-cli getpeerinfo` To see which CJDNS peers your node is connected to, use `dragonx-cli getpeerinfo`
RPC. RPC.

View File

@@ -1,10 +1,10 @@
# HUSH3.conf config options # DRAGONX.conf config options
This document explains all options that can be used in HUSH3.conf This document explains all options that can be used in DRAGONX.conf
# Basics # Basics
Options can either be put in HUSH3.conf or given on the `hushd` commandline when starting. If you think you will want to continually use a feature, it's better to put it in HUSH3.conf. If you don't, and start `hushd` without an option on accident, it can cause downtime from a long rescan, that you didn't want to do anyway. Options can either be put in DRAGONX.conf or given on the `dragonxd` commandline when starting. If you think you will want to continually use a feature, it's better to put it in DRAGONX.conf. If you don't, and start `dragonxd` without an option on accident, it can cause downtime from a long rescan, that you didn't want to do anyway.
## Common Options ## Common Options
@@ -15,20 +15,20 @@ Tells your node to connect to another node, by IP address or hostname.
## consolidation=1 ## consolidation=1
Defaults to 0 in CLI hushd, defaults to 1 in SilentDragon. This option consolidates many unspent shielded UTXOs (zutxos) into one zutxo, which makes spending them in the future faster and potentially cost less in fees. It also helps prevent Defaults to 0 in CLI dragonxd, and may default to 1 in GUI wallets that embed a full node. This option consolidates many unspent shielded UTXOs (zutxos) into one zutxo, which makes spending them in the future faster and potentially cost less in fees. It also helps prevent
certain kinds of metadata leakages and spam attacks. It is not recommended for very large wallets (wallet.dat files with thousands of transactions) for performance reasons. This is why it defaults to OFF for CLI full nodes but ON for GUI wallets that use an embedded hushd. certain kinds of metadata leakages and spam attacks. It is not recommended for very large wallets (wallet.dat files with thousands of transactions) for performance reasons. This is why it defaults to OFF for CLI full nodes but may be ON for GUI wallets that use an embedded dragonxd.
## rescan=1 ## rescan=1
Defaults to 0. Performs a full rescan of all of chain history. Can take a very long time. Speed this up with `rescanheight=123` to only rescan from a certain block height. Also speed this up with `keepnotewitnesscache=1` to not rebuild the zaddr witness cache. Defaults to 0. Performs a full rescan of all of chain history. Can take a very long time. Speed this up with `rescanheight=123` to only rescan from a certain block height. Also speed this up with `keepnotewitnesscache=1` to not rebuild the zaddr witness cache.
## rpcuser=hushpuppy ## rpcuser=yourusername
No default. This option sets the RPC username and should only be used in HUSH3.conf, because setting it from the command-line makes it show up in `ps` output. No default. This option sets the RPC username and should only be used in DRAGONX.conf, because setting it from the command-line makes it show up in `ps` output.
## rpcpassword=TOOMANYSECRETS ## rpcpassword=aLongRandomSecret
No default. This option sets the RPC password and should only be used in HUSH3.conf, because setting it from the command-line makes it show up in `ps` output. No default. This option sets the RPC password and should only be used in DRAGONX.conf, because setting it from the command-line makes it show up in `ps` output.
## txindex=1 ## txindex=1
@@ -56,7 +56,7 @@ Defaults to: bind to all interfaces. This option Binds to given address to liste
## stratumport=<port> ## stratumport=<port>
Defaults to 19031 or 19031 for testnet. This option sets the <port> to listen for Stratum work requests on. Defaults to 22769. This option sets the <port> to listen for Stratum work requests on.
## stratumallowip=<ip> ## stratumallowip=<ip>
@@ -68,12 +68,12 @@ These options are not commonly used and likely on for advanced users and/or deve
## addressindex=1 ## addressindex=1
Defaults to 0 in hushd, defaults to 1 in some GUI wallets. Maintain a full address index, used to query for the balance, txids and unspent outputs for addresses Defaults to 0 in dragonxd, defaults to 1 in some GUI wallets. Maintain a full address index, used to query for the balance, txids and unspent outputs for addresses
## timestampindex=1 ## timestampindex=1
Defaults to 0 in hushd, defaults to 1 in some GUI wallets. Maintain a timestamp index for block hashes, used to query blocks hashes by a range of timestamps Defaults to 0 in dragonxd, defaults to 1 in some GUI wallets. Maintain a timestamp index for block hashes, used to query blocks hashes by a range of timestamps
## spentindex=1 ## spentindex=1
Defaults to 0 in hushd, defaults to 1 in some GUI wallets. Maintain a full spent index, used to query the spending txid and input index for an outpoint Defaults to 0 in dragonxd, defaults to 1 in some GUI wallets. Maintain a full spent index, used to query the spending txid and input index for an outpoint

View File

@@ -5,11 +5,11 @@ First the basics, how to compile code in this repo.
First you will want to clone the code locally: First you will want to clone the code locally:
``` ```
git clone https://git.hush.is/hush/hush3 git clone https://git.dragonx.is/DragonX/dragonx
cd hush3 cd dragonx
``` ```
If you want to compile a branch other than master (the default), such as If you want to compile a branch other than `dragonx` (the default), such as
our development tip (the `dev` branch) you can switch to it: our development tip (the `dev` branch) you can switch to it:
``` ```
@@ -17,7 +17,7 @@ git checkout dev
``` ```
Then install needed dependencies. This is different on each OS as well as Then install needed dependencies. This is different on each OS as well as
older or newer systems. See https://git.hush.is/hush/hush3/src/branch/dev/INSTALL.md for older or newer systems. See the build instructions in the repo README for
details on installing dependencies. If you are using a recent-ish Ubuntu or Debian Linux details on installing dependencies. If you are using a recent-ish Ubuntu or Debian Linux
distro, this is probably what you need: distro, this is probably what you need:
@@ -59,20 +59,21 @@ A fresh sync preserves peers.dat, so it will always be faster than a "fresh clon
One way to do a fresh sync is: One way to do a fresh sync is:
``` ```
cd ~/.hush/HUSH3 cd ~/.hush/DRAGONX
rm blocks chainstate database notarizations hushstate rm -rf blocks chainstate database notarizations hushstate hushsignedmasks minerids
``` ```
NOTE: The legacy directory is ~/.komodo/HUSH3 and hushd will use data from either, or ~/.hush/HUSH3 if both exist. NOTE: The DragonX data directory is `~/.hush/DRAGONX`. The on-disk notarization/state
files are still named `hushstate`/`hushsignedmasks` (inherited names, not rebranded).
If you are using `zindex=1` then you need to also delete zindex.dat If you are using `zindex=1` then you need to also delete zindex.dat
``` ```
cd ~/.hush/HUSH3 cd ~/.hush/DRAGONX
rm zindex.dat blocks chainstate database notarizations hushstate rm -rf zindex.dat blocks chainstate database notarizations hushstate hushsignedmasks minerids
``` ```
It's possible to confused hush if you ran old code, stop, restart, and then write out zindex.dat that is incorrect, which later hushds will load from disk and believe. It's possible to confuse the node if you ran old code, stop, restart, and then write out a zindex.dat that is incorrect, which later dragonxd instances will load from disk and believe.
# Generating a backtrace from a coredump # Generating a backtrace from a coredump
@@ -93,12 +94,11 @@ core_filename` and then type bt to generate the backtrace.
For this repo, it's likely this is the command you need: For this repo, it's likely this is the command you need:
``` ```
gdb src/hushd core gdb src/dragonxd core
``` ```
NOTE: Even if you are debugging a coredump on a HAC, the file `src/blahd` NOTE: `src/blahd` is just a shell script that calls `src/dragonxd`; you always want to
is just a shell script that calls `src/hushd` and you always want to give an actual executable give an actual executable file as the first argument to `gdb`, not a bash script.
file as the first argument to `gdb`, not a bash script.
This link about Advanced GDB is very useful: https://interrupt.memfault.com/blog/advanced-gdb This link about Advanced GDB is very useful: https://interrupt.memfault.com/blog/advanced-gdb
@@ -113,7 +113,7 @@ unspendable funds mixed together. This can happen when you import a viewing key.
the address of a viewing key will have `spendable = false` : the address of a viewing key will have `spendable = false` :
hush-cli listunspent|jq '.[] | {spendable, address, amount} | select(.spendable != false)' dragonx-cli listunspent|jq '.[] | {spendable, address, amount} | select(.spendable != false)'
The above command will only show spendable UTXOs. The jq language is very powerful and is very The above command will only show spendable UTXOs. The jq language is very powerful and is very
useful for devops and developer scripts. useful for devops and developer scripts.
@@ -121,7 +121,7 @@ useful for devops and developer scripts.
The jq manual can be found here: https://stedolan.github.io/jq/manual/ The jq manual can be found here: https://stedolan.github.io/jq/manual/
# Making a new release of Hush # Making a new release of DragonX
See doc/release-process.md for details. See doc/release-process.md for details.
@@ -132,39 +132,39 @@ To test a branch called `zindexdb` with a fresh clone:
``` ```
# TODO: this should probably become a script in ./contrib # TODO: this should probably become a script in ./contrib
git clone https://git.hush.is/hush/hush3 hush3-testing git clone https://git.dragonx.is/DragonX/dragonx dragonx-testing
cd hush3-testing cd dragonx-testing
git checkout zindexdb git checkout zindexdb
# you need 2GB RAM free per -jN # you need 2GB RAM free per -jN
./build.sh -j2; make; make; make # this deals with build-system race condition bugs ./build.sh -j2; make; make; make # this deals with build-system race condition bugs
# we want to test a fresh sync, so backup current data # we want to test a fresh sync, so backup current data
TIME=`perl -e "print time"` TIME=`perl -e "print time"`
mv ~/.hush/{HUSH3,HUSH3-backup-$TIME} mv ~/.hush/{DRAGONX,DRAGONX-backup-$TIME}
mkdir ~/.hush/HUSH3 mkdir ~/.hush/DRAGONX
# Use your previous config as a base # Use your previous config as a base
cp ~/.hush/{HUSH3-backup-$TIME,HUSH3}/HUSH3.conf cp ~/.hush/{DRAGONX-backup-$TIME,DRAGONX}/DRAGONX.conf
# Add zindex to your node # Add zindex to your node
echo "zindex=1" >> ~/.hush/HUSH3/HUSH3.conf echo "zindex=1" >> ~/.hush/DRAGONX/DRAGONX.conf
# This is optional but will likely speed up sync time greatly # This is optional but will likely speed up sync time greatly
cp ~/.hush/{HUSH3-backup,HUSH3}/peers.dat cp ~/.hush/{DRAGONX-backup-$TIME,DRAGONX}/peers.dat
# This log file is helpful for debugging more and will contain a history of the # This log file is helpful for debugging more and will contain a history of the
# size of the anonset at every block height # size of the anonset at every block height
./src/hushd &> hushd.log & ./src/dragonxd &> dragonxd.log &
# to look at the log # to look at the log
tail -f hushd.log tail -f dragonxd.log
``` ```
To get a CSV file of the value of the anonset size for every block height: To get a CSV file of the value of the anonset size for every block height:
``` ```
grep anonset hushd.log | cut -d= -f2 > anonset.csv grep anonset dragonxd.log | cut -d= -f2 > anonset.csv
``` ```
This only needs to be calculated once, if we can verify it's correct. These are historical values that do not change. The goal is a web page with a historical view of the HUSH anonset size. This only needs to be calculated once, if we can verify it's correct. These are historical values that do not change. The goal is a web page with a historical view of the DRAGONX anonset size.
These values should match on all nodes: These values should match on all nodes:
@@ -180,17 +180,22 @@ These values should match on all nodes:
We should also check a recent block height to verify it's working correctly. The big "test" for this `zindexdb` branch is: We should also check a recent block height to verify it's working correctly. The big "test" for this `zindexdb` branch is:
* If you stop a node, and restart, are the stats from `getchaintxtstats` correct, i.e. the anonset stats? For instance, `shielded_pool_size` should be close to 500000, if it's close to or exactly 0, something is wrong. * If you stop a node, and restart, are the stats from `getchaintxtstats` correct, i.e. the anonset stats? For instance, `shielded_pool_size` should be close to 500000, if it's close to or exactly 0, something is wrong.
* Is there a new file called `zindex.dat` in `~/.hush/HUSH3/` ? * Is there a new file called `zindex.dat` in `~/.hush/DRAGONX/` ?
* Is `zindex.dat` 149 bytes ? * Is `zindex.dat` 149 bytes ?
# Adding a PoW algorithm # Adding a PoW algorithm
We will describe here the high-level ideas on how to add a new PoW algorithm to We will describe here the high-level ideas on how to add a new PoW algorithm to
the Hush codebase. Adding a new PoW algo means adding a new option to the `-ac_algo` the codebase. Adding a new PoW algo means adding a new option to the `-ac_algo`
CLI param for HSC's. CLI param.
Note: DragonX itself uses **RandomX** (CPU) as its Proof-of-Work — it is selected by
default for the DRAGONX chain (`isdragonx ? "randomx"` in `src/hush_utils.h`). The
generic `ASSETCHAINS_ALGORITHMS` array below still lists Equihash as its first element
(the array default), but that is not DragonX's algorithm.
* Add the new value to the end of the `ASSETCHAINS_ALGORITHMS` array in `src/hush_utils.h` * Add the new value to the end of the `ASSETCHAINS_ALGORITHMS` array in `src/hush_utils.h`
* You cannot add it to the front because the first element is the default "equihash" * You cannot add it to the front because the first element is the array default "equihash"
* You will also need to add a new constant, such as `ASSETCHAINS_FOOHASH` to `src/hush_globals.h` * You will also need to add a new constant, such as `ASSETCHAINS_FOOHASH` to `src/hush_globals.h`
* Increase the value of `ASSETCHAINS_NUMALGOS` by one * Increase the value of `ASSETCHAINS_NUMALGOS` by one
* This value cannot be automatically be determined by the length of the above array because Equihash has different supported variants of (N,K) values * This value cannot be automatically be determined by the length of the above array because Equihash has different supported variants of (N,K) values
@@ -263,7 +268,7 @@ on all categories (and give you a very large debug.log file).
**test coins** **test coins**
The main way to test new things is directly on mainnet or you can also make a The main way to test new things is directly on mainnet or you can also make a
Hush Arrakis Chain "testcoin" with a single command: `hushd -ac_name=COIN ...` test "testcoin" chain with a single command: `dragonxd -ac_name=COIN ...`
If you are testing something that can run on one machine you can use `-testnode=1` If you are testing something that can run on one machine you can use `-testnode=1`
which makes it so a single machine can create a new blockchain and mine blocks, i.e. which makes it so a single machine can create a new blockchain and mine blocks, i.e.
@@ -271,7 +276,7 @@ no peers are necessary.
**DEBUG_LOCKORDER** **DEBUG_LOCKORDER**
Hush is a multithreaded application, and deadlocks or other multithreading bugs DragonX is a multithreaded application, and deadlocks or other multithreading bugs
can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure can be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure
CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of which locks CXXFLAGS="-DDEBUG_LOCKORDER -g") inserts run-time checks to keep track of which locks
are held, and adds warnings to the debug.log file if inconsistencies are detected. are held, and adds warnings to the debug.log file if inconsistencies are detected.
@@ -306,7 +311,7 @@ Threads
- ThreadMapPort : Universal plug-and-play startup/shutdown - ThreadMapPort : Universal plug-and-play startup/shutdown
- ThreadSocketHandler : Sends/Receives data from peers on port 8233. - ThreadSocketHandler : Sends/Receives data from peers on the P2P port (18030 on DragonX mainnet).
- ThreadOpenAddedConnections : Opens network connections to added nodes. - ThreadOpenAddedConnections : Opens network connections to added nodes.
@@ -318,9 +323,9 @@ Threads
- ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used in 500ms. - ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used in 500ms.
- ThreadRPCServer : Remote procedure call handler, listens on port 8232 for connections and services them. - ThreadRPCServer : Remote procedure call handler, listens on the RPC port (21769 on DragonX mainnet) for connections and services them.
- HushMiner : Generates zcash (if wallet is enabled). - Miner threads : Generate DRAGONX blocks via RandomX (if wallet and mining are enabled).
- Shutdown : Does an orderly shutdown of everything. - Shutdown : Does an orderly shutdown of everything.

View File

@@ -1,11 +1,11 @@
# Expectations for DNS Seed operators # Expectations for DNS Seed operators
Hush attempts to minimize the level of trust in DNS seeds, DragonX attempts to minimize the level of trust in DNS seeds,
but DNS seeds still pose a small amount of risk for the network. but DNS seeds still pose a small amount of risk for the network.
As such, DNS seeds must be run by entities which have some minimum As such, DNS seeds must be run by entities which have some minimum
level of trust within the Hush community. level of trust within the DragonX community.
Other implementations of Hush software may also use the same Other implementations of DragonX software may also use the same
seeds and may be more exposed. In light of this exposure, this seeds and may be more exposed. In light of this exposure, this
document establishes some basic expectations for operating DNS seeds. document establishes some basic expectations for operating DNS seeds.
@@ -15,7 +15,7 @@ and not sell or transfer control of the DNS seed. Any hosting services
contracted by the operator are equally expected to uphold these expectations. contracted by the operator are equally expected to uphold these expectations.
1. The DNS seed results must consist exclusively of fairly selected and 1. The DNS seed results must consist exclusively of fairly selected and
functioning Hush nodes from the public network to the best of the functioning DragonX nodes from the public network to the best of the
operator's understanding and capability. operator's understanding and capability.
2. For the avoidance of doubt, the results may be randomized but must not 2. For the avoidance of doubt, the results may be randomized but must not
@@ -25,7 +25,7 @@ urgent technical necessity and disclosed.
3. The results may not be served with a DNS TTL of less than one minute. 3. The results may not be served with a DNS TTL of less than one minute.
4. Any logging of DNS queries should be only that which is necessary 4. Any logging of DNS queries should be only that which is necessary
for the operation of the service or urgent health of the Hush for the operation of the service or urgent health of the DragonX
network and must not be retained longer than necessary nor disclosed network and must not be retained longer than necessary nor disclosed
to any third party. to any third party.
@@ -41,13 +41,8 @@ details of their operating practices.
related to the DNS seed operation. related to the DNS seed operation.
If these expectations cannot be satisfied the operator should discontinue If these expectations cannot be satisfied the operator should discontinue
providing services and contact the active Hush development team as well as providing services and contact the active DragonX development team as well as
creating an issue in the [Hush Git repository](https://git.hush.is./hush/hush3). creating an issue in the [DragonX Git repository](https://git.dragonx.is/DragonX/dragonx).
Behavior outside of these expectations may be reasonable in some Behavior outside of these expectations may be reasonable in some
situations but should be discussed in public in advance. situations but should be discussed in public in advance.
See also
----------
- [hush-seeder](https://git.hush.is/hush/hush-seeder) is a reference
implementation of a DNS seed.

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
<defs>
<style>
.cls-1 {
fill: #fff;
}
.cls-2 {
fill: #d82652;
}
</style>
</defs>
<path class="cls-2" d="M103.98,128s-6.29-24.7-18.73-34.43c-8.53-8.03-15.63-16.49-21.25-24.16-5.62,7.68-12.72,16.17-21.25,24.16-12.4,9.74-18.73,34.43-18.73,34.43-2.38-24.34,7.85-35.82,12.87-41.29,7.82-8.5,15.31-16.56,21.75-25.02-7.64-11.44-11.41-19.72-11.41-19.72-.89-3.27-3.84-6.64-3.84-6.64,6.08-8.1-1.6-16.98-1.6-16.98,5.79-5.62,6.71-10.02,8.32-18.34-1.96,22.35,4.02,39.09,13.93,54.12,9.84-15.03,15.81-31.77,13.86-54.12,1.6,8.35,2.52,12.72,8.32,18.34,0,0-7.68,8.88-1.6,16.98,0,0-2.95,3.38-3.84,6.64,0,0-3.77,8.28-11.37,19.72,6.43,8.45,13.97,16.56,21.75,25.02,4.97,5.47,15.21,16.95,12.83,41.29h0Z"/>
<g>
<path class="cls-1" d="M55.33,61.62c-3.55,4.55-7.39,8.99-11.44,13.47-5.29-4.48-11.23-5.33-11.23-5.33,22.92-7.82,2.81-15.17.28-16.31C9.28,42.78,9.1,14.78,9.1,14.78c11.51,34.15,36.42,32.3,36.42,32.3.35-.21.67-.46.92-.71,1.64,3.27,4.58,8.67,8.88,15.24h0Z"/>
<g>
<path class="cls-1" d="M68.62,40.41c-1.35,2.98-2.91,5.83-4.62,8.63-1.71-2.81-3.23-5.69-4.62-8.63,1.74-3.45,4.62-20.58,4.62-20.58,0,0,2.88,17.13,4.62,20.58Z"/>
<path class="cls-1" d="M76.01,97.93l-3.48,2.34s-.1-4.44-3.52-1.84c-.42.32-2.38,2.21-.03,4.27,0,0-4.05,4.08-4.97,8.21-.92-4.12-4.97-8.21-4.97-8.21,2.34-2.06.39-3.95-.03-4.27-3.41-2.59-3.52,1.84-3.52,1.84l-3.48-2.34c.28-3.55.1-6.68-.46-9.42,4.69-4.94,8.85-9.88,12.47-14.61,3.66,4.72,7.78,9.67,12.47,14.61-.57,2.74-.75,5.86-.46,9.42Z"/>
<path class="cls-1" d="M95.34,69.76s-5.94.85-11.23,5.33c-4.02-4.48-7.89-8.92-11.44-13.47,4.3-6.57,7.25-11.98,8.88-15.24.25.25.57.5.92.71,0,0,24.91,1.84,36.42-32.3,0,0-.18,28-23.84,38.66-2.52,1.14-22.64,8.5.28,16.31h0Z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -1,17 +1,17 @@
# Hush Files # DragonX Files
* HUSH3.conf: contains configuration settings for hushd * DRAGONX.conf: contains configuration settings for dragonxd
* hushd.pid: stores the process id of hushd while running * dragonxd.pid: stores the process id of dragonxd while running
* blocks/blk000??.dat: block data (custom, 128 MiB per file) * blocks/blk000??.dat: block data (custom, 128 MiB per file)
* blocks/rev000??.dat; block undo data (custom) * blocks/rev000??.dat; block undo data (custom)
* blocks/index/*; block index (LevelDB) * blocks/index/*; block index (LevelDB)
* chainstate/*; block chain state database (LevelDB) * chainstate/*; block chain state database (LevelDB)
* database/*: BDB database environment * database/*: BDB database environment
* db.log: wallet database log file * db.log: wallet database log file
* debug.log: contains debug information and general logging generated by hushd * debug.log: contains debug information and general logging generated by dragonxd
* fee_estimates.dat: stores statistics used to estimate minimum transaction fees and priorities required for confirmation * fee_estimates.dat: stores statistics used to estimate minimum transaction fees and priorities required for confirmation
* peers.dat: peer IP address database (custom format) * peers.dat: peer IP address database (custom format)
* wallet.dat: personal wallet (BDB) with keys and transactions * wallet.dat: personal wallet (BDB) with keys and transactions
* zindex.dat: Optional file that stores anonset (shielded pool) stats. Only created if `zindex=1` in HUSH3.conf or `hushd -zindex` is used * zindex.dat: Optional file that stores anonset (shielded pool) stats. Only created if `zindex=1` in DRAGONX.conf or `dragonxd -zindex` is used
* .cookie: session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown): since 0.12.0 * .cookie: session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown): since 0.12.0
* onion_private_key: cached Tor hidden service private key for `-listenonion`: since 0.12.0 * onion_private_key: cached Tor hidden service private key for `-listenonion`: since 0.12.0

View File

@@ -17,10 +17,9 @@ where this data lives on your computer and then move some files around, then res
### On Linux ### On Linux
If you are on Linux, your wallet lives at `~/.hush/HUSH3/wallet.dat` or if you have a really old If you are on Linux, your wallet lives at `~/.hush/DRAGONX/wallet.dat`.
legacy wallet it could be at `~/.komodo/HUSH3/wallet.dat` . We will assume the first location.
What we will do is backup your entire `HUSH3` directory, including the blockchain data and wallet, What we will do is backup your entire `DRAGONX` directory, including the blockchain data and wallet,
then copy the wallet from there into a new directory. This is a non-destructive process that creates then copy the wallet from there into a new directory. This is a non-destructive process that creates
a new backup of your wallet. a new backup of your wallet.
@@ -28,25 +27,26 @@ a new backup of your wallet.
# Make sure your node is not running before doing any of this! # Make sure your node is not running before doing any of this!
# Doing this while your node is running could corrupt your wallet.dat # Doing this while your node is running could corrupt your wallet.dat
cd ~/.hush cd ~/.hush
mv HUSH3 HUSH3-backup # backup all data mv DRAGONX DRAGONX-backup # backup all data
mkdir HUSH3 # make a new dir mkdir DRAGONX # make a new dir
cp HUSH3-backup/wallet.dat HUSH3/wallet.dat # copy old wallet to new dir cp DRAGONX-backup/wallet.dat DRAGONX/wallet.dat # copy old wallet to new dir
``` ```
At this point if you are GUI user using SilentDragon, you can restart the GUI wallet At this point restart your node (`dragonxd`) and it will perform a fresh sync using your
and it should perform a fresh sync with your wallet. This will likely take at least wallet. This will likely take at least a few hours or much longer depending on your
a few hours or much longer depending on your internet connection. internet connection.
### On Windows ### On Windows
Basically you want to find where your Hush wallet is, move the directory that contains Basically you want to find where your DragonX wallet is, move the directory that contains
that wallet.dat file to a new name, then create that same directory and then copy wallet.dat into it. that wallet.dat file to a new name, then create that same directory and then copy wallet.dat into it.
Different versions of Windows store things in different locations. Different versions of Windows store things in different locations. Note the app-data folder is
named `Hush` (inherited) with a `DRAGONX` subdirectory.
For example your wallet might be in `C:\Users\Admin\AppData\Roaming\Hush\HUSH3\wallet.dat` . For example your wallet might be in `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX\wallet.dat` .
That means you need to That means you need to
* Rename the directory `C:\Users\Admin\AppData\Roaming\Hush\HUSH3` to something like `C:\Users\Admin\AppData\Roaming\Hush\HUSH3-backup` * Rename the directory `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX` to something like `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX-backup`
* Create a new directory called `C:\Users\Admin\AppData\Roaming\Hush\HUSH3` * Create a new directory called `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX`
* Copy the file `C:\Users\Admin\AppData\Roaming\Hush\HUSH3-backup\wallet.dat` to `C:\Users\Admin\AppData\Roaming\Hush\HUSH3` * Copy the file `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX-backup\wallet.dat` to `C:\Users\Admin\AppData\Roaming\Hush\DRAGONX`
* Now start the SilentDragon GUI wallet * Now start your DragonX node again

View File

@@ -1,24 +0,0 @@
# Hush Arrakis Chains
An overview of HSCs can be found here:
https://git.hush.is/hush/hush-smart-chains
Hush Arrakis Chains allow you to create a privacy coin with no custom C++ code, just running one command!
The new coin that is created can use either Equihash PoW (ASIC or GPU) or RandomX PoW (CPU).
## HSC Creator
https://git.hush.is/hush/hsc-creator with its site https://hush.is/hsc-creator
## HSC HOWTO
https://git.hush.is/onryo/hush-arrakis-chain-how-to
## HSC CLI
https://git.hush.is/jahway603/hsc-cli
## RandomX for HSCs
Detailed docs on how to use RandomX Proof-of-Work is here: https://git.hush.is/hush/hush3/src/branch/dev/doc/randomx.md

View File

@@ -1,35 +0,0 @@
# Systemd script for the Hush daemon
## Set it up
First set it up as follows:
* Copy hushd.service to the systemd user directory, which is /usr/lib/systemd/user directory
## Basic Usage
How to start the script:
`systemctl start --user hushd.service`
How to stop the script:
`systemctl stop --user hushd.service`
How to restart the script:
`systemctl restart --user hushd.service`
## How to watch it as it starts
Use the following on most Linux distros:
`watch systemctl status --user hushd.service`
If you're using Ubuntu 20.04, then try this instead as the above did not work for me on Ubuntu 20.04 server:
`tail -f ~/.hush/HUSH3/debug.log`
## Troubleshooting
* Don't run it with sudo or root, or it won't work with the wallet.
### To-do
* Determine why Ubuntu 20.04 didn't produce the expected outcome with watch and systemctl
* Create the hushd rc.d script
* Create the hushd runit script

View File

@@ -1,9 +0,0 @@
[Unit]
Description=Hush daemon
After=network.target
[Service]
ExecStart=/usr/bin/hushd
[Install]
WantedBy=default.target

View File

@@ -1,6 +1,6 @@
# I2P support in Hush # I2P support in DragonX
It is possible to run a Hush or HSC full node as an It is possible to run a DragonX full node as an
[I2P (Invisible Internet Project)](https://en.wikipedia.org/wiki/I2P) [I2P (Invisible Internet Project)](https://en.wikipedia.org/wiki/I2P)
service and connect to such services. service and connect to such services.
@@ -42,13 +42,13 @@ configuration options:
In a typical situation, this suffices: In a typical situation, this suffices:
``` ```
hushd -i2psam=127.0.0.1:7656 dragonxd -i2psam=127.0.0.1:7656
``` ```
The first time hushd connects to the I2P router, if The first time dragonxd connects to the I2P router, if
`-i2pacceptincoming=1`, then it will automatically generate a persistent I2P `-i2pacceptincoming=1`, then it will automatically generate a persistent I2P
address and its corresponding private key. The private key will be saved in a address and its corresponding private key. The private key will be saved in a
file named `i2p_private_key` in the Hush data directory. The persistent file named `i2p_private_key` in the DragonX data directory. The persistent
I2P address is used for accepting incoming connections and for making outgoing I2P address is used for accepting incoming connections and for making outgoing
connections if `-i2pacceptincoming=1`. If `-i2pacceptincoming=0` then only connections if `-i2pacceptincoming=1`. If `-i2pacceptincoming=0` then only
outbound I2P connections are made and a different transient I2P address is used outbound I2P connections are made and a different transient I2P address is used
@@ -71,8 +71,8 @@ Make automatic outbound connections only to I2P addresses. Inbound and manual
connections are not affected by this option. It can be specified multiple times connections are not affected by this option. It can be specified multiple times
to allow multiple networks, e.g. onlynet=onion, onlynet=i2p. to allow multiple networks, e.g. onlynet=onion, onlynet=i2p.
I2P support was added to Hush in version 3.9.3 and there may be fewer I2P There may be fewer I2P peers than Tor or IP ones. Therefore, using I2P alone
peers than Tor or IP ones. Therefore, using I2P alone without other networks may without other networks may
make a node more susceptible to [Sybil make a node more susceptible to [Sybil
attacks](https://en.bitcoin.it/wiki/Weaknesses#Sybil_attack). attacks](https://en.bitcoin.it/wiki/Weaknesses#Sybil_attack).
@@ -91,7 +91,7 @@ connection initiator. This is unlike the Tor network where the recipient does
not know who is connecting to them and can't tell if two connections are from not know who is connecting to them and can't tell if two connections are from
the same peer or not. the same peer or not.
If an I2P node is not accepting incoming connections, then Hush uses If an I2P node is not accepting incoming connections, then DragonX uses
random, one-time, transient I2P addresses for itself for outbound connections random, one-time, transient I2P addresses for itself for outbound connections
to make it harder to discriminate, fingerprint or analyze it based on its I2P to make it harder to discriminate, fingerprint or analyze it based on its I2P
address. address.
@@ -104,35 +104,35 @@ incoming I2P connections (`-i2pacceptincoming`):
- in the debug log (grep for `AddLocal`; the I2P address ends in `.b32.i2p`) - in the debug log (grep for `AddLocal`; the I2P address ends in `.b32.i2p`)
- in the i2p/i2pd web console under "SAM Sessions" - in the i2p/i2pd web console under "SAM Sessions"
To see which I2P peers your node is connected to, use `hush-cli getpeerinfo` To see which I2P peers your node is connected to, use `dragonx-cli getpeerinfo`
RPC. RPC.
## Compatibility ## Compatibility
Hush uses the [SAM v3.1](https://geti2p.net/en/docs/api/samv3) protocol DragonX uses the [SAM v3.1](https://geti2p.net/en/docs/api/samv3) protocol
to connect to the I2P network. Any I2P router that supports it can be used. to connect to the I2P network. Any I2P router that supports it can be used.
## Ports in I2P and Hush ## Ports in I2P and DragonX
Hush uses the [SAM v3.1](https://geti2p.net/en/docs/api/samv3) DragonX uses the [SAM v3.1](https://geti2p.net/en/docs/api/samv3)
protocol. One particularity of SAM v3.1 is that it does not support ports, protocol. One particularity of SAM v3.1 is that it does not support ports,
unlike newer versions of SAM (v3.2 and up) that do support them and default the unlike newer versions of SAM (v3.2 and up) that do support them and default the
port numbers to 0. From the point of view of peers that use newer versions of port numbers to 0. From the point of view of peers that use newer versions of
SAM or other protocols that support ports, a SAM v3.1 peer is connecting to them SAM or other protocols that support ports, a SAM v3.1 peer is connecting to them
on port 0, from source port 0. on port 0, from source port 0.
To allow future upgrades to newer versions of SAM, Hush sets its To allow future upgrades to newer versions of SAM, DragonX sets its
listening port to 0 when listening for incoming I2P connections and advertises listening port to 0 when listening for incoming I2P connections and advertises
its own I2P address with port 0. Furthermore, it will not attempt to connect to its own I2P address with port 0. Furthermore, it will not attempt to connect to
I2P addresses with a non-zero port number because with SAM v3.1 the destination I2P addresses with a non-zero port number because with SAM v3.1 the destination
port (`TO_PORT`) is always set to 0 and is not in the control of Hush. port (`TO_PORT`) is always set to 0 and is not in the control of DragonX.
## Bandwidth ## Bandwidth
By default, your node shares bandwidth and transit tunnels with the I2P network By default, your node shares bandwidth and transit tunnels with the I2P network
in order to increase your anonymity with cover traffic, help the I2P router used in order to increase your anonymity with cover traffic, help the I2P router used
by your node integrate optimally with the network, and give back to the network. by your node integrate optimally with the network, and give back to the network.
It's important that the nodes of a popular application like Hush contribute It's important that the nodes of a popular application like DragonX contribute
as much to the I2P network as they consume. as much to the I2P network as they consume.
It is possible, though strongly discouraged, to change your I2P router It is possible, though strongly discouraged, to change your I2P router
@@ -159,7 +159,7 @@ in [Embedding I2P in your Application](https://geti2p.net/en/docs/applications/e
In most cases, the default router settings should work fine. In most cases, the default router settings should work fine.
## Bundling I2P in a Hush application ## Bundling I2P in a DragonX application
Please see the "General Guidance for Developers" section in https://geti2p.net/en/docs/api/samv3 Please see the "General Guidance for Developers" section in https://geti2p.net/en/docs/api/samv3
if you are developing a downstream application that may be bundling I2P with Hush. if you are developing a downstream application that may be bundling I2P with DragonX.

View File

@@ -1,37 +1,39 @@
*** Warning: This document has not been updated for Hush and may be inaccurate. *** Sample init scripts and service configuration for dragonxd
Sample init scripts and service configuration for bitcoind
========================================================== ==========================================================
Sample scripts and configuration files for systemd, Upstart and OpenRC Sample scripts and configuration files for systemd, Upstart and OpenRC
can be found in the contrib/init folder. can be found in the contrib/init folder.
contrib/init/bitcoind.service: systemd service unit configuration contrib/init/dragonxd.service: systemd service unit configuration
contrib/init/bitcoind.openrc: OpenRC compatible SysV style init script contrib/init/dragonxd.openrc: OpenRC compatible SysV style init script
contrib/init/bitcoind.openrcconf: OpenRC conf.d file contrib/init/dragonxd.openrcconf: OpenRC conf.d file
contrib/init/bitcoind.conf: Upstart service configuration file contrib/init/dragonxd.conf: Upstart service configuration file
contrib/init/bitcoind.init: CentOS compatible SysV style init script contrib/init/dragonxd.init: CentOS compatible SysV style init script
For a simpler per-user systemd setup, see doc/dragonxd-systemd.md.
1. Service User 1. Service User
--------------------------------- ---------------------------------
All three startup configurations assume the existence of a "bitcoin" user All startup configurations assume the existence of a "hush" user
and group. They must be created before attempting to use these scripts. and group. They must be created before attempting to use these scripts.
(The service user is named "hush" for packaging compatibility across the
Hush lineage; renaming it is a separate packaging decision.)
2. Configuration 2. Configuration
--------------------------------- ---------------------------------
At a bare minimum, bitcoind requires that the rpcpassword setting be set At a bare minimum, dragonxd requires that the rpcpassword setting be set
when running as a daemon. If the configuration file does not exist or this when running as a daemon. If the configuration file does not exist or this
setting is not set, bitcoind will shutdown promptly after startup. setting is not set, dragonxd will shutdown promptly after startup.
This password does not have to be remembered or typed as it is mostly used This password does not have to be remembered or typed as it is mostly used
as a fixed token that bitcoind and client programs read from the configuration as a fixed token that dragonxd and client programs read from the configuration
file, however it is recommended that a strong and secure password be used file, however it is recommended that a strong and secure password be used
as this password is security critical to securing the wallet should the as this password is security critical to securing the wallet should the
wallet be enabled. wallet be enabled.
If bitcoind is run with "-daemon" flag, and no rpcpassword is set, it will If dragonxd is run with "-daemon" flag, and no rpcpassword is set, it will
print a randomly generated suitable password to stderr. You can also print a randomly generated suitable password to stderr. You can also
generate one from the shell yourself like this: generate one from the shell yourself like this:
@@ -39,24 +41,24 @@ bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'
For an example configuration file that describes the configuration settings, For an example configuration file that describes the configuration settings,
see contrib/debian/examples/bitcoin.conf. see contrib/debian/examples/DRAGONX.conf.
3. Paths 3. Paths
--------------------------------- ---------------------------------
All three configurations assume several paths that might need to be adjusted. All configurations assume several paths that might need to be adjusted.
Binary: /usr/bin/bitcoind Binary: /usr/bin/dragonxd
Configuration file: /etc/bitcoin/bitcoin.conf Configuration file: /etc/dragonx/DRAGONX.conf
Data directory: /var/lib/bitcoind Data directory: /var/lib/dragonxd
PID file: /var/run/bitcoind/bitcoind.pid (OpenRC and Upstart) PID file: /var/run/dragonxd/dragonxd.pid (OpenRC and Upstart)
/var/lib/bitcoind/bitcoind.pid (systemd) /var/lib/dragonxd/dragonxd.pid (systemd)
Lock file: /var/lock/subsys/bitcoind (CentOS) Lock file: /var/lock/subsys/dragonxd (CentOS)
The configuration file, PID directory (if applicable) and data directory The configuration file, PID directory (if applicable) and data directory
should all be owned by the bitcoin user and group. It is advised for security should all be owned by the hush user and group. It is advised for security
reasons to make the configuration file and data directory only readable by the reasons to make the configuration file and data directory only readable by the
bitcoin user and group. Access to bitcoin-cli and other bitcoind rpc clients hush user and group. Access to dragonx-cli and other dragonxd rpc clients
can then be controlled by group membership. can then be controlled by group membership.
4. Installing Service Configuration 4. Installing Service Configuration
@@ -68,19 +70,19 @@ Installing this .service file consists of just copying it to
/usr/lib/systemd/system directory, followed by the command /usr/lib/systemd/system directory, followed by the command
"systemctl daemon-reload" in order to update running systemd configuration. "systemctl daemon-reload" in order to update running systemd configuration.
To test, run "systemctl start bitcoind" and to enable for system startup run To test, run "systemctl start dragonxd" and to enable for system startup run
"systemctl enable bitcoind" "systemctl enable dragonxd"
4b) OpenRC 4b) OpenRC
Rename bitcoind.openrc to bitcoind and drop it in /etc/init.d. Double Rename dragonxd.openrc to dragonxd and drop it in /etc/init.d. Double
check ownership and permissions and make it executable. Test it with check ownership and permissions and make it executable. Test it with
"/etc/init.d/bitcoind start" and configure it to run on startup with "/etc/init.d/dragonxd start" and configure it to run on startup with
"rc-update add bitcoind" "rc-update add dragonxd"
4c) Upstart (for Debian/Ubuntu based distributions) 4c) Upstart (for Debian/Ubuntu based distributions)
Drop bitcoind.conf in /etc/init. Test by running "service bitcoind start" Drop dragonxd.conf in /etc/init. Test by running "service dragonxd start"
it will automatically start on reboot. it will automatically start on reboot.
NOTE: This script is incompatible with CentOS 5 and Amazon Linux 2014 as they NOTE: This script is incompatible with CentOS 5 and Amazon Linux 2014 as they
@@ -88,15 +90,18 @@ use old versions of Upstart and do not supply the start-stop-daemon utility.
4d) CentOS 4d) CentOS
Copy bitcoind.init to /etc/init.d/bitcoind. Test by running "service bitcoind start". Copy dragonxd.init to /etc/init.d/dragonxd. Test by running "service dragonxd start".
Using this script, you can adjust the path and flags to the bitcoind program by Using this script, you can adjust the path and flags to the dragonxd program by
setting the BITCOIND and FLAGS environment variables in the file setting the HUSHD_BIN and HUSHD_OPTS environment variables in the file
/etc/sysconfig/bitcoind. You can also use the DAEMONOPTS environment variable here. /etc/sysconfig/dragonxd. You can also use the DAEMONOPTS environment variable here.
(The HUSHD_* environment variable names are retained from the Hush lineage for
packaging compatibility.)
5. Auto-respawn 5. Auto-respawn
----------------------------------- -----------------------------------
Auto respawning is currently only configured for Upstart and systemd. Auto respawning is currently only configured for Upstart and systemd.
Reasonable defaults have been chosen but YMMV. Reasonable defaults have been chosen but YMMV.
</content>
</invoke>

View File

@@ -1,25 +1,31 @@
# Hush Overview # DragonX Overview
## Mining Algorithm ## Mining Algorithm
Equihash (200,9) (ASIC) RandomX (CPU). DragonX is CPU-mineable using the RandomX Proof-of-Work algorithm
(the same family used by Monero). ASIC and GPU mining are not applicable. See
[randomx.md](randomx.md) for details.
## Block time ## Block time
75 seconds 36 seconds
## Block reward
3 DRAGONX per block, halving every 3,500,000 blocks.
## Block size ## Block size
4MB 4 MB (consensus maximum)
## P2P ## P2P
TLS1.3 via WolfSSL is enforced for all network connections as of v3.6.1 . TLS1.3 via WolfSSL is enforced for all network connections. Many ciphersuites are
Many ciphersuites are technically supported by TLS1.3 but many of them technically supported by TLS1.3 but many of them are ancient, proved to be less secure
are ancient, proved to be less secure than intended or likely backdoored. than intended or likely backdoored. DragonX only uses what are widely considered to be the
Hush only uses what are widely considered to be the most secure and [best ciphersuites](https://ciphersuite.info/cs/). most secure and [best ciphersuites](https://ciphersuite.info/cs/).
New Hush P2P connections randomly choose between these two ciphersuites each New DragonX P2P connections randomly choose between these two ciphersuites each
time a new connection to a peer is created: time a new connection to a peer is created:
* `TLS_AES_256_GCM_SHA384` * `TLS_AES_256_GCM_SHA384`
@@ -35,10 +41,18 @@ IP address owns which addresses.
## RPC ## RPC
Inherited many RPC's from Bitcoin and Zcash with many new ones Inherited many RPCs from Bitcoin and Zcash, with many new ones.
## Consensus ## Consensus
Hush is a mandatory privacy blockchain as of Block 340000 (Nov 2020), DragonX is a fully private blockchain from genesis. The consensus parameter
which means you can only send to a shielded address, never to a transparent `ac_private=1` is active from block 1 and Sapling is active at height 1, so every
address. This is enforced via consensus rules and sometimes called "z2z". non-coinbase output must be shielded — you can only send to a shielded (`zs...`)
address, never to a transparent address. This is sometimes called "z2z". Unlike
chains that switched on mandatory privacy at a later height, DragonX enforces it
from the very first block.
Transparent addresses exist only to receive mining coinbase; mature coinbase is
directly spendable and is not required to be shielded first (shielding it with
`z_shieldcoinbase` is an optional privacy step). See
[hd-transparent-keys.md](hd-transparent-keys.md).

View File

@@ -1,28 +1,28 @@
# Hush Payment API # DragonX Payment API
## Overview ## Overview
Hush extends the Bitcoin Core API with new RPC calls to support private Hush payments involving shielded addresses (zaddrs). DragonX extends the Bitcoin Core API with new RPC calls to support private DragonX payments involving shielded addresses (zaddrs).
Hush payments make use of two address formats: DragonX payments make use of two address formats:
* taddr - an address for transparent funds (just like a Bitcoin address, value stored in UTXOs) * taddr - an address for transparent funds (just like a Bitcoin address, value stored in UTXOs)
* zaddr - an address for private funds (value stored in objects called notes) * zaddr - an address for private funds (value stored in objects called notes)
As of Block 340000, taddrs cannot be recipients of transactions, they can only mine new coinbase funds, which must then be sent to a zaddr. DragonX is a fully private chain from genesis (`ac_private=1`, Sapling active at height 1): taddrs can never be recipients of transactions. Transparent addresses only ever receive mining coinbase, which is directly spendable and may optionally be shielded to a zaddr with `z_shieldcoinbase`.
When a transfer involves zaddrs, you must use the new Hush RPC calls, such as `z_sendmany`. When a transfer involves zaddrs, you must use the DragonX RPC calls, such as `z_sendmany`.
## Compatibility with Bitcoin Core ## Compatibility with Bitcoin Core
Hush supports all commands in the Bitcoin Core API (as of version 0.11.2). Where applicable, Hush will extend commands in a backwards-compatible way to enable additional functionality. DragonX supports all commands in the Bitcoin Core API (as of version 0.11.2). Where applicable, DragonX will extend commands in a backwards-compatible way to enable additional functionality.
We do not recommend use of accounts which are now deprecated in Bitcoin Core. Where the account parameter exists in the API, please use “” as its value, otherwise an error will be returned. We do not recommend use of accounts which are now deprecated in Bitcoin Core. Where the account parameter exists in the API, please use “” as its value, otherwise an error will be returned.
To support multiple users in a single nodes wallet, consider using getnewaddress or z_getnewaddress to obtain a new address for each user. Also consider mapping multiple addresses to each user. To support multiple users in a single nodes wallet, consider using getnewaddress or z_getnewaddress to obtain a new address for each user. Also consider mapping multiple addresses to each user.
## List of Hush API commands ## List of DragonX API commands
Optional parameters are denoted in [square brackets]. Optional parameters are denoted in [square brackets].
@@ -39,7 +39,7 @@ RPC parameter conventions:
* taddr : Transparent address * taddr : Transparent address
* zaddr : Private address * zaddr : Private address
* address : Accepts both private and transparent addresses. * address : Accepts both private and transparent addresses.
* amount : JSON format decimal number with at most 8 digits of precision, with 1 HUSH expressed as 1.00000000. * amount : JSON format decimal number with at most 8 digits of precision, with 1 DRAGONX expressed as 1.00000000.
* memo : Metadata expressed in hexadecimal format. Limited to 512 bytes, the current size of the memo field of a private transaction. Zero padding is automatic. * memo : Metadata expressed in hexadecimal format. Limited to 512 bytes, the current size of the memo field of a private transaction. Zero padding is automatic.
### Accounting ### Accounting
@@ -53,18 +53,18 @@ z_gettotalbalance<br>| [minconf=1] | Return the total value of funds stored in t
Command | Parameters | Description Command | Parameters | Description
--- | --- | --- --- | --- | ---
z_getnewaddress | | Return a new zaddr for sending and receiving payments. The spending key for this zaddr will be added to the nodes wallet.<br><br>Output:<br>zN68D8hSs3... z_getnewaddress | | Return a new Sapling zaddr for sending and receiving payments. The spending key for this zaddr will be added to the nodes wallet.<br><br>Output:<br>zs1...
z_listaddresses | | Returns a list of all the zaddrs in this nodes wallet for which you have a spending key.<br><br>Output:<br>{ [“z123…”, “z456...”, “z789...”] } z_listaddresses | | Returns a list of all the zaddrs in this nodes wallet for which you have a spending key.<br><br>Output:<br>{ [“zs1…”, “zs1...”, “zs1...”] }
z_validateaddress | zaddr | Return information about a given zaddr.<br><br>Output:<br>{"isvalid" : true,<br>"address" : "zcWsmq...",<br>"type" : "sprout",<br>"payingkey" : "f5bb3c...",<br>"transmissionkey" : "7a58c7...",<br>"ismine" : true} z_validateaddress | zaddr | Return information about a given Sapling zaddr.<br><br>Output:<br>{"isvalid" : true,<br>"address" : "zs1...",<br>"type" : "sapling",<br>"diversifier" : "f5bb3c...",<br>"diversifiedtransmissionkey" : "7a58c7...",<br>"ismine" : true}
### Key Management ### Key Management
Command | Parameters | Description Command | Parameters | Description
--- | --- | --- --- | --- | ---
z_exportkey | zaddr | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Return a zkey for a given zaddr belonging to the nodes wallet.<br><br>The key will be returned as a string formatted using Base58Check as described in the Hush protocol spec.<br><br>Output:AKWUAkypwQjhZ6LLNaMuuuLcmZ6gt5UFyo8m3jGutvALmwZKLdR5 z_exportkey | zaddr | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Return a zkey for a given zaddr belonging to the nodes wallet.<br><br>The key will be returned as a string formatted using Base58Check as described in the DragonX protocol spec.<br><br>Output:AKWUAkypwQjhZ6LLNaMuuuLcmZ6gt5UFyo8m3jGutvALmwZKLdR5
z_importkey | zkey [rescan=true] | _Wallet must be unlocked._<br><br>Add a zkey as returned by z_exportkey to a node's wallet.<br><br>The key should be formatted using Base58Check as described in the Hush protocol spec.<br><br>Set rescan to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transactions affecting the newly-added address for this spending key). z_importkey | zkey [rescan=true] | _Wallet must be unlocked._<br><br>Add a zkey as returned by z_exportkey to a node's wallet.<br><br>The key should be formatted using Base58Check as described in the DragonX protocol spec.<br><br>Set rescan to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transactions affecting the newly-added address for this spending key).
z_exportwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Creates or overwrites a file with taddr private keys and zaddr private keys in a human-readable format.<br><br>Filename is the file in which the wallet dump will be placed. May be prefaced by an absolute file path. An existing file with that name will be overwritten.<br><br>No value is returned but a JSON-RPC error will be reported if a failure occurred. z_exportwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Creates or overwrites a file with taddr private keys and zaddr private keys in a human-readable format.<br><br>Filename is the file in which the wallet dump will be placed. May be prefaced by an absolute file path. An existing file with that name will be overwritten.<br><br>No value is returned but a JSON-RPC error will be reported if a failure occurred.
z_importwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Imports private keys from a file in wallet export file format (see z_exportwallet). These keys will be added to the keys currently in the wallet. This call may need to rescan all or parts of the block chain for transactions affecting the newly-added keys, which may take several minutes.<br><br>Filename is the file to import. The path is relative to hushds working directory.<br><br>No value is returned but a JSON-RPC error will be reported if a failure occurred. z_importwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Imports private keys from a file in wallet export file format (see z_exportwallet). These keys will be added to the keys currently in the wallet. This call may need to rescan all or parts of the block chain for transactions affecting the newly-added keys, which may take several minutes.<br><br>Filename is the file to import. The path is relative to dragonxds working directory.<br><br>No value is returned but a JSON-RPC error will be reported if a failure occurred.
z_exportviewingkey | zaddr | Reveals the viewing key corresponding to 'zaddr'. Then the z_importviewingkey can be used with this output. z_exportviewingkey | zaddr | Reveals the viewing key corresponding to 'zaddr'. Then the z_importviewingkey can be used with this output.
z_importviewingkey | vkey [rescan=whenkeyisnew] [startHeight=0] | Adds a viewing key (as returned by z_exportviewingkey) to your wallet. z_importviewingkey | vkey [rescan=whenkeyisnew] [startHeight=0] | Adds a viewing key (as returned by z_exportviewingkey) to your wallet.
@@ -75,7 +75,7 @@ Command | Parameters | Description
--- | --- | --- --- | --- | ---
z_listreceivedbyaddress<br> | zaddr [minconf=1] | Return a list of amounts received by a zaddr belonging to the nodes wallet.<br><br>Optionally set the minimum number of confirmations which a received amount must have in order to be included in the result. Use 0 to count unconfirmed transactions.<br><br>Output:<br>[{<br>“txid”: “4a0f…”,<br>“amount”: 0.54,<br>“memo”:”F0FF…”,}, {...}, {...}<br>] z_listreceivedbyaddress<br> | zaddr [minconf=1] | Return a list of amounts received by a zaddr belonging to the nodes wallet.<br><br>Optionally set the minimum number of confirmations which a received amount must have in order to be included in the result. Use 0 to count unconfirmed transactions.<br><br>Output:<br>[{<br>“txid”: “4a0f…”,<br>“amount”: 0.54,<br>“memo”:”F0FF…”,}, {...}, {...}<br>]
z_listunspent | [minconf=1] [maxconf=9999999] [includeWatchonly=false] [zaddrs] | Returns array of unspent shielded notes with between minconf and maxconf (inclusive) confirmations.<br><br>Optionally filter to only include notes sent to specified addresses.<br><br>When minconf is 0, unspent notes with zero confirmations are returned, even though they are not immediately spendable.<br><br>Results are an array of Objects, each of which has: {txid, jsindex, jsoutindex, confirmations, address, amount, memo} z_listunspent | [minconf=1] [maxconf=9999999] [includeWatchonly=false] [zaddrs] | Returns array of unspent shielded notes with between minconf and maxconf (inclusive) confirmations.<br><br>Optionally filter to only include notes sent to specified addresses.<br><br>When minconf is 0, unspent notes with zero confirmations are returned, even though they are not immediately spendable.<br><br>Results are an array of Objects, each of which has: {txid, jsindex, jsoutindex, confirmations, address, amount, memo}
z_sendmany<br> | fromaddress amounts [minconf=1] [fee=0.0001] | _This is an Asynchronous RPC call_<br><br>Send funds from an address to multiple outputs. The address can be either a taddr or a zaddr.<br><br>Amounts is a list containing key/value pairs corresponding to the addresses and amount to pay. Each output address can be in taddr or zaddr format.<br><br>When sending to a zaddr, you also have the option of attaching a memo in hexadecimal format.<br><br>**NOTE:**When sending coinbase funds to a zaddr, the node's wallet does not allow any change. Put another way, spending a partial amount of a coinbase utxo is not allowed. This is not a consensus rule but a local wallet rule due to the current implementation of z_sendmany. In future, this rule may be removed.<br><br>Example of Outputs parameter:<br>[{“address”:”t123…”, “amount”:0.005},<br>,{“address”:”z010…”,”amount”:0.03, “memo”:”f508af…”}]<br><br>Optionally set the minimum number of confirmations which a private or transparent transaction must have in order to be used as an input. When sending from a zaddr, minconf must be greater than zero.<br><br>Optionally set a transaction fee, which by default is 0.0001 HUSH.<br><br>Any transparent change will be sent to a new transparent address. Any private change will be sent back to the zaddr being used as the source of funds.<br><br>Returns an operationid. You use the operationid value with z_getoperationstatus and z_getoperationresult to obtain the result of sending funds, which if successful, will be a txid. z_sendmany<br> | fromaddress amounts [minconf=1] [fee=0.0001] | _This is an Asynchronous RPC call_<br><br>Send funds from an address to multiple outputs. The address can be either a taddr or a zaddr.<br><br>Amounts is a list containing key/value pairs corresponding to the addresses and amount to pay. Each output address can be in taddr or zaddr format.<br><br>When sending to a zaddr, you also have the option of attaching a memo in hexadecimal format.<br><br>**NOTE:**When sending coinbase funds to a zaddr, the node's wallet does not allow any change. Put another way, spending a partial amount of a coinbase utxo is not allowed. This is not a consensus rule but a local wallet rule due to the current implementation of z_sendmany. In future, this rule may be removed.<br><br>Example of Outputs parameter:<br>[{“address”:”t123…”, “amount”:0.005},<br>,{“address”:”z010…”,”amount”:0.03, “memo”:”f508af…”}]<br><br>Optionally set the minimum number of confirmations which a private or transparent transaction must have in order to be used as an input. When sending from a zaddr, minconf must be greater than zero.<br><br>Optionally set a transaction fee, which by default is 0.0001 DRAGONX.<br><br>Any transparent change will be sent to a new transparent address. Any private change will be sent back to the zaddr being used as the source of funds.<br><br>Returns an operationid. You use the operationid value with z_getoperationstatus and z_getoperationresult to obtain the result of sending funds, which if successful, will be a txid.
z_shieldcoinbase<br> | fromaddress toaddress [fee=0.0001] [limit=50] | _This is an Asynchronous RPC call_<br><br>Shield transparent coinbase funds by sending to a shielded z address. Utxos selected for shielding will be locked. If there is an error, they are unlocked. The RPC call `listlockunspent` can be used to return a list of locked utxos.<br><br>The number of coinbase utxos selected for shielding can be set with the limit parameter, which has a default value of 50. If the parameter is set to 0, the number of utxos selected is limited by the `-mempooltxinputlimit` option. Any limit is constrained by a consensus rule defining a maximum transaction size of 100000 bytes. <br><br>The from address is a taddr or "*" for all taddrs belonging to the wallet. The to address is a zaddr. The default fee is 0.0001.<br><br>Returns an object containing an operationid which can be used with z_getoperationstatus and z_getoperationresult, along with key-value pairs regarding how many utxos are being shielded in this transaction and what remains to be shielded. z_shieldcoinbase<br> | fromaddress toaddress [fee=0.0001] [limit=50] | _This is an Asynchronous RPC call_<br><br>Shield transparent coinbase funds by sending to a shielded z address. Utxos selected for shielding will be locked. If there is an error, they are unlocked. The RPC call `listlockunspent` can be used to return a list of locked utxos.<br><br>The number of coinbase utxos selected for shielding can be set with the limit parameter, which has a default value of 50. If the parameter is set to 0, the number of utxos selected is limited by the `-mempooltxinputlimit` option. Any limit is constrained by a consensus rule defining a maximum transaction size of 100000 bytes. <br><br>The from address is a taddr or "*" for all taddrs belonging to the wallet. The to address is a zaddr. The default fee is 0.0001.<br><br>Returns an object containing an operationid which can be used with z_getoperationstatus and z_getoperationresult, along with key-value pairs regarding how many utxos are being shielded in this transaction and what remains to be shielded.
### Operations ### Operations
@@ -105,13 +105,13 @@ It is currently not possible to cancel operations.
Command | Parameters | Description Command | Parameters | Description
--- | --- | --- --- | --- | ---
z_getoperationresult <br>| [operationids] | Return OperationStatus JSON objects for all completed operations the node is currently aware of, and then remove the operation from memory.<br><br>Operationids is an optional array to filter which operations you want to receive status objects for.<br><br>Output is a list of operation status objects, where the status is either "failed", "cancelled" or "success".<br>[<br>{“operationid”: “opid-11ee…”,<br>“status”: “cancelled”},<br>{“operationid”: “opid-9876”, “status”: ”failed”},<br>{“operationid”: “opid-0e0e”,<br>“status”:”success”,<br>“execution_time”:”25”,<br>“result”: {“txid”:”af3887654…”,...}<br>},<br>]<br><br> Examples:<br>hush-cli z_getoperationresult '["opid-8120fa20-5ee7-4587-957b-f2579c2d882b"]'<br> hush-cli z_getoperationresult z_getoperationresult <br>| [operationids] | Return OperationStatus JSON objects for all completed operations the node is currently aware of, and then remove the operation from memory.<br><br>Operationids is an optional array to filter which operations you want to receive status objects for.<br><br>Output is a list of operation status objects, where the status is either "failed", "cancelled" or "success".<br>[<br>{“operationid”: “opid-11ee…”,<br>“status”: “cancelled”},<br>{“operationid”: “opid-9876”, “status”: ”failed”},<br>{“operationid”: “opid-0e0e”,<br>“status”:”success”,<br>“execution_time”:”25”,<br>“result”: {“txid”:”af3887654…”,...}<br>},<br>]<br><br> Examples:<br>dragonx-cli z_getoperationresult '["opid-8120fa20-5ee7-4587-957b-f2579c2d882b"]'<br> dragonx-cli z_getoperationresult
z_getoperationstatus <br>| [operationids] | Return OperationStatus JSON objects for all operations the node is currently aware of.<br><br>Operationids is an optional array to filter which operations you want to receive status objects for.<br><br>Output is a list of operation status objects.<br>[<br>{“operationid”: “opid-12ee…”,<br>“status”: “queued”},<br>{“operationid”: “opd-098a…”, “status”: ”executing”},<br>{“operationid”: “opid-9876”, “status”: ”failed”}<br>]<br><br>When the operation succeeds, the status object will also include the result.<br><br>{“operationid”: “opid-0e0e”,<br>“status”:”success”,<br>“execution_time”:”25”,<br>“result”: {“txid”:”af3887654…”,...}<br>} z_getoperationstatus <br>| [operationids] | Return OperationStatus JSON objects for all operations the node is currently aware of.<br><br>Operationids is an optional array to filter which operations you want to receive status objects for.<br><br>Output is a list of operation status objects.<br>[<br>{“operationid”: “opid-12ee…”,<br>“status”: “queued”},<br>{“operationid”: “opd-098a…”, “status”: ”executing”},<br>{“operationid”: “opid-9876”, “status”: ”failed”}<br>]<br><br>When the operation succeeds, the status object will also include the result.<br><br>{“operationid”: “opid-0e0e”,<br>“status”:”success”,<br>“execution_time”:”25”,<br>“result”: {“txid”:”af3887654…”,...}<br>}
z_listoperationids <br>| [state] | Return a list of operationids for all operations which the node is currently aware of.<br><br>State is an optional string parameter to filter the operations you want listed by their state. Acceptable parameter values are queued, executing, success, failed, cancelled.<br><br>[“opid-0e0e…”, “opid-1af4…”, … ] z_listoperationids <br>| [state] | Return a list of operationids for all operations which the node is currently aware of.<br><br>State is an optional string parameter to filter the operations you want listed by their state. Acceptable parameter values are queued, executing, success, failed, cancelled.<br><br>[“opid-0e0e…”, “opid-1af4…”, … ]
## Asynchronous RPC call Error Codes ## Asynchronous RPC call Error Codes
Hush error codes are defined in https://git.hush.is/hush/hush3/src/branch/master/src/rpc/protocol.h DragonX error codes are defined in https://git.dragonx.is/DragonX/dragonx/src/branch/dragonx/src/rpc/protocol.h
### z_sendmany error codes ### z_sendmany error codes

View File

@@ -1,75 +1,69 @@
# RandomX # How DragonX uses RandomX
Hush Arrakis Chains support using RandomX as a Proof-Of-Work algorithm as of release 3.9.2 . DragonX uses **RandomX** as its Proof-of-Work algorithm. RandomX is CPU-friendly
This means you can now launch a privacy coin with Hush tech that can be mined with a CPU and ASIC/GPU-resistant, which keeps mining accessible to ordinary hardware.
instead of requiring an ASIC or GPU. RandomX is the same algorithm that Monero (XMR) and RandomX is the same family of algorithm that Monero (XMR) and various other
various other cryptocoins use. As far as we know, Hush Arrakis Chains are the first coins coins use, though DragonX uses its own configuration (see "RandomX Internals"
based on Zcash Protocol that can use the RandomX PoW algorithm. Many thanks to all the below), so DragonX RandomX is not compatible with Monero mining hardware.
people who helped make this possible.
# Example DragonX descends from the Hush lineage (Bitcoin -> Zcash -> Komodo -> Hush ->
DragonX). The RandomX integration in this codebase originates from that Hush
work; DragonX ships it as a fixed part of consensus rather than as a launcher
option.
The following command can be used to launch an HSC on a single computer. Each option will be explained. ## DragonX consensus parameters
HSC CLI arguments that start with `-ac_` means they *Affect Consensus*.
DragonX is a single, fully private chain. Its consensus is fixed (you do not
pass `-ac_*` arguments to run a DragonX node):
* **PoW algorithm:** RandomX (CPU mineable)
* **Block time:** 36 seconds on average
* **Block reward:** 3 DRAGONX per block
* **Halving:** every 3,500,000 blocks
* **Private from genesis:** `ac_private=1`, with Sapling active at height 1.
Transparent sends are banned from block 1; transparent addresses only
receive mining coinbase (directly spendable, shielding optional). There is
no "privacy switches on later" phase — DragonX is private from the very
first block.
To run a DragonX node and mine on the network, use `dragonxd` (mining is
enabled with `-gen=1` and CPU threads set via `-genproclimit=N`), for example:
``` ```
./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 ./src/dragonxd -gen=1 -genproclimit=1
``` ```
* `hush-arrakis-chain` is the script used to launch or connect to HSCs You do not need to choose an algorithm, block time, reward, or supply — these
* It lives in the `./src` directory, next to `hushd` and `hush-cli` are baked into DragonX consensus.
* It is called `hush-arrakis-chain.bat` on Windows
* `-ac_halving=100` means "the block reward halves every 100 blocks"
* `-ac_algo=randomx` means "use RandomX for Proof-Of-Work
* The default is Equihash (200,9)
* `-ac_name=RANDOMX` sets the name of the HSC to RANDOMX
* `-ac_private=1` means only z2z transactions will be allowed, like HUSH mainnet
* `-ac_blocktime=15` means blocks will be 15 seconds on average
* The default is 60 seconds
* `-ac_reward=500000000` means the block reward will start at 5 RANDOMX coins per block
* This argument is given in satoshis
* `-ac_supply=55555` means an existing supply of 55555 will exist at block 1
* This argument is given in coins, not satoshis
* This is sometimes called a "pre-mine" and is useful when migrating an existing coin
* Block 0 of HSC's is always the BTC mainnet genesis block.
* So the genesis block of HSC's is actually block 1, not block 0
* `-gen=1` means this node is a mining node
* `-genproclimit=1` means use 1 CPU thread will be used for mining
* `-testnode=1` means only 1 node can be used to mine a genesis block
* testnode is primarily for testing, when launching a real genesis block, this option should not be used
* By default, at least two nodes are required to mine a genesis block
* One node would use
```
# first node
./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555
```
* And the second node would use:
```
# mining node. NOTE: This node will mine the genesis block and pre-mine, if any
./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1
```
# Advanced Options ## RandomX key-block tuning options
HUSH RandomX currently has two advanced options that some may want to use: RandomX periodically rotates the "key block" it derives its dataset from. Two
advanced options control this. They are inherited from the upstream Hush /
Arrakis-chain tooling and default to values suited to DragonX's 36s block time;
you should not normally change them:
* `ac_randomx_interval` controls how often the RandomX key block will change * `-ac_randomx_interval` controls how often the RandomX key block changes
* The default is 1024 blocks and is good for most use cases. * Default is 1024 blocks
* This corresponds to ~17 hours for HSCs with the default block time of 60s * At DragonX's 36s block time this is roughly ~10.2 hours
* `ac_randomx_lag` sets the number of blocks to wait before updating the key block * `-ac_randomx_lag` sets the number of blocks to wait before updating the key block
* The default is 64 blocks * Default is 64 blocks
* This corresponds to 64 mins for HSCs with the default block time of 60s * At DragonX's 36s block time this is roughly ~38 minutes
* `ac_randomx_interval` should always be larger than 2 times `ac_randomx_lag` * `-ac_randomx_interval` should always be larger than 2 times `-ac_randomx_lag`
* Setting these to arbitrary values could affect the chain security of your coin * Setting these to arbitrary values could affect chain security
* It is not recommended to change these values unless you are really sure why you are doing it * Do not change these values unless you are really sure why you are doing it
# RandomX Internals # RandomX Internals
This section is not required reading if you just want to use it as a PoW algorithm for an HSC. Here we will explain how the internals of RandomX works inside of the Hush codebase. This section is not required reading if you just want to run or mine DragonX.
Here we explain how the internals of RandomX work inside the codebase.
We use the official RandomX implementation from https://github.com/tevador/RandomX with custom configuration options. If some type of hardware is created to mine the XMR RandomX algorithm, it will not be compatible with the Hush RandomX algorithm. This is by design. All Hush Arrakis Chains use the same RandomX config options, so if a hardware device is created to mine one HSC that uses RandomX, it can be used to mine any HSC using RandomX. Every HSC with unique consensus parameters will start off with it's own unique key block with at least 9 bytes of entropy. We use the official RandomX implementation from https://github.com/tevador/RandomX
with custom configuration options. Because the configuration differs from the
The source code of RandomX is embedded in the Hush source code at `./src/RandomX` and the configuration options used are at `./src/RandomX/src/configuration.h` . Monero (XMR) RandomX configuration, hardware built to mine XMR RandomX is not
compatible with DragonX's RandomX. This is by design. The source code of RandomX
is embedded at `./src/RandomX` and the configuration options used are at
`./src/RandomX/src/configuration.h`.
The changes from default RandomX configuration options are listed below. The changes from default RandomX configuration options are listed below.
@@ -100,5 +94,4 @@ The changes from default RandomX configuration options are listed below.
+#define RANDOMX_PROGRAM_COUNT 16 +#define RANDOMX_PROGRAM_COUNT 16
``` ```
RandomX opcode frequencies were not modfiied, the defaults are used. RandomX opcode frequencies were not modified, the defaults are used.

View File

@@ -1,4 +1,4 @@
# Hush Release Process # DragonX Release Process
## High-Level Philosophy ## High-Level Philosophy
@@ -6,34 +6,34 @@ Beware of making high-risk changes (such as consensus changes, p2p layer changes
It is best to keep doc/relnotes/README.md up to date as changes and bug fixes are made. It's more work to summarize all changes and bugfixes just before the release. It is best to keep doc/relnotes/README.md up to date as changes and bug fixes are made. It's more work to summarize all changes and bugfixes just before the release.
## Check for changes on master that should be on dev ## Branch model
Often there are trivial changes made directly on master, such as documentation changes. In theory, no code changes should happen on master without being on dev first, but it's better to be safe than sorry. We want the dev branch which undergoes testing to be as close as possible to what the master branch will become, so we don't want to merge dev into master and just assume everything works. So it's best to merge the master branch into dev just before merging the dev branch into master. Development happens on the `dev` branch. Releases are cut on the default branch, `dragonx`. There is no `master` branch. Code changes should land on `dev` first and undergo testing before being merged into `dragonx`.
To check if the master branch has any changes that the dev branch does not: ## Check for changes on dragonx that should be on dev
Occasionally trivial changes are made directly on the `dragonx` branch, such as documentation changes. In theory, no code changes should happen on `dragonx` without being on `dev` first, but it's better to be safe than sorry. We want the `dev` branch which undergoes testing to be as close as possible to what the `dragonx` branch will become, so we don't want to merge `dev` into `dragonx` and just assume everything works. So it's best to merge the `dragonx` branch into `dev` just before merging the `dev` branch into `dragonx`.
To check if the `dragonx` branch has any changes that the `dev` branch does not:
``` ```
# this assumes you are working with https://git.hush.is/hush/hush3 as your remote # this assumes you are working with https://git.dragonx.is/DragonX/dragonx as your remote
git checkout dev git checkout dev
git pull # make sure dev is up to date git pull # make sure dev is up to date
git checkout master git checkout dragonx
git pull # make sure master is up to date git pull # make sure dragonx is up to date
git diff dev...master # look at the set of changes which exist in master but not dev git diff dev...dragonx # look at the set of changes which exist in dragonx but not dev
``` ```
If the last command has no output, congrats, there is nothing to do. If the last command has output, then you should merge master into dev: If the last command has no output, congrats, there is nothing to do. If the last command has output, then you should merge `dragonx` into `dev`:
``` ```
git checkout master
git merge --no-ff dev # using the default commit message is fine
git tag vX.Y.Z # this creates a tag vX.Y.Z on current master, or you can let gitea do it later
git push --tags origin master
git checkout dev git checkout dev
git merge master git merge dragonx
git push origin dev git push origin dev
``` ```
The `--no-ff` flag above makes sure to make a merge commit, no matter what, even if a "fast forward" could be done. For those in the future looking back, it's much better to see evidence of when branches were merged. Use the `--no-ff` flag when merging `dev` into `dragonx` for a release (see below). The `--no-ff` flag makes sure to make a merge commit, no matter what, even if a "fast forward" could be done. For those in the future looking back, it's much better to see evidence of when branches were merged.
### Git Issues ### Git Issues
@@ -65,21 +65,21 @@ Install deps on Linux:
- Edit contrib/seeds/nodes_main.txt - Edit contrib/seeds/nodes_main.txt
- Run "make seeds" - Run "make seeds"
- Commit the result - Commit the result
- Update version in configure.ac and src/clientversion.h to update the hushd version - Update version in configure.ac and src/clientversion.h to update the dragonxd version
- In src/clientversion.h you update `CLIENT_VERSION_*` variables. Usually you will just update `CLIENT_VERSION_REVISION` - In src/clientversion.h you update `CLIENT_VERSION_*` variables. Usually you will just update `CLIENT_VERSION_REVISION`
- If there is a consensus change, it may be a good idea to update `CLIENT_VERSION_MINOR` or `CLIENT_VERSION_MAJOR` - If there is a consensus change, it may be a good idea to update `CLIENT_VERSION_MINOR` or `CLIENT_VERSION_MAJOR`
- To make a pre-release "beta" you can modify `CLIENT_VERSION_BUILD` but that is rarely done in Hush world. - To make a pre-release "beta" you can modify `CLIENT_VERSION_BUILD` but that is rarely done.
- A `CLIENT_VERSION_BUILD` of 50 means "actual non-beta release" - A `CLIENT_VERSION_BUILD` of 50 means "actual non-beta release"
- Make sure to keep the values in configure.ac and src/clientversion.h the same. The variables are prefixed wth an underscore in configure.ac - Make sure to keep the values in configure.ac and src/clientversion.h the same. The variables are prefixed wth an underscore in configure.ac
- Run `./util/gen-manpages.sh`, commit + push results - Run `./util/gen-manpages.sh`, commit + push results
- There is a hack in the script where you can hardcode a version number if hushd isn't compiled on this machine - There is a hack in the script where you can hardcode a version number if dragonxd isn't compiled on this machine
- Comment out the HUSHVER line and uncomment the line above it with a hardcoded version number - Comment out the version line and uncomment the line above it with a hardcoded version number
- PROTIP: Man page creation must be done after updating the version number and recompiling and before Debian package creation - PROTIP: Man page creation must be done after updating the version number and recompiling and before Debian package creation
- TODO: How to regenerate html man pages? - TODO: How to regenerate html man pages?
- Update checkpoints in src/chainparams.cpp via util/checkpoints.pl - Update checkpoints in src/chainparams.cpp via util/checkpoints.pl
- Run "./util/checkpoints.pl help" to get example usage - Run "./util/checkpoints.pl help" to get example usage
- hushd must be running to run this script, since it uses hush-cli to get the data - dragonxd must be running to run this script, since it uses dragonx-cli to get the data
- Look for line which says "END HUSH mainnet checkpoint data" near line 560 in chainparams.cpp , that is where checkpoint data ends - Look for the line which marks the end of the mainnet checkpoint data in chainparams.cpp, that is where checkpoint data ends
- Find the highest block height of checkpoint data, let's call it HEIGHT - Find the highest block height of checkpoint data, let's call it HEIGHT
- Run `./util/checkpoints.pl 1000 HEIGHT &> checkpoints.txt` to generate the latest checkpoint data - Run `./util/checkpoints.pl 1000 HEIGHT &> checkpoints.txt` to generate the latest checkpoint data
- To copy the new data from checkpoints.txt into the file, one way in Vim is to type ":r checkpoints.txt" which will read in a file and paste it as the current cursor - To copy the new data from checkpoints.txt into the file, one way in Vim is to type ":r checkpoints.txt" which will read in a file and paste it as the current cursor
@@ -89,7 +89,6 @@ Install deps on Linux:
- By default it will generate checkpoints for every 1000 blocks, the "stride" - By default it will generate checkpoints for every 1000 blocks, the "stride"
- You can get a different "stride" by passing it in as the first arg to the script - You can get a different "stride" by passing it in as the first arg to the script
- To get checkpoint data for every 5000 blocks: `./util/checkpoints.pl 5000 &> checkpoints.txt` - To get checkpoint data for every 5000 blocks: `./util/checkpoints.pl 5000 &> checkpoints.txt`
- Currently checkpoints from before block 340k are given for every 5k blocks to keep the data smaller
- checkpoints.pl will just generate the data you need, it must be manually copied into the correct place - checkpoints.pl will just generate the data you need, it must be manually copied into the correct place
- Checkpoints are a list of block heights and block hashes that tell a full node the correct block history of the blockchain - Checkpoints are a list of block heights and block hashes that tell a full node the correct block history of the blockchain
- Checkpoints make block verification a bit faster, because nodes can say "is this block a descendant of a checkpoint block?" instead of doing full consensus checks, which take more time - Checkpoints make block verification a bit faster, because nodes can say "is this block a descendant of a checkpoint block?" instead of doing full consensus checks, which take more time
@@ -98,15 +97,15 @@ Install deps on Linux:
- Try to generate checkpoints as close to the release as possible, so you can have a recent block height be protected. - Try to generate checkpoints as close to the release as possible, so you can have a recent block height be protected.
- For instance, don't update checkpoints and then do a release a month later. You can always update checkpoint data again or multiple times - For instance, don't update checkpoints and then do a release a month later. You can always update checkpoint data again or multiple times
- Update doc/relnotes/README.md - Update doc/relnotes/README.md
- To get the stats of file changes: `git diff --stat master...dev` - To get the stats of file changes: `git diff --stat dragonx...dev`
- Do a fresh clone and fresh sync with new checkpoints - Do a fresh clone and fresh sync with new checkpoints
- Stop node, wait 20 minutes, and then do a partial sync with new checkpoints - Stop node, wait 20 minutes, and then do a partial sync with new checkpoints
- Merge dev into master: `git checkout dev && git pull && git checkout master && git pull && git merge --no-ff dev && git push` - Merge dev into dragonx: `git checkout dev && git pull && git checkout dragonx && git pull && git merge --no-ff dev && git push`
- The above command makes sure that your local dev branch is up to date before doing anything - The above command makes sure that your local dev branch is up to date before doing anything
- The above command will not merge if "git pull" creates a merge conflict - The above command will not merge if "git pull" creates a merge conflict
- The above command will not push if there is a problem with merging dev - The above command will not push if there is a problem with merging dev
- Make Gitea release with git tag from master branch (make sure to merge dev in first) - Make Gitea release with git tag from the dragonx branch (make sure to merge dev in first)
- Make sure git tag starts with a `v` such as `v3.9.2` - Make sure git tag starts with a `v` such as `v1.0.3`
- Use util/gen-linux-binary-release.sh to make a Linux release binary - Use util/gen-linux-binary-release.sh to make a Linux release binary
- Upload Linux binary to Gitea release and add SHA256 sum - Upload Linux binary to Gitea release and add SHA256 sum
- Create an x86 Debian package for the release: - Create an x86 Debian package for the release:
@@ -118,18 +117,14 @@ Install deps on Linux:
- Add SHA256 checksum of .deb to release - Add SHA256 checksum of .deb to release
- Use util/build-debian-package-ARM.sh (does this still work?) to make an ARM Debian package for the release - Use util/build-debian-package-ARM.sh (does this still work?) to make an ARM Debian package for the release
- Upload the debian packages to the Gitea release page, with SHA256 sums - Upload the debian packages to the Gitea release page, with SHA256 sums
- Update the rpc.hush.is repo for new release by [following these instructions](https://git.hush.is/hush/rpc.hush.is/src/branch/master/README.md)
- Update https://faq.hush.is/rpc/ for new release after updating the rpc.hush.is repo
## Platform-specific notes ## Platform-specific notes
- Use `./util/build-mac.sh` to compile on Apple/Mac systems - Use `./util/build-mac.sh` to compile on Apple/Mac systems
- Use `./util/build-win.sh` to build on Windows - Use `./util/build-win.sh` to build on Windows
- Use [these cross compile instructions](https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md) to build the release for ARMv8 (aarch64) systems, as the current build system does not permit us to natively build this on the SBC device
- Then use `./util/build-debian-package.sh aarch64` to build a Debian package for ARMv8 (aarch64)
## Optional things ## Optional things
### Updating RandomX ### Updating RandomX
If you need to update the source code of our in tree copy of RandomX, see issue https://git.hush.is/hush/hush3/issues/337#issuecomment-5114 for details. Currently we use RandomX v1.2.1 from the official repo at https://github.com/tevador/RandomX/releases/tag/v1.2.1 If you need to update the source code of our in tree copy of RandomX, open an issue in the [DragonX Git repository](https://git.dragonx.is/DragonX/dragonx/issues) to track the details. Currently we use RandomX v1.2.1 from the official repo at https://github.com/tevador/RandomX/releases/tag/v1.2.1

View File

@@ -1,24 +1,17 @@
#Security Warnings # Security Warnings
## Security Audits ## Security Audits
Hush has not been subjected to a formal third-party security review! But the DragonX has not been subjected to a formal third-party security review. Some of
some of the Zcash and Komodo source code it is based on has. the Bitcoin, Zcash, Komodo, and Hush source code it is derived from has been
audited upstream, and DragonX integrates relevant fixes and recommendations from
Hush does our best to integrate fixes and recommendations from upstream audits those audits where they apply.
to our own code, such as audits on ZecWallet that apply to SilentDragon.
Hush used to report many new bugs and CVEs to upstream Zcash and Komodo but
those relations have broken down.
Additionally, Hush itself finds many CVE's and things-that-should-be-CVE's
in Zcash internals. Since Zcash community treats Hush people so poorly, we
keep these bugs and fixes to ourselves. If you want to know some of them,
let us know and bring your wallet. Public information available at
<a href="https://attackingzcash.com">attackingzcash.com</a>
## Wallet Encryption ## Wallet Encryption
Wallet encryption is disabled, for several reasons: Wallet encryption is disabled by default, for several reasons. (It can be
enabled by running with both `-experimentalfeatures` and
`-developerencryptwallet`, but this is not recommended for the reasons below.)
- Encrypted wallets are unable to correctly detect shielded spends (due to the - Encrypted wallets are unable to correctly detect shielded spends (due to the
nature of unlinkability of ShieldedSpends) and can incorrectly show larger nature of unlinkability of ShieldedSpends) and can incorrectly show larger
@@ -45,13 +38,13 @@ running on your OS can read your wallet.dat file.
## Side-Channel Attacks ## Side-Channel Attacks
This implementation of Hush is not resistant to side-channel attacks. You This implementation of DragonX is not resistant to side-channel attacks. You
should assume (even unprivileged) users who are running on the hardware, or who should assume (even unprivileged) users who are running on the hardware, or who
are physically near the hardware, that your `hushd` process is running on will are physically near the hardware, that your `dragonxd` process is running on will
be able to: be able to:
- Determine the values of your secret spending keys, as well as which notes you - Determine the values of your secret spending keys, as well as which notes you
are spending, by observing cache side-channels as you perform a SheildedSpend are spending, by observing cache side-channels as you perform a ShieldedSpend
operation. This is due to probable side-channel leakage in C++. operation. This is due to probable side-channel leakage in C++.
- Determine which notes you own by observing cache side-channel information - Determine which notes you own by observing cache side-channel information
@@ -61,7 +54,7 @@ be able to:
each note ciphertext on the blockchain. each note ciphertext on the blockchain.
You should ensure no other users have the ability to execute code (even You should ensure no other users have the ability to execute code (even
unprivileged) on the hardware your `hushd` process runs on until these unprivileged) on the hardware your `dragonxd` process runs on until these
vulnerabilities are fully analyzed and fixed. vulnerabilities are fully analyzed and fixed.
## REST Interface ## REST Interface
@@ -72,13 +65,16 @@ security review.
## RPC Interface ## RPC Interface
Users should choose a strong RPC password. If no RPC username and password are set, hush will not start and will print an error message with a suggestion for a strong random password. If the client knows the RPC password, they have at least full access to the node. In addition, certain RPC commands can be misused to overwrite files and/or take over the account that is running hushd. (In the future we may restrict these commands, but full node access including the ability to spend from and export keys held by the wallet would still be possible unless wallet methods are disabled.) Users should choose a strong RPC password. If no RPC username and password are set, dragonxd will not start and will print an error message with a suggestion for a strong random password. If the client knows the RPC password, they have at least full access to the node. In addition, certain RPC commands can be misused to overwrite files and/or take over the account that is running dragonxd. (In the future we may restrict these commands, but full node access including the ability to spend from and export keys held by the wallet would still be possible unless wallet methods are disabled.)
Users should also refrain from changing the default setting that only allows RPC connections from localhost. Allowing connections from remote hosts would enable a MITM to execute arbitrary RPC commands, which could lead to compromise of the account running hushd and loss of funds. For multi-user services that use one or more hushd instances on the backend, the parameters passed in by users should be controlled to prevent confused-deputy attacks which could spend from any keys held by that zcashd. Users should also refrain from changing the default setting that only allows RPC connections from localhost. Allowing connections from remote hosts would enable a MITM to execute arbitrary RPC commands, which could lead to compromise of the account running dragonxd and loss of funds. For multi-user services that use one or more dragonxd instances on the backend, the parameters passed in by users should be controlled to prevent confused-deputy attacks which could spend from any keys held by that dragonxd.
## Block Chain Reorganization: Major Differences ## Block Chain Reorganization
Hush has Delayed-Proof-of-Work, which drastically improves the Zcash rule-of-thumb of "re-organize 100 blocks to crash all ZEC full nodes in the world". DragonX inherits Komodo's Delayed-Proof-of-Work (dPoW) notarization code from its
Hush lineage. Note that DragonX does not currently run its own notary
infrastructure, so you should not assume active dPoW reorg protection. Treat deep
reorganizations as possible and wait for sufficient confirmations accordingly.
## Logging z_* RPC calls ## Logging z_* RPC calls

View File

@@ -2,47 +2,61 @@
**Summary** **Summary**
Use `z_shieldcoinbase` RPC call to shield coinbase UTXOs. Use the `z_shieldcoinbase` RPC call to move mining coinbase UTXOs into the shielded pool.
**Who should read this document** **Who should read this document**
Miners, Mining pools, Online wallets Miners, mining pools, online wallets.
## Background ## Background
The current Hush protocol includes a consensus rule that coinbase rewards must be sent to a shielded address. DragonX is a fully private chain from genesis (`ac_private=1`, Sapling active at
height 1). All ordinary payments are shielded (`z2z`) and transparent addresses can
never be transaction recipients — they only ever receive mining coinbase.
There is **no** consensus rule that coinbase must be shielded: mature coinbase is
directly spendable. `z_shieldcoinbase` is therefore an optional convenience for
miners who want to move coinbase into the shielded pool for privacy, and to sweep
up many small coinbase UTXOs in a single operation. See
[hd-transparent-keys.md](hd-transparent-keys.md) for how transparent coinbase keys
work on a private chain.
## User Experience Challenges ## User Experience Challenges
A user can use the z_sendmany RPC call to shield coinbase funds, but the call was not designed for sweeping up many UTXOs, and offered a suboptimal user experience. A user can use the `z_sendmany` RPC call to shield coinbase funds, but that call was
not designed for sweeping up many UTXOs and offers a suboptimal experience.
If customers send mining pool payouts to their online wallet, the service provider must sort through UTXOs to correctly determine the non-coinbase UTXO funds that can be withdrawn or transferred by customers to another transparent address. If customers send mining pool payouts to their online wallet, the service provider
must sort through UTXOs to correctly determine the non-coinbase UTXO funds that can be
withdrawn or transferred by customers.
## Solution ## Solution
The z_shieldcoinbase call makes it easy to sweep up coinbase rewards from multiple coinbase UTXOs across multiple coinbase reward addresses. The `z_shieldcoinbase` call makes it easy to sweep up coinbase rewards from multiple
coinbase UTXOs across multiple coinbase reward addresses.
z_shieldcoinbase fromaddress toaddress (fee) (limit) z_shieldcoinbase fromaddress toaddress (fee) (limit)
The default fee is 0.0010000 HUSH and the default limit on the maximum number of UTXOs to shield is 50. The default fee is 0.0001 DRAGONX and the default limit on the maximum number of UTXOs
to shield is 50.
## Examples ## Examples
Sweep up coinbase UTXOs from a transparent address you use for mining: Sweep up coinbase UTXOs from a transparent address you use for mining:
hush-cli z_shieldcoinbase tMyMiningAddress zMyPrivateAddress dragonx-cli z_shieldcoinbase RMyMiningAddress zsMyPrivateAddress
Sweep up coinbase UTXOs from multiple transparent addresses to a shielded address: Sweep up coinbase UTXOs from multiple transparent addresses to a shielded address:
hush-cli z_shieldcoinbase "*" zMyPrivateAddress dragonx-cli z_shieldcoinbase "*" zsMyPrivateAddress
Sweep up with a fee of 1.23 HUSH: Sweep up with a fee of 1.23 DRAGONX:
hush-cli z_shieldcoinbase tMyMiningAddress zMyPrivateAddress 1.23 dragonx-cli z_shieldcoinbase RMyMiningAddress zsMyPrivateAddress 1.23
Sweep up with a fee of 0.1 HUSH and set limit on the maximum number of UTXOs to shield at 25: Sweep up with a fee of 0.1 DRAGONX and set limit on the maximum number of UTXOs to shield at 25:
hush-cli z_shieldcoinbase "*" zMyPrivateAddress 0.1 25 dragonx-cli z_shieldcoinbase "*" zsMyPrivateAddress 0.1 25
### Asynchronous Call ### Asynchronous Call
@@ -50,7 +64,7 @@ The `z_shieldcoinbase` RPC call is an asynchronous call, so you can queue up mul
When you invoke When you invoke
hush-cli z_shieldcoinbase tMyMiningAddress zMyPrivateAddress dragonx-cli z_shieldcoinbase RMyMiningAddress zsMyPrivateAddress
JSON will be returned immediately, with the following data fields populated: JSON will be returned immediately, with the following data fields populated:
@@ -70,13 +84,13 @@ You can use the RPC call `lockunspent` to see which UTXOs have been locked. You
The number of coinbase UTXOs selected for shielding can be adjusted by setting the limit parameter. The default value is 50. The number of coinbase UTXOs selected for shielding can be adjusted by setting the limit parameter. The default value is 50.
If the limit parameter is set to zero, the zcashd `mempooltxinputlimit` option will be used instead, where the default value for `mempooltxinputlimit` is zero, which means no limit. If the limit parameter is set to zero, the `mempooltxinputlimit` option will be used instead, where the default value for `mempooltxinputlimit` is zero, which means no limit.
Any limit is constrained by a hard limit due to the consensus rule defining a maximum transaction size. Any limit is constrained by a hard limit due to the consensus rule defining a maximum transaction size.
In general, the more UTXOs that are selected, the longer it takes for the transaction to be verified. Due to the quadratic hashing problem, some miners use the `mempooltxinputlimit` option to reject transactions with a large number of UTXO inputs. In general, the more UTXOs that are selected, the longer it takes for the transaction to be verified. Due to the quadratic hashing problem, some miners use the `mempooltxinputlimit` option to reject transactions with a large number of UTXO inputs.
Currently, as of November 2017, there is no commonly agreed upon limit, but as a rule of thumb (a form of emergent consensus) if a transaction has less than 100 UTXO inputs, the transaction will be mined promptly by the majority of mining pools, but if it has many more UTXO inputs, such as 500, it might take several days to be mined by a miner who has higher or no limits. As a rule of thumb (a form of emergent consensus) if a transaction has less than 100 UTXO inputs, the transaction will be mined promptly by the majority of mining pools, but if it has many more UTXO inputs, such as 500, it might take longer to be mined by a miner who has higher or no limits.
### Anatomy of a z_shieldcoinbase transaction ### Anatomy of a z_shieldcoinbase transaction

View File

@@ -11,12 +11,14 @@ There are two scripts for running tests:
The main test suite uses two different testing frameworks. Tests using the Boost The main test suite uses two different testing frameworks. Tests using the Boost
framework are under ``src/test/``; tests using the Google Test/Google Mock framework are under ``src/test/``; tests using the Google Test/Google Mock
framework are under ``src/gtest/`` and ``src/wallet/gtest/``. The latter framework framework are under ``src/gtest/`` and ``src/wallet/gtest/``. The latter framework
is preferred for new Hush unit tests. is preferred for new DragonX unit tests.
RPC tests are implemented in Python under the ``qa/rpc-tests/`` directory. RPC tests are implemented in Python under the ``qa/rpc-tests/`` directory.
# Example # Example
To run the Delayed-Proof-of-Work tests: To run a single RPC test, pass its name to the runner. For example, the
inherited `dpowconfs` test (a regtest-only test carried over from the upstream
codebase):
./qa/pull-tester/rpc-tests.sh dpowconfs ./qa/pull-tester/rpc-tests.sh dpowconfs

View File

@@ -1,21 +1,20 @@
# Tor # Tor
It is possible to run Hush as a Tor onion service, and connect to such services. It is possible to run DragonX as a Tor onion service, and connect to such services.
The following directions assume you have a Tor proxy running on port 9050. Many distributions default to having a SOCKS proxy listening on port 9050, but others may not. In particular, the Tor Browser Bundle defaults to listening on port 9150. See [Tor Project FAQ:TBBSocksPort](https://www.torproject.org/docs/faq.html.en#TBBSocksPort) for how to properly The following directions assume you have a Tor proxy running on port 9050. Many distributions default to having a SOCKS proxy listening on port 9050, but others may not. In particular, the Tor Browser Bundle defaults to listening on port 9150. See [Tor Project FAQ:TBBSocksPort](https://www.torproject.org/docs/faq.html.en#TBBSocksPort) for how to properly
configure Tor. configure Tor.
## Compatibility ## Compatibility
- Starting with version 3.9.3, Hush only supports Tor version 3 hidden - DragonX only supports Tor version 3 hidden services (Tor v3). Tor v2
services (Tor v3). Tor v2 addresses are ignored by Hush and neither addresses are ignored by DragonX and neither relayed nor stored.
relayed nor stored.
- Tor removed v2 support beginning with version 0.4.6. - Tor removed v2 support beginning with version 0.4.6.
## How to see information about your Tor configuration via Hush ## How to see information about your Tor configuration via DragonX
There are several ways to see your local onion address in Hush: There are several ways to see your local onion address in DragonX:
- in the "localaddresses" output of RPC `getnetworkinfo` - in the "localaddresses" output of RPC `getnetworkinfo`
- in the debug log (grep for "AddLocal"; the Tor address ends in `.onion`) - in the debug log (grep for "AddLocal"; the Tor address ends in `.onion`)
@@ -26,9 +25,9 @@ CLI `-addrinfo` returns the number of addresses known to your node per
network. This can be useful to see how many onion peers your node knows, network. This can be useful to see how many onion peers your node knows,
e.g. for `-onlynet=onion`. e.g. for `-onlynet=onion`.
## 1. Run Hush behind a Tor proxy ## 1. Run DragonX behind a Tor proxy
The first step is running Hush behind a Tor proxy. This will already anonymize all The first step is running DragonX behind a Tor proxy. This will already anonymize all
outgoing connections, but more is possible. outgoing connections, but more is possible.
-proxy=ip:port Set the proxy server. If SOCKS5 is selected (default), this proxy -proxy=ip:port Set the proxy server. If SOCKS5 is selected (default), this proxy
@@ -61,22 +60,22 @@ outgoing connections, but more is possible.
In a typical situation, this suffices to run behind a Tor proxy: In a typical situation, this suffices to run behind a Tor proxy:
./hushd -proxy=127.0.0.1:9050 ./dragonxd -proxy=127.0.0.1:9050
## 2. Automatically create a Hush onion service ## 2. Automatically create a DragonX onion service
Hush makes use of Tor's control socket API to create and destroy DragonX makes use of Tor's control socket API to create and destroy
ephemeral onion services programmatically. This means that if Tor is running and ephemeral onion services programmatically. This means that if Tor is running and
proper authentication has been configured, Hush automatically creates an proper authentication has been configured, DragonX automatically creates an
onion service to listen on. The goal is to increase the number of available onion service to listen on. The goal is to increase the number of available
onion nodes. onion nodes.
This feature is enabled by default if Hush is listening (`-listen`) and This feature is enabled by default if DragonX is listening (`-listen`) and
it requires a Tor connection to work. It can be explicitly disabled with it requires a Tor connection to work. It can be explicitly disabled with
`-listenonion=0`. If it is not disabled, it can be configured using the `-listenonion=0`. If it is not disabled, it can be configured using the
`-torcontrol` and `-torpassword` settings. `-torcontrol` and `-torpassword` settings.
To see verbose Tor information in the hushd debug log, pass `-debug=tor`. To see verbose Tor information in the dragonxd debug log, pass `-debug=tor`.
### Control Port ### Control Port
@@ -104,20 +103,20 @@ DataDirectoryGroupReadable 1
### Authentication ### Authentication
Connecting to Tor's control socket API requires one of two authentication Connecting to Tor's control socket API requires one of two authentication
methods to be configured: cookie authentication or hushd's `-torpassword` methods to be configured: cookie authentication or dragonxd's `-torpassword`
configuration option. configuration option.
#### Cookie authentication #### Cookie authentication
For cookie authentication, the user running hushd must have read access to For cookie authentication, the user running dragonxd must have read access to
the `CookieAuthFile` specified in the Tor configuration. In some cases this is the `CookieAuthFile` specified in the Tor configuration. In some cases this is
preconfigured and the creation of an onion service is automatic. Don't forget to preconfigured and the creation of an onion service is automatic. Don't forget to
use the `-debug=tor` hushd configuration option to enable Tor debug logging. use the `-debug=tor` dragonxd configuration option to enable Tor debug logging.
If a permissions problem is seen in the debug log, e.g. `tor: Authentication If a permissions problem is seen in the debug log, e.g. `tor: Authentication
cookie /run/tor/control.authcookie could not be opened (check permissions)`, it cookie /run/tor/control.authcookie could not be opened (check permissions)`, it
can be resolved by adding both the user running Tor and the user running can be resolved by adding both the user running Tor and the user running
hushd to the same Tor group and setting permissions appropriately. dragonxd to the same Tor group and setting permissions appropriately.
On Debian-derived systems, the Tor group will likely be `debian-tor` and one way On Debian-derived systems, the Tor group will likely be `debian-tor` and one way
to verify could be to list the groups and grep for a "tor" group name: to verify could be to list the groups and grep for a "tor" group name:
@@ -134,14 +133,14 @@ TORGROUP=$(stat -c '%G' /run/tor/control.authcookie)
``` ```
Once you have determined the `${TORGROUP}` and selected the `${USER}` that will Once you have determined the `${TORGROUP}` and selected the `${USER}` that will
run hushd, run this as root: run dragonxd, run this as root:
``` ```
usermod -a -G ${TORGROUP} ${USER} usermod -a -G ${TORGROUP} ${USER}
``` ```
Then restart the computer (or log out) and log in as the `${USER}` that will run Then restart the computer (or log out) and log in as the `${USER}` that will run
hushd. dragonxd.
#### `torpassword` authentication #### `torpassword` authentication
@@ -155,22 +154,22 @@ Manual](https://2019.www.torproject.org/docs/tor-manual.html.en) for more
details). details).
## 3. Manually create a Hush onion service ## 3. Manually create a DragonX onion service
You can also manually configure your node to be reachable from the Tor network. You can also manually configure your node to be reachable from the Tor network.
Add these lines to your `/etc/tor/torrc` (or equivalent config file): Add these lines to your `/etc/tor/torrc` (or equivalent config file):
HiddenServiceDir /var/lib/tor/hush-service/ HiddenServiceDir /var/lib/tor/dragonx-service/
HiddenServicePort 18030 127.0.0.1:18032 HiddenServicePort 18030 127.0.0.1:18032
The directory can be different of course, but virtual port numbers should be equal to The directory can be different of course, but virtual port numbers should be equal to
your hushd's P2P listen port (18030 by default), and target addresses and ports your dragonxd's P2P listen port (18030 by default), and target addresses and ports
should be equal to binding address and port for inbound Tor connections (127.0.0.1:18032 by default). should be equal to binding address and port for inbound Tor connections (127.0.0.1:18032 by default).
-externalip=X You can tell hush about its publicly reachable addresses using -externalip=X You can tell dragonx about its publicly reachable addresses using
this option, and this can be an onion address. Given the above this option, and this can be an onion address. Given the above
configuration, you can find your onion address in configuration, you can find your onion address in
/var/lib/tor/hush-service/hostname. For connections /var/lib/tor/dragonx-service/hostname. For connections
coming from unroutable addresses (such as 127.0.0.1, where the coming from unroutable addresses (such as 127.0.0.1, where the
Tor proxy typically runs), onion addresses are given Tor proxy typically runs), onion addresses are given
preference for your node to advertise itself with. preference for your node to advertise itself with.
@@ -192,29 +191,29 @@ should be equal to binding address and port for inbound Tor connections (127.0.0
In a typical situation, where you're only reachable via Tor, this should suffice: In a typical situation, where you're only reachable via Tor, this should suffice:
./hushd -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen ./dragonxd -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen
(obviously, replace the .onion address with your own). It should be noted that you still (obviously, replace the .onion address with your own). It should be noted that you still
listen on all devices and another node could establish a clearnet connection, when knowing listen on all devices and another node could establish a clearnet connection, when knowing
your address. To mitigate this, additionally bind the address of your Tor proxy: your address. To mitigate this, additionally bind the address of your Tor proxy:
./hushd ... -bind=127.0.0.1 ./dragonxd ... -bind=127.0.0.1
If you don't care too much about hiding your node, and want to be reachable on IPv4 If you don't care too much about hiding your node, and want to be reachable on IPv4
as well, use `discover` instead: as well, use `discover` instead:
./hushd ... -discover ./dragonxd ... -discover
and open port 18030 on your firewall (or use port mapping, i.e., `-upnp` or `-natpmp`). and open port 18030 on your firewall (or use port mapping, i.e., `-upnp` or `-natpmp`).
If you only want to use Tor to reach .onion addresses, but not use it as a proxy If you only want to use Tor to reach .onion addresses, but not use it as a proxy
for normal IPv4/IPv6 communication, use: for normal IPv4/IPv6 communication, use:
./hushd -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover ./dragonxd -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover
## 4. Privacy recommendations ## 4. Privacy recommendations
- Do not add anything but Hush ports to the onion service created in section 3. - Do not add anything but DragonX ports to the onion service created in section 3.
If you run a web service too, create a new onion service for that. If you run a web service too, create a new onion service for that.
Otherwise it is trivial to link them, which may reduce privacy. Onion Otherwise it is trivial to link them, which may reduce privacy. Onion
services created automatically (as in section 2) always have only one port services created automatically (as in section 2) always have only one port

View File

@@ -1,6 +1,6 @@
# Translation Strings Policy # Translation Strings Policy
This document provides guidelines for internationalization of hushd full node software. This document provides guidelines for internationalization of dragonxd full node software.
## How to translate? ## How to translate?

View File

@@ -2,37 +2,42 @@
## Overview ## Overview
Backing up your Hush private keys is the best way to be proactive about preventing loss of access to your HUSH. Backing up your DragonX private keys is the best way to be proactive about preventing loss of access to your DRAGONX.
Problems resulting from bugs in the code, user error, device failure, etc. may lead to losing access to your wallet (and as a result, the private keys of addresses which are required to spend from them). Problems resulting from bugs in the code, user error, device failure, etc. may lead to losing access to your wallet (and as a result, the private keys of addresses which are required to spend from them).
No matter what the cause of a corrupted or lost wallet could be, we highly recommend all users backup on a regular basis. Anytime a new address in the wallet is generated, we recommending making a new backup so all private keys for addresses in your wallet are safe. No matter what the cause of a corrupted or lost wallet could be, we highly recommend all users backup on a regular basis. Anytime a new address in the wallet is generated, we recommend making a new backup so all private keys for addresses in your wallet are safe.
Note that a backup is a duplicate of data needed to spend HUSH so where you keep your backup(s) is another important consideration. You should not store backups where they would be equally or increasingly susceptible to loss or theft. Note that a backup is a duplicate of data needed to spend DRAGONX so where you keep your backup(s) is another important consideration. You should not store backups where they would be equally or increasingly susceptible to loss or theft.
Because DragonX is a fully private chain (all ordinary funds live on shielded `zs...`
addresses), the shielded keys are what you must protect. The only transparent value a
normal user ever holds is mining coinbase; see
[hd-transparent-keys.md](hd-transparent-keys.md).
## Instructions for backing up your wallet and/or private keys ## Instructions for backing up your wallet and/or private keys
These instructions are specific for the officially supported Hush Linux client. For backing up with third-party wallets, please consult with user guides or support channels provided for those services. These instructions are for the DragonX full-node command-line client. For backing up with third-party wallets, please consult the user guides or support channels provided for those services.
There are multiple ways to make sure you have at least one other copy of the private keys needed to spend your HUSH and view your shielded HUSH. There are multiple ways to make sure you have at least one other copy of the private keys needed to spend your DRAGONX and view your shielded DRAGONX.
For all methods, you will need to include an export directory setting in your config file (`HUSH3.conf` located in the data directory which is `~/.hush/HUSH3` or `~/.komodo/HUSH3` (Legacy Location) unless it's been overridden with `datadir=` setting): For all methods, you will need to include an export directory setting in your config file (`DRAGONX.conf` located in the data directory, which is `~/.hush/DRAGONX` unless it's been overridden with the `datadir=` setting):
`exportdir=path/to/chosen/export/directory` `exportdir=path/to/chosen/export/directory`
You may chose any directory within the home directory as the location for export & backup files. If the directory doesn't exist, it will be created. You may choose any directory within the home directory as the location for export & backup files. If the directory doesn't exist, it will be created.
Note that hushd will need to be stopped and restarted for edits in the config file to take effect. Note that dragonxd will need to be stopped and restarted for edits in the config file to take effect.
### Using `backupwallet` ### Using `backupwallet`
To create a backup of your wallet, use: To create a backup of your wallet, use:
`hush-cli backupwallet <nameofbackup>`. `dragonx-cli backupwallet <nameofbackup>`.
The backup will be an exact copy of the current state of your wallet.dat file stored in the export directory you specified in the config file. The file path will also be returned. The backup will be an exact copy of the current state of your wallet.dat file stored in the export directory you specified in the config file. The file path will also be returned.
If you generate a new Hush address, it will not be reflected in the backup file. If you generate a new DragonX address, it will not be reflected in the backup file.
If your original `wallet.dat` file becomes inaccessible for whatever reason, you can use your backup by copying it into your data directory and renaming the copy to `wallet.dat`. If your original `wallet.dat` file becomes inaccessible for whatever reason, you can use your backup by copying it into your data directory and renaming the copy to `wallet.dat`.
@@ -40,51 +45,56 @@ If your original `wallet.dat` file becomes inaccessible for whatever reason, you
If you prefer to have an export of your private keys in human readable format, you can use: If you prefer to have an export of your private keys in human readable format, you can use:
`hush-cli z_exportwallet <nameofbackup>` `dragonx-cli z_exportwallet <nameofbackup>`
This will generate a file in the export directory listing all transparent and shielded private keys with their associated public addresses. The file path will be returned in the command line. This will generate a file in the export directory listing all transparent and shielded private keys with their associated public addresses. The file path will be returned in the command line.
To import keys into a wallet which were previously exported to a file, use: To import keys into a wallet which were previously exported to a file, use:
`hush-cli z_importwallet <path/to/exportdir/nameofbackup>` `dragonx-cli z_importwallet <path/to/exportdir/nameofbackup>`
### Using `z_exportkey`, `z_importkey`, `dumpprivkey` & `importprivkey` ### Using `z_exportkey`, `z_importkey`, `dumpprivkey` & `importprivkey`
If you prefer to export a single private key for a shielded address, you can use: For normal use, the shielded (`z_exportkey` / `z_importkey`) commands are what you need:
they back up and restore the `zs...` addresses that hold your spendable funds. The
transparent commands (`dumpprivkey` / `importprivkey`) only matter if you mine, since on
DragonX transparent value only exists as mining coinbase.
`hush-cli z_exportkey <z-address>` To export a single private key for a shielded address, use:
`dragonx-cli z_exportkey <z-address>`
This will return the private key and will not create a new file. This will return the private key and will not create a new file.
For exporting a single private key for a transparent address, you can use the command inherited from Bitcoin: For exporting a single private key for a transparent (mining coinbase) address, use the command inherited from Bitcoin:
`hush-cli dumpprivkey <t-address>` `dragonx-cli dumpprivkey <t-address>`
This will return the private key and will not create a new file. This will return the private key and will not create a new file.
To import a private key for a shielded address, use: To import a private key for a shielded address, use:
`hush-cli z_importkey <z-priv-key>` `dragonx-cli z_importkey <z-priv-key>`
This will add the key to your wallet and rescan the wallet for associated transactions if it is not already part of the wallet. This will add the key to your wallet and rescan the wallet for associated transactions if it is not already part of the wallet.
The rescanning process can take a few minutes for a new private key. To skip it, instead use: The rescanning process can take a few minutes for a new private key. To skip it, instead use:
`hush-cli z_importkey <z-private-key> no` `dragonx-cli z_importkey <z-private-key> no`
For other instructions on fine-tuning the wallet rescan, see the command's help documentation: For other instructions on fine-tuning the wallet rescan, see the command's help documentation:
`hush-cli help z_importkey` `dragonx-cli help z_importkey`
To import a private key for a transparent address, use: To import a private key for a transparent (mining coinbase) address, use:
`hush-cli importprivkey <t-priv-key>` `dragonx-cli importprivkey <t-priv-key>`
This has the same functionality as `z_importkey` but works with transparent addresses. This has the same functionality as `z_importkey` but works with transparent addresses.
See the command's help documentation for instructions on fine-tuning the wallet rescan: See the command's help documentation for instructions on fine-tuning the wallet rescan:
`hush-cli help importprivkey` `dragonx-cli help importprivkey`
### Using `dumpwallet` ### Using `dumpwallet`

View File

@@ -1,6 +1,6 @@
# zsweep and consolidation # zsweep and consolidation
This is to document zsweep and consolidation for advanced HUSH users. This is to document zsweep and consolidation for advanced DragonX users.
**Warning: If you don't know what Zsweep or Consolidation are, there is a good chance that you will not be using these advanced options. User beware!** **Warning: If you don't know what Zsweep or Consolidation are, there is a good chance that you will not be using these advanced options. User beware!**
@@ -11,9 +11,9 @@ This is to document zsweep and consolidation for advanced HUSH users.
# Pre-Step & Further Details # Pre-Step & Further Details
A user can use these options at the command line, but it is **recommended to configure these options within the HUSH3.conf file**. A user can use these options at the command line, but it is **recommended to configure these options within the DRAGONX.conf file**.
Consolidation takes many unspent shielded UTXOs (zutxos) into one zutxo, which makes spending them in the future faster and potentially cost less in fees. It also helps prevent certain kinds of metadata leakages and spam attacks. It is not recommended for very large wallets (wallet.dat files with thousands of transactions) for performance reasons. This is why it defaults to OFF for CLI full nodes but ON for GUI wallets that use an embedded hushd. Consolidation takes many unspent shielded UTXOs (zutxos) into one zutxo, which makes spending them in the future faster and potentially cost less in fees. It also helps prevent certain kinds of metadata leakages and spam attacks. It is not recommended for very large wallets (wallet.dat files with thousands of transactions) for performance reasons. This is why it defaults to OFF for CLI full nodes but ON for GUI wallets that use an embedded dragonxd.
Zsweep is when you sweep numerous zutxos into one z-address that you configure. This z-address can be local to that system or it can be configured to sweep to a remote wallet on a different system with the zsweepexternal=1 option, which is explained below in the Zsweep section. Zsweep is when you sweep numerous zutxos into one z-address that you configure. This z-address can be local to that system or it can be configured to sweep to a remote wallet on a different system with the zsweepexternal=1 option, which is explained below in the Zsweep section.
@@ -33,11 +33,11 @@ Zsweep is when you sweep numerous zutxos into one z-address that you configure.
|-------------------|-------------------------| |-------------------|-------------------------|
| zsweepexternal=1 | Will enable the option to zsweep to an "external" z-address which exists in a wallet on a different system. | | zsweepexternal=1 | Will enable the option to zsweep to an "external" z-address which exists in a wallet on a different system. |
| zsweepinterval=5 | By default zsweep runs every 5 blocks, so set and modify this value to change that. | | zsweepinterval=5 | By default zsweep runs every 5 blocks, so set and modify this value to change that. |
| zsweepmaxinputs=50 | By default zsweep makes sure to not reduce the anonset in any tx by having a maximum number of inputs of 8. This should be fine for new wallets, but if you have an existing wallet with many zutxos it can be changed with this option. Keep in mind that large values will make sweeping faster at the expense of reducing the AnonSet. | | zsweepmaxinputs=8 | By default zsweep makes sure to not reduce the anonset in any tx by having a maximum number of inputs of 8. This should be fine for new wallets, but if you have an existing wallet with many zutxos it can be changed with this option. Keep in mind that large values will make sweeping faster at the expense of reducing the AnonSet. |
| zsweepfee=0 | The default zsweep fee is 10000 puposhis or 0.0001 HUSH, the default for all transactions. To use fee=0 for zsweep transactions, set this option. | | zsweepfee=0 | The default zsweep fee is 10000 puposhis or 0.0001 DRAGONX, the default for all transactions. To use fee=0 for zsweep transactions, set this option. |
| zsweepexclude=zs1... | Exclude a certain address from being swept. Can be used multiple times to exclude multiple addressses | | zsweepexclude=zs1... | Exclude a certain address from being swept. Can be used multiple times to exclude multiple addressses |
1. The following HUSH RPC will let you view your zsweep configuration options and run-time stats at the command line: `hush-cli z_sweepstatus` 1. The following DragonX RPC will let you view your zsweep configuration options and run-time stats at the command line: `dragonx-cli z_sweepstatus`
## Consolidation ## Consolidation
@@ -50,10 +50,10 @@ Zsweep is when you sweep numerous zutxos into one z-address that you configure.
| Consolidation Option Name| Details of what it does | | Consolidation Option Name| Details of what it does |
|--------------------------|-------------------------| |--------------------------|-------------------------|
| consolidationtxfee=0 | The default consolidation fee is 10000 puposhis or 0.0001 HUSH, the default for all transactions. To use fee=0 for consolidation transactions, set this option. | | consolidationtxfee=0 | The default consolidation fee is 10000 puposhis or 0.0001 DRAGONX, the default for all transactions. To use fee=0 for consolidation transactions, set this option. |
| consolidatesaplingaddress=zs1... | Default of consolidation is set to all, but you can set this option if you have one specific z-address (zs1... is a placeholder for this documentation) that you want to only consolidate to. | | consolidatesaplingaddress=zs1... | Default of consolidation is set to all, but you can set this option if you have one specific z-address (zs1... is a placeholder for this documentation) that you want to only consolidate to. |
1. The following HUSH RPC will let you view your consolidation configuration options and run-time stats at the command line: `hush-cli z_sweepstatus` 1. The following DragonX RPC will let you view your consolidation configuration options and run-time stats at the command line: `dragonx-cli z_sweepstatus`
## Zsweep & Consolidation Together ## Zsweep & Consolidation Together
@@ -68,7 +68,7 @@ Zsweep is when you sweep numerous zutxos into one z-address that you configure.
### Copyright ### Copyright
jahway603 and The Hush Developers The DragonX Developers, jahway603, and The Hush Developers
### License ### License

View File

@@ -20,7 +20,7 @@ Possible options:
-h, --help show this help message and exit -h, --help show this help message and exit
--nocleanup Leave binaries and test.* datadir on exit or error --nocleanup Leave binaries and test.* datadir on exit or error
--noshutdown Don't stop full node after the test execution --noshutdown Don't stop full node after the test execution
--srcdir=SRCDIR Source directory containing hushd/hush-cli (default: ../../src) --srcdir=SRCDIR Source directory containing dragonxd/dragonx-cli (default: ../../src)
--tmpdir=TMPDIR Root directory for datadirs --tmpdir=TMPDIR Root directory for datadirs
--tracerpc Print out all RPC calls as they are made --tracerpc Print out all RPC calls as they are made
``` ```
@@ -30,7 +30,9 @@ If you set the environment variable `PYTHON_DEBUG=1` you will get some debug out
A 200-block -regtest blockchain and wallets for four nodes A 200-block -regtest blockchain and wallets for four nodes
is created the first time a regression test is run and is created the first time a regression test is run and
is stored in the cache/ directory. Each node has the miner is stored in the cache/ directory. Each node has the miner
subsidy from 25 mature blocks (`25*10=250 HUSH`) in its wallet. subsidy from 25 mature blocks in its wallet. The exact amount in DRAGONX
depends on the per-test `-ac_reward` (regtest subsidy), so it is not a
fixed figure across tests.
After the first run, the cache/ blockchain and wallets are After the first run, the cache/ blockchain and wallets are
copied into a temporary directory and used as the initial copied into a temporary directory and used as the initial
@@ -40,7 +42,7 @@ If you get into a bad state, you should be able to recover with:
```bash ```bash
rm -rf cache rm -rf cache
killall hushd killall dragonxd
``` ```
but beware that could kill various other processes you might not want to kill! but beware that could kill various other processes you might not want to kill!

View File

@@ -243,6 +243,7 @@ BITCOIN_CORE_H = \
wallet/asyncrpcoperation_mergetoaddress.h \ wallet/asyncrpcoperation_mergetoaddress.h \
wallet/asyncrpcoperation_saplingconsolidation.h \ wallet/asyncrpcoperation_saplingconsolidation.h \
wallet/asyncrpcoperation_sweep.h \ wallet/asyncrpcoperation_sweep.h \
wallet/asyncrpcoperation_autoshieldcoinbase.h \
wallet/asyncrpcoperation_sendmany.h \ wallet/asyncrpcoperation_sendmany.h \
wallet/asyncrpcoperation_shieldcoinbase.h \ wallet/asyncrpcoperation_shieldcoinbase.h \
wallet/crypter.h \ wallet/crypter.h \
@@ -321,6 +322,7 @@ libbitcoin_wallet_a_SOURCES = \
wallet/asyncrpcoperation_mergetoaddress.cpp \ wallet/asyncrpcoperation_mergetoaddress.cpp \
wallet/asyncrpcoperation_saplingconsolidation.cpp \ wallet/asyncrpcoperation_saplingconsolidation.cpp \
wallet/asyncrpcoperation_sweep.cpp \ wallet/asyncrpcoperation_sweep.cpp \
wallet/asyncrpcoperation_autoshieldcoinbase.cpp \
wallet/asyncrpcoperation_sendmany.cpp \ wallet/asyncrpcoperation_sendmany.cpp \
wallet/asyncrpcoperation_shieldcoinbase.cpp \ wallet/asyncrpcoperation_shieldcoinbase.cpp \
wallet/crypter.cpp \ wallet/crypter.cpp \

View File

@@ -20,7 +20,7 @@
#include "amount.h" #include "amount.h"
#include "tinyformat.h" #include "tinyformat.h"
const std::string CURRENCY_UNIT = "HUSH"; const std::string CURRENCY_UNIT = "DRAGONX";
CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
{ {

View File

@@ -101,7 +101,7 @@ public:
{ {
strNetworkID = "main"; strNetworkID = "main";
strCurrencyUnits = "HUSH"; strCurrencyUnits = "DRAGONX";
bip44CoinType = 141; // As registered in https://github.com/satoshilabs/slips/blob/master/slip-0044.md bip44CoinType = 141; // As registered in https://github.com/satoshilabs/slips/blob/master/slip-0044.md
consensus.fCoinbaseMustBeProtected = false; consensus.fCoinbaseMustBeProtected = false;
@@ -502,7 +502,7 @@ void hush_changeblocktime()
{ {
pCurrentParams->consensus.nMaxFutureBlockTime = 7 * ASSETCHAINS_BLOCKTIME; pCurrentParams->consensus.nMaxFutureBlockTime = 7 * ASSETCHAINS_BLOCKTIME;
pCurrentParams->consensus.nPowTargetSpacing = ASSETCHAINS_BLOCKTIME; pCurrentParams->consensus.nPowTargetSpacing = ASSETCHAINS_BLOCKTIME;
fprintf(stderr,"HUSH blocktime changing to %d seconds\n",ASSETCHAINS_BLOCKTIME); fprintf(stderr,"DragonX blocktime changing to %d seconds\n",ASSETCHAINS_BLOCKTIME);
} }
void hush_setactivation(int32_t height) void hush_setactivation(int32_t height)

View File

@@ -5,29 +5,17 @@
// Instead, update contrib/seeds/nodes_main.txt then run // Instead, update contrib/seeds/nodes_main.txt then run
// ./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h // ./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h
// OR run: make seeds // OR run: make seeds
#ifndef HUSH_CHAINPARAMSSEEDS_H #ifndef DRAGONX_CHAINPARAMSSEEDS_H
#define HUSH_CHAINPARAMSSEEDS_H #define DRAGONX_CHAINPARAMSSEEDS_H
// List of fixed seed nodes for the Hush network // List of fixed seed nodes for the DragonX network
// Each line contains a BIP155 serialized address. // Each line contains a BIP155 serialized address.
// //
static const uint8_t chainparams_seed_main[] = { static const uint8_t chainparams_seed_main[] = {
0x01,0x04,0x67,0x45,0x80,0x94,0x00,0x00, // 103.69.128.148 0x01,0x04,0xd4,0x38,0x29,0x3f,0x00,0x00, // 212.56.41.63
0x01,0x04,0xc2,0x1d,0x64,0xb3,0x00,0x00, // 194.29.100.179 0x01,0x04,0xc2,0x8c,0xc6,0xb0,0x00,0x00, // 194.140.198.176
0x01,0x04,0x2d,0x84,0x4b,0x45,0x00,0x00, // 45.132.75.69 0x01,0x04,0xd4,0x38,0x29,0x2f,0x00,0x00, // 212.56.41.47
0x01,0x04,0xaa,0xcd,0x27,0x27,0x00,0x00, // 170.205.39.39 0x01,0x04,0x90,0x7e,0x93,0xa5,0x00,0x00, // 144.126.147.165
0x01,0x04,0x95,0x1c,0x66,0xdb,0x00,0x00, // 149.28.102.219 0x01,0x04,0xb0,0x7e,0x57,0xf1,0x00,0x00, // 176.126.87.241
0x01,0x04,0x9b,0x8a,0xe4,0x44,0x00,0x00, // 155.138.228.68
0x01,0x04,0x6b,0xae,0x46,0xfb,0x00,0x00, // 107.174.70.251
0x01,0x04,0xb2,0xfa,0xbd,0x8d,0x00,0x00, // 178.250.189.141
0x04,0x20,0x0e,0x86,0xb6,0xfd,0x96,0xfe,0x06,0xda,0x39,0xeb,0x97,0x39,0xc9,0xd1,0x17,0xa2,0x4e,0x2b,0x75,0x4d,0xeb,0xb5,0xa1,0x34,0x1e,0x34,0x0a,0xcb,0x68,0xab,0xf0,0xe2,0x00,0x00, // b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion
0x04,0x20,0x1c,0x96,0x10,0x03,0xa6,0xa4,0xfa,0xa0,0x3e,0x13,0x1f,0x38,0xf0,0x9b,0xdd,0x9b,0xd7,0xdc,0x0e,0x40,0x61,0x71,0xed,0x1d,0x21,0x58,0xce,0x59,0x55,0x5e,0xe4,0x25,0x00,0x00, // dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion
0x04,0x20,0xac,0xa0,0x3a,0x31,0xa7,0xea,0x8e,0x90,0xc7,0x2b,0xbb,0x89,0x41,0x05,0x48,0xa0,0x10,0x29,0x8f,0x38,0x16,0xc9,0x94,0xbe,0xef,0x7e,0x9e,0x7d,0x98,0xb6,0x76,0x9f,0x00,0x00, // vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion
0x02,0x10,0x2a,0x0c,0xb6,0x41,0x06,0xf1,0x01,0x8e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00, // 2a0c:b641:6f1:18e::2
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x03,0x12,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:3:1269::1
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x02,0x3b,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:2:3b59::1
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x01,0x14,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:1:146e::1
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x04,0x21,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:4:2132::1
0x05,0x20,0xfb,0xa8,0xca,0x3d,0xf4,0xc9,0x83,0x95,0xa8,0x07,0x05,0x6f,0xf8,0x46,0x69,0x6d,0x42,0x75,0x22,0xe9,0x80,0xd8,0x43,0x7c,0xbe,0x29,0xda,0x33,0x14,0xf9,0xfb,0x17,0x00,0x00, // 7oumuppuzgbzlkahavx7qrtjnvbhkixjqdmeg7f6fhndgfhz7mlq.b32.i2p
}; };
static const uint8_t chainparams_seed_test[] = { static const uint8_t chainparams_seed_test[] = {

View File

@@ -591,6 +591,14 @@ int32_t hush_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notaryi
opretlen += (scriptbuf[len++] << 8); opretlen += (scriptbuf[len++] << 8);
} }
opoffset = len; opoffset = len;
// SECURITY (Finding #4): opretlen is attacker-controlled (up to 65535 via OP_PUSHDATA2)
// and was previously used with no bounds check. scriptbuf is a fixed DRAGON_MAXSCRIPTSIZE
// stack buffer in hush_connectblock, so an oversized opretlen drives out-of-bounds reads in
// the downstream 'K'/KV and notarization paths (persisted to disk, leaked via kvsearch RPC,
// reliable crash on block connect). Reject any opret claiming more bytes than actually
// remain in the real script; this mirrors the no-OP_RETURN fall-through so nothing valid changes.
if ( opretlen < 0 || opretlen > scriptlen - len )
return(notaryid);
matched = 0; matched = 0;
if ( SMART_CHAIN_SYMBOL[0] == 0 ) if ( SMART_CHAIN_SYMBOL[0] == 0 )
{ {
@@ -933,7 +941,7 @@ int32_t hush_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
if ( len >= sizeof(uint32_t) && len <= sizeof(scriptbuf) ) if ( len >= sizeof(uint32_t) && len <= sizeof(scriptbuf) )
{ {
memcpy(scriptbuf,(uint8_t *)&block.vtx[i].vout[j].scriptPubKey[0],len); memcpy(scriptbuf,(uint8_t *)&block.vtx[i].vout[j].scriptPubKey[0],len);
if ( len == 35 && scriptbuf[0] == 33 && scriptbuf[34] == 0xac ) if ( len == 35 && scriptbuf[0] == 33 && scriptbuf[34] == 0xac && numvalid < (int32_t)(sizeof(pubkeys)/sizeof(pubkeys[0])) )
{ {
memcpy(pubkeys[numvalid++],scriptbuf+1,33); memcpy(pubkeys[numvalid++],scriptbuf+1,33);
for (k=0; k<33; k++) for (k=0; k<33; k++)

View File

@@ -324,7 +324,7 @@ int32_t NSPV_mempoolfuncs(bits256 *satoshisp,int32_t *vindexp,std::vector<uint25
CScript scriptPubKey = tx.vout[tx.vout.size()-1].scriptPubKey; CScript scriptPubKey = tx.vout[tx.vout.size()-1].scriptPubKey;
if ( GetOpReturnData(scriptPubKey,vopret) != 0 ) if ( GetOpReturnData(scriptPubKey,vopret) != 0 )
{ {
if ( vopret[0] == evalcode && vopret[1] == func ) if ( vopret.size() >= 2 && vopret[0] == evalcode && vopret[1] == func )
{ {
txids.push_back(hash); txids.push_back(hash);
num++; num++;
@@ -657,7 +657,7 @@ void hush_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a reque
if ( timestamp > pfrom->prevtimes[ind] ) if ( timestamp > pfrom->prevtimes[ind] )
{ {
struct NSPV_utxosresp U; struct NSPV_utxosresp U;
if ( len < 64+5 && request[1] < 64 && (request[1] == len-3 || request[1] == len-7 || request[1] == len-11) ) if ( len >= 2 && len < 64+5 && request[1] < 64 && (request[1] == len-3 || request[1] == len-7 || request[1] == len-11) )
{ {
int32_t skipcount = 0; char coinaddr[64]; uint8_t filter; uint8_t isCC = 0; int32_t skipcount = 0; char coinaddr[64]; uint8_t filter; uint8_t isCC = 0;
memcpy(coinaddr,&request[2],request[1]); // request[1] < 64 bounds the copy + the terminator write memcpy(coinaddr,&request[2],request[1]); // request[1] < 64 bounds the copy + the terminator write
@@ -697,7 +697,7 @@ void hush_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a reque
if ( timestamp > pfrom->prevtimes[ind] ) if ( timestamp > pfrom->prevtimes[ind] )
{ {
struct NSPV_txidsresp T; struct NSPV_txidsresp T;
if ( len < 64+5 && request[1] < 64 && (request[1] == len-3 || request[1] == len-7 || request[1] == len-11) ) if ( len >= 2 && len < 64+5 && request[1] < 64 && (request[1] == len-3 || request[1] == len-7 || request[1] == len-11) )
{ {
int32_t skipcount = 0; char coinaddr[64]; uint32_t filter; uint8_t isCC = 0; int32_t skipcount = 0; char coinaddr[64]; uint32_t filter; uint8_t isCC = 0;
memcpy(coinaddr,&request[2],request[1]); // request[1] < 64 bounds the copy + the terminator write memcpy(coinaddr,&request[2],request[1]); // request[1] < 64 bounds the copy + the terminator write
@@ -730,7 +730,7 @@ void hush_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a reque
} }
NSPV_txidsresp_purge(&T); NSPV_txidsresp_purge(&T);
} }
} else fprintf(stderr,"len.%d req1.%d\n",len,request[1]); } else fprintf(stderr,"len.%d\n",len);
} }
} }
else if ( request[0] == NSPV_MEMPOOL ) else if ( request[0] == NSPV_MEMPOOL )
@@ -767,7 +767,7 @@ void hush_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a reque
NSPV_mempoolresp_purge(&M); NSPV_mempoolresp_purge(&M);
} }
} }
} else fprintf(stderr,"len.%d req1.%d\n",len,request[1]); } else fprintf(stderr,"len.%d\n",len);
} }
} }
else if ( request[0] == NSPV_NTZS ) else if ( request[0] == NSPV_NTZS )

View File

@@ -1466,7 +1466,7 @@ uint32_t hush_smartmagic(char *symbol,uint64_t supply,uint8_t *extraptr,int32_t
{ {
vcalc_sha256(0,hash.bytes,extraptr,extralen); vcalc_sha256(0,hash.bytes,extraptr,extralen);
crc0 = hash.uints[0]; crc0 = hash.uints[0];
fprintf(stderr,"HUSH raw magic="); fprintf(stderr,"DragonX raw magic=");
int32_t i; for (i=0; i<extralen; i++) int32_t i; for (i=0; i<extralen; i++)
fprintf(stderr,"%02x",extraptr[i]); fprintf(stderr,"%02x",extraptr[i]);
fprintf(stderr," extralen=%d crc0=%x\n",extralen,crc0); fprintf(stderr," extralen=%d crc0=%x\n",extralen,crc0);

View File

@@ -212,7 +212,7 @@ void Shutdown()
mempool.AddTransactionsUpdated(1); mempool.AddTransactionsUpdated(1);
if(fDebug) { if(fDebug) {
fprintf(stderr,"%s: stopping HUSH HTTP/REST/RPC\n", __FUNCTION__); fprintf(stderr,"%s: stopping DragonX HTTP/REST/RPC\n", __FUNCTION__);
} }
StopHTTPRPC(); StopHTTPRPC();
StopREST(); StopREST();
@@ -489,6 +489,12 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-zsweepexternal", _("Enable sweeping to an external wallet (default false)")); strUsage += HelpMessageOpt("-zsweepexternal", _("Enable sweeping to an external wallet (default false)"));
strUsage += HelpMessageOpt("-zsweepexclude", _("Addresses to exclude from sweeping (default none)")); strUsage += HelpMessageOpt("-zsweepexclude", _("Addresses to exclude from sweeping (default none)"));
strUsage += HelpMessageOpt("-autoshield", _("Automatically shield matured coinbase (mining rewards) into a wallet z-address (default: true). No-op when not mining or wallet is locked."));
strUsage += HelpMessageOpt("-autoshieldinterval", strprintf(_("Block interval between automatic coinbase-shielding rounds (default: %i, min 5)"), 25));
strUsage += HelpMessageOpt("-autoshieldaddress=<zaddr>", _("Destination Sapling z-address for auto-shielded coinbase (default: reuse or create a wallet z-address). Must be spendable by this wallet."));
strUsage += HelpMessageOpt("-autoshieldfee", strprintf(_("Fee in puposhis for automatic coinbase-shielding transactions (default: %i)"), 10000));
strUsage += HelpMessageOpt("-autoshieldminutxos", strprintf(_("Only auto-shield once at least this many matured coinbase UTXOs exist (default: %i)"), 1));
strUsage += HelpMessageOpt("-deletetx", _("Enable Old Transaction Deletion")); strUsage += HelpMessageOpt("-deletetx", _("Enable Old Transaction Deletion"));
strUsage += HelpMessageOpt("-deleteinterval", strprintf(_("Delete transaction every <n> blocks during inital block download (default: %i)"), DEFAULT_TX_DELETE_INTERVAL)); strUsage += HelpMessageOpt("-deleteinterval", strprintf(_("Delete transaction every <n> blocks during inital block download (default: %i)"), DEFAULT_TX_DELETE_INTERVAL));
strUsage += HelpMessageOpt("-keeptxnum", strprintf(_("Keep the last <n> transactions (default: %i)"), DEFAULT_TX_RETENTION_LASTTX)); strUsage += HelpMessageOpt("-keeptxnum", strprintf(_("Keep the last <n> transactions (default: %i)"), DEFAULT_TX_RETENTION_LASTTX));
@@ -2451,6 +2457,55 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
} }
} }
//Set Automatic Coinbase Shielding (default ON, conditional: self-guards
//on nodes where it cannot act - no owned coinbase, external mineraddress,
//or locked wallet). Closes the transparent-coinbase leak for miners.
pwalletMain->fAutoShieldEnabled = GetBoolArg("-autoshield", true);
if (pwalletMain->fAutoShieldEnabled) {
int autoShieldInterval = GetArg("-autoshieldinterval", 25);
if (autoShieldInterval < 5) {
fprintf(stderr,"%s: Invalid autoshield interval of %d < 5, setting to default of 25\n", __func__, autoShieldInterval);
autoShieldInterval = 25;
}
pwalletMain->autoShieldInterval = autoShieldInterval;
pwalletMain->nextAutoShield = pwalletMain->autoShieldInterval + chainActive.Height();
// Validate the fee: floor it above the relay minimum and cap it to
// guard against a fat-finger (e.g. -autoshieldfee=5000000000) that
// would otherwise build an over-fee or malformed shield tx that
// fails mempool admission every round.
CAmount autoShieldFee = GetArg("-autoshieldfee", 10000);
const CAmount AUTOSHIELD_MIN_FEE = 1000; // comfortably above minRelayTxFee for a small tx
const CAmount AUTOSHIELD_MAX_FEE = 10000000; // 0.1 DRGX; no sane autoshield fee exceeds this
if (autoShieldFee < AUTOSHIELD_MIN_FEE || autoShieldFee > AUTOSHIELD_MAX_FEE) {
fprintf(stderr,"%s: -autoshieldfee=%lld out of range [%lld,%lld], using default 10000\n",
__func__, (long long)autoShieldFee, (long long)AUTOSHIELD_MIN_FEE, (long long)AUTOSHIELD_MAX_FEE);
autoShieldFee = 10000;
}
pwalletMain->autoShieldFee = autoShieldFee;
pwalletMain->autoShieldMinUtxos = GetArg("-autoshieldminutxos", 1);
if (pwalletMain->autoShieldMinUtxos < 1) {
pwalletMain->autoShieldMinUtxos = 1;
}
LogPrintf("%s: autoshield enabled, nextAutoShield=%d interval=%d\n", __func__, pwalletMain->nextAutoShield, pwalletMain->autoShieldInterval);
//Optional explicit destination z-address. Must be a Sapling zaddr the
//wallet can spend, else the shielded coinbase would be unrecoverable.
std::string autoShieldAddress = GetArg("-autoshieldaddress", "");
if (!autoShieldAddress.empty()) {
auto zdest = DecodePaymentAddress(autoShieldAddress);
if (!IsValidPaymentAddress(zdest) ||
boost::get<libzcash::SaplingPaymentAddress>(&zdest) == nullptr) {
return InitError("Invalid -autoshieldaddress: must be a Sapling z-address");
}
auto hasSpendingKey = boost::apply_visitor(HaveSpendingKeyForPaymentAddress(pwalletMain), zdest);
if (!hasSpendingKey) {
return InitError("Wallet must hold the spending key of -autoshieldaddress (else shielded coinbase would be unrecoverable)");
}
pwalletMain->autoShieldAddress = autoShieldAddress;
}
}
//Set Transaction Deletion Options //Set Transaction Deletion Options
fTxDeleteEnabled = GetBoolArg("-deletetx", false); fTxDeleteEnabled = GetBoolArg("-deletetx", false);
fTxConflictDeleteEnabled = GetBoolArg("-deleteconflicttx", true); fTxConflictDeleteEnabled = GetBoolArg("-deleteconflicttx", true);

View File

@@ -328,6 +328,8 @@ namespace {
bool fBulkHeaderSeen; bool fBulkHeaderSeen;
//! (server side) time (us) we last served a bulk stream to this peer, for flood throttling. //! (server side) time (us) we last served a bulk stream to this peer, for flood throttling.
int64_t nLastBulkServeTime; int64_t nLastBulkServeTime;
//! (#8 IBD header-flood cap) cumulative headers this peer made us process while in IBD.
int64_t nHeadersProcessed;
CNodeState() { CNodeState() {
fCurrentlyConnected = false; fCurrentlyConnected = false;
@@ -348,6 +350,7 @@ namespace {
nBulkHashStart.SetNull(); nBulkHashStart.SetNull();
fBulkHeaderSeen = false; fBulkHeaderSeen = false;
nLastBulkServeTime = 0; nLastBulkServeTime = 0;
nHeadersProcessed = 0;
} }
}; };
@@ -5454,10 +5457,15 @@ bool AcceptBlockHeader(int32_t *futureblockp,const CBlockHeader& block, CValidat
} }
return true; return true;
} }
// SECURITY (header-flood DoS): once synced, verify PoW at header-accept time so a peer cannot // Header-accept does NOT verify RandomX PoW (fCheckPOW=0). The RandomX key for a header is derived
// flood unbounded PoW-less headers into mapBlockIndex (they now fail RandomX -> DoS-ban). During // from the block at keyHeight on the header's OWN branch, which is not reliably resolvable at
// IBD keep fCheckPOW=0 for fast header sync; the full RandomX/target check runs at block connect. // header-accept time (reorg / side-branch / catch-up headers are not on the active chain), so a
if (!CheckBlockHeader(futureblockp,*ppindex!=0?(*ppindex)->GetHeight():0,*ppindex, block, state, IsInitialBlockDownload() ? 0 : 1)) { // header-time RandomX check repeatedly false-rejected valid reorg headers and hard-banned honest
// peers (see audit notes; reverted b9fdc7981/7e9b2c661/defer). The full RandomX + target check runs
// at block-connect with the correct branch key. Fake low-work chains are gated from SELECTION by
// nMinimumChainWork; the per-peer IBD header cap bounds flood memory. Do NOT re-enable a header-time
// RandomX check without first deriving the key from the header's own ancestry (pindexPrev->GetAncestor).
if (!CheckBlockHeader(futureblockp,*ppindex!=0?(*ppindex)->GetHeight():0,*ppindex, block, state, 0)) {
if ( *futureblockp == 0 ) { if ( *futureblockp == 0 ) {
LogPrintf("%s: CheckBlockHeader futureblock=0\n", __func__); LogPrintf("%s: CheckBlockHeader futureblock=0\n", __func__);
return false; return false;
@@ -7587,6 +7595,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
uint256 hashStop; uint256 hashStop;
vRecv >> locator >> hashStop; vRecv >> locator >> hashStop;
// Bound the locator before FindForkInGlobalIndex() scans it linearly under cs_main. An honest
// GetLocator() never exceeds MAX_LOCATOR_SZ, so this cannot reject a valid peer; an oversized
// vHave (~130k hashes fit in one message) is a message-thread liveness DoS. Ban like the
// adjacent vInv > MAX_INV_SZ path.
if (locator.vHave.size() > MAX_LOCATOR_SZ) {
Misbehaving(pfrom->GetId(), 20);
return true;
}
LOCK(cs_main); LOCK(cs_main);
// Find the last block the caller has in the main chain // Find the last block the caller has in the main chain
@@ -7619,6 +7636,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
uint256 hashStop; uint256 hashStop;
vRecv >> locator >> hashStop; vRecv >> locator >> hashStop;
// Bound the locator before FindForkInGlobalIndex() scans it linearly under cs_main. An honest
// GetLocator() never exceeds MAX_LOCATOR_SZ, so this cannot reject a valid peer; an oversized
// vHave (~130k hashes fit in one message) is a message-thread liveness DoS. Ban like the
// adjacent vInv > MAX_INV_SZ path.
if (locator.vHave.size() > MAX_LOCATOR_SZ) {
Misbehaving(pfrom->GetId(), 20);
return true;
}
LOCK(cs_main); LOCK(cs_main);
@@ -7853,6 +7879,32 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
} }
} }
// SECURITY (#8: IBD header-flood cap): bound how many headers a single peer can make us
// store while in IBD. Honest headers-first sync needs at most ~chain-length headers from a
// peer; one that floods far past 2x the known chain length is only trying to bloat
// mapBlockIndex/leveldb (such headers are never selected -- nMinimumChainWork gates that --
// but they still cost memory/disk). Cap per-peer and drop the peer. IBD-only: post-IBD there is
// no header-accept PoW check (removed as bug-prone), so a post-IBD flood is bounded only by
// nMinimumChainWork gating selection -- memory/disk growth there is accepted as low-severity.
if (IsInitialBlockDownload()) {
CNodeState *hstate = State(pfrom->GetId());
if (hstate != NULL) {
hstate->nHeadersProcessed += (int64_t)nCount;
// Cap RELATIVE TO THE VALIDATED ACTIVE-CHAIN HEIGHT (attacker-hard -- advancing it requires
// connecting real PoW blocks), NOT pindexBestHeader: a forward-extending header flood advances
// pindexBestHeader in lockstep with the attacker, so a pindexBestHeader-relative cap never fires.
// The checkpoint height is a fixed floor so honest IBD (blocks still lagging headers) is never capped.
int knownH = std::max((int)chainActive.Height(),
Checkpoints::GetTotalBlocksEstimate(chainparams.Checkpoints()));
int64_t headerCap = 2 * (int64_t)knownH + 200000;
if (hstate->nHeadersProcessed > headerCap) {
Misbehaving(pfrom->GetId(), 100);
return error("%s: peer=%d flooded %lld headers during IBD (cap %lld)", __func__,
pfrom->id, (long long)hstate->nHeadersProcessed, (long long)headerCap);
}
}
}
if (pindexLast) if (pindexLast)
UpdateBlockAvailability(pfrom->GetId(), pindexLast->GetBlockHash()); UpdateBlockAvailability(pfrom->GetId(), pindexLast->GetBlockHash());

View File

@@ -130,6 +130,12 @@ static const unsigned int BLOCK_STALLING_TIMEOUT = 2;
* peer's 160-header reply as "tip reached" and stall header sync. Raise only as a coordinated * peer's 160-header reply as "tip reached" and stall header sync. Raise only as a coordinated
* network upgrade (with a protocol-version bump). */ * network upgrade (with a protocol-version bump). */
static const unsigned int MAX_HEADERS_RESULTS = 160; static const unsigned int MAX_HEADERS_RESULTS = 160;
/** Maximum number of entries we accept in a CBlockLocator.vHave (GETBLOCKS / GETHEADERS). An honest
* CChain::GetLocator() emits ~10 linear hashes then exponentially-spaced ones, so even a chain of
* 2^91 blocks stays well under this bound (GetLocator reserves 32). Matches upstream Bitcoin Core's
* MAX_LOCATOR_SZ. A larger vHave is a peer trying to make FindForkInGlobalIndex() linearly scan a
* huge list under cs_main (message-thread liveness DoS). */
static const unsigned int MAX_LOCATOR_SZ = 101;
/** Size of the "block download window": how far ahead of our current height do we fetch? /** Size of the "block download window": how far ahead of our current height do we fetch?
* Larger windows tolerate larger download speed differences between peer, but increase the potential * Larger windows tolerate larger download speed differences between peer, but increase the potential
* degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning * degree of disordering of blocks on disk (which make reindexing and in the future perhaps pruning

View File

@@ -926,7 +926,7 @@ UniValue kvsearch(const UniValue& params, bool fHelp, const CPubKey& mypk)
LOCK(cs_main); LOCK(cs_main);
if ( (keylen= (int32_t)strlen(params[0].get_str().c_str())) > 0 ) if ( (keylen= (int32_t)strlen(params[0].get_str().c_str())) > 0 )
{ {
ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL))); ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "DRAGONX" : SMART_CHAIN_SYMBOL)));
ret.push_back(Pair("currentheight", (int64_t)chainActive.LastTip()->GetHeight())); ret.push_back(Pair("currentheight", (int64_t)chainActive.LastTip()->GetHeight()));
ret.push_back(Pair("key",params[0].get_str())); ret.push_back(Pair("key",params[0].get_str()));
ret.push_back(Pair("keylen",keylen)); ret.push_back(Pair("keylen",keylen));

View File

@@ -104,7 +104,7 @@ UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk)
} }
//fprintf(stderr,"height_MoM height.%d\n",height); //fprintf(stderr,"height_MoM height.%d\n",height);
depth = hush_MoM(&notarized_height,&MoM,&hushtxid,height,&MoMoM,&MoMoMoffset,&MoMoMdepth,&hushstarti,&hushendi); depth = hush_MoM(&notarized_height,&MoM,&hushtxid,height,&MoMoM,&MoMoMoffset,&MoMoMdepth,&hushstarti,&hushendi);
ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL))); ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "DRAGONX" : SMART_CHAIN_SYMBOL)));
ret.push_back(Pair("height",height)); ret.push_back(Pair("height",height));
ret.push_back(Pair("timestamp",(uint64_t)timestamp)); ret.push_back(Pair("timestamp",(uint64_t)timestamp));
if ( depth > 0 ) if ( depth > 0 )
@@ -165,7 +165,7 @@ UniValue calc_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk)
throw runtime_error("calc_MoM illegal height or MoMdepth\n"); throw runtime_error("calc_MoM illegal height or MoMdepth\n");
//fprintf(stderr,"height_MoM height.%d\n",height); //fprintf(stderr,"height_MoM height.%d\n",height);
MoM = hush_calcMoM(height,MoMdepth); MoM = hush_calcMoM(height,MoMdepth);
ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL))); ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "DRAGONX" : SMART_CHAIN_SYMBOL)));
ret.push_back(Pair("height",height)); ret.push_back(Pair("height",height));
ret.push_back(Pair("MoMdepth",MoMdepth)); ret.push_back(Pair("MoMdepth",MoMdepth));
ret.push_back(Pair("MoM",MoM.GetHex())); ret.push_back(Pair("MoM",MoM.GetHex()));
@@ -235,7 +235,7 @@ UniValue getNotarizationsForBlock(const UniValue& params, bool fHelp, const CPub
item.push_back(make_pair("notaries",notaryarr)); item.push_back(make_pair("notaries",notaryarr));
hush.push_back(item); hush.push_back(item);
} }
out.push_back(make_pair("HUSH", hush)); out.push_back(make_pair("DRAGONX", hush));
return out; return out;
} }

View File

@@ -387,7 +387,7 @@ UniValue genminingCSV(const UniValue& params, bool fHelp, const CPubKey& mypk)
if (fHelp || params.size() != 0 ) if (fHelp || params.size() != 0 )
throw runtime_error("genminingCSV\n"); throw runtime_error("genminingCSV\n");
LOCK(cs_main); LOCK(cs_main);
sprintf(fname,"%s_mining.csv",SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL); sprintf(fname,"%s_mining.csv",SMART_CHAIN_SYMBOL[0] == 0 ? "DRAGONX" : SMART_CHAIN_SYMBOL);
if ( (fp= fopen(fname,"wb")) != 0 ) if ( (fp= fopen(fname,"wb")) != 0 )
{ {
fprintf(fp,"height,nTime,nBits,bnTarget,bnTargetB,diff,solvetime\n"); fprintf(fp,"height,nTime,nBits,bnTarget,bnTargetB,diff,solvetime\n");
@@ -1019,8 +1019,8 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp, const CPubKey& mypk
"1. height (numeric, optional) The block height. If not provided, defaults to the current height of the chain.\n" "1. height (numeric, optional) The block height. If not provided, defaults to the current height of the chain.\n"
"\nResult:\n" "\nResult:\n"
"{\n" "{\n"
" \"miner\" : x.xxx (numeric) The mining reward amount in HUSH.\n" " \"miner\" : x.xxx (numeric) The mining reward amount in DRAGONX.\n"
" \"ac_pubkey\" : x.xxx (numeric) The mining reward amount in HUSH.\n" " \"ac_pubkey\" : x.xxx (numeric) The mining reward amount in DRAGONX.\n"
"}\n" "}\n"
"\nExamples:\n" "\nExamples:\n"
+ HelpExampleCli("getblocksubsidy", "1000") + HelpExampleCli("getblocksubsidy", "1000")

View File

@@ -307,7 +307,7 @@ UniValue getinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
} }
if ( ASSETCHAINS_CC != 0 ) if ( ASSETCHAINS_CC != 0 )
obj.push_back(Pair("CCid", (int)ASSETCHAINS_CC)); obj.push_back(Pair("CCid", (int)ASSETCHAINS_CC));
obj.push_back(Pair("name", SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL)); obj.push_back(Pair("name", SMART_CHAIN_SYMBOL[0] == 0 ? "DRAGONX" : SMART_CHAIN_SYMBOL));
obj.push_back(Pair("p2pport", ASSETCHAINS_P2PPORT)); obj.push_back(Pair("p2pport", ASSETCHAINS_P2PPORT));
obj.push_back(Pair("rpcport", ASSETCHAINS_RPCPORT)); obj.push_back(Pair("rpcport", ASSETCHAINS_RPCPORT));
@@ -445,7 +445,7 @@ UniValue coinsupply(const UniValue& params, bool fHelp, const CPubKey& mypk)
if ( (supply= hush_coinsupply(&zfunds,height)) > 0 ) if ( (supply= hush_coinsupply(&zfunds,height)) > 0 )
{ {
result.push_back(Pair("result", "success")); result.push_back(Pair("result", "success"));
result.push_back(Pair("coin", SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL)); result.push_back(Pair("coin", SMART_CHAIN_SYMBOL[0] == 0 ? "DRAGONX" : SMART_CHAIN_SYMBOL));
result.push_back(Pair("height", (int)height)); result.push_back(Pair("height", (int)height));
result.push_back(Pair("supply", ValueFromAmount(supply))); result.push_back(Pair("supply", ValueFromAmount(supply)));
result.push_back(Pair("zfunds", ValueFromAmount(zfunds))); result.push_back(Pair("zfunds", ValueFromAmount(zfunds)));
@@ -560,7 +560,7 @@ UniValue z_validateaddress(const UniValue& params, bool fHelp, const CPubKey& my
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
LOCK2(cs_main, pwalletMain->cs_wallet); LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL);
#else #else
LOCK(cs_main); LOCK(cs_main);
#endif #endif

View File

@@ -628,7 +628,7 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp, const CPubKey&
" ]\n" " ]\n"
"2. \"outputs\" (object, required) a json object with outputs\n" "2. \"outputs\" (object, required) a json object with outputs\n"
" {\n" " {\n"
" \"address\": x.xxx, (numeric or string, required) The key is the HUSH address or script (in hex), the numeric value (can be string) is the " + CURRENCY_UNIT + " amount\n" " \"address\": x.xxx, (numeric or string, required) The key is the DragonX address or script (in hex), the numeric value (can be string) is the " + CURRENCY_UNIT + " amount\n"
" \"data\": \"hex\" (string, optional) The key is \"data\", the value is hex encoded OP_RETURN data\n" " \"data\": \"hex\" (string, optional) The key is \"data\", the value is hex encoded OP_RETURN data\n"
" ,...\n" " ,...\n"
" }\n" " }\n"
@@ -804,7 +804,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp, const CPubKey&
" \"reqSigs\" : n, (numeric) The required sigs\n" " \"reqSigs\" : n, (numeric) The required sigs\n"
" \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n"
" \"addresses\" : [ (json array of string)\n" " \"addresses\" : [ (json array of string)\n"
" \"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\" (string) HUSH address\n" " \"RTZMZHDFSTFQst8XmX2dR4DaH87cEUs3gC\" (string) DragonX address\n"
" ,...\n" " ,...\n"
" ]\n" " ]\n"
" }\n" " }\n"

View File

@@ -0,0 +1,315 @@
// Copyright (c) 2016-2024 The Hush developers
// Copyright (c) 2024-2026 The DragonX developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#include "asyncrpcoperation_autoshieldcoinbase.h"
#include "asyncrpcoperation_shieldcoinbase.h" // for ShieldCoinbaseUTXO
#include "consensus/upgrades.h"
#include "hush_defs.h" // ASSETCHAINS_TIMELOCKGTE
#include "init.h"
#include "key_io.h"
#include "main.h"
#include "rpc/protocol.h"
#include "sync.h"
#include "tinyformat.h"
#include "transaction_builder.h"
#include "util.h"
#include "utilmoneystr.h"
#include "wallet.h"
// Sietch dummy zaddr generator (defined in wallet/rpcwallet.cpp)
extern std::string randomSietchZaddr();
// Serialized-size estimates for one spent input (kept in sync with rpcwallet.cpp)
static const size_t AUTOSHIELD_CTXIN_DUST_SIZE = 148;
static const size_t AUTOSHIELD_CTXIN_P2SH_SIZE = 400;
// Expire unmined autoshield txs after this many blocks, so a tx cannot straddle
// a network-upgrade activation.
static const int AUTOSHIELD_EXPIRY_DELTA = 15;
AsyncRPCOperation_autoshieldcoinbase::AsyncRPCOperation_autoshieldcoinbase(int targetHeight)
: targetHeight_(targetHeight) {}
AsyncRPCOperation_autoshieldcoinbase::~AsyncRPCOperation_autoshieldcoinbase() {}
void AsyncRPCOperation_autoshieldcoinbase::main() {
if (isCancelled()) {
// Only the CURRENT op owns the scheduler flag; a stale/cancelled op must
// not clear it out from under a freshly-enqueued successor.
if (pwalletMain) {
LOCK(pwalletMain->cs_wallet);
if (getId() == pwalletMain->saplingAutoShieldOperationId) {
pwalletMain->fAutoShieldRunning = false;
}
}
return;
}
set_state(OperationStatus::EXECUTING);
start_execution_clock();
bool success = false;
try {
success = main_impl();
} catch (const UniValue& objError) {
int code = find_value(objError, "code").get_int();
std::string message = find_value(objError, "message").get_str();
set_error_code(code);
set_error_message(message);
} catch (const runtime_error& e) {
set_error_code(-1);
set_error_message("runtime error: " + string(e.what()));
} catch (const logic_error& e) {
set_error_code(-1);
set_error_message("logic error: " + string(e.what()));
} catch (const exception& e) {
set_error_code(-1);
set_error_message("general exception: " + string(e.what()));
} catch (...) {
set_error_code(-2);
set_error_message("unknown error");
}
stop_execution_clock();
// ALWAYS advance the interval and clear the running flag, on success AND
// failure AND exception, so a failed/oversized/locked round still lets the
// next round fire. Only the CURRENT op does this bookkeeping: if a newer op
// has already superseded this one, leave its state untouched.
if (pwalletMain) {
LOCK2(cs_main, pwalletMain->cs_wallet);
if (getId() == pwalletMain->saplingAutoShieldOperationId) {
int tipHeight = (chainActive.Tip() != NULL) ? chainActive.Tip()->GetHeight() : targetHeight_;
pwalletMain->nextAutoShield = pwalletMain->autoShieldInterval + tipHeight;
pwalletMain->fAutoShieldRunning = false;
}
}
set_state(success ? OperationStatus::SUCCESS : OperationStatus::FAILED);
setResult();
LogPrintf("%s: autoshield operation finished (status=%s, txs=%d, shielded=%s)\n",
getId(), getStateAsString(), numTxCreated_, FormatMoney(amountShielded_));
}
// Enumerate wallet-owned Sapling addresses and pick a spendable one; if none
// exists, generate a fresh one (needs an unlocked wallet, which the caller has
// already ensured). Caller must hold cs_wallet.
bool AsyncRPCOperation_autoshieldcoinbase::resolveDestination(
libzcash::SaplingPaymentAddress& destOut, std::string& destStrOut) {
// 1. Explicit -autoshieldaddress override (validated + spend-key-checked at init)
if (!pwalletMain->autoShieldAddress.empty()) {
auto decoded = DecodePaymentAddress(pwalletMain->autoShieldAddress);
if (boost::get<libzcash::SaplingPaymentAddress>(&decoded) != nullptr) {
destOut = boost::get<libzcash::SaplingPaymentAddress>(decoded);
destStrOut = pwalletMain->autoShieldAddress;
return true;
}
LogPrintf("%s: configured -autoshieldaddress is not a valid Sapling address\n", getId());
return false;
}
// 2. Reuse the first spendable wallet-owned Sapling address (std::set order
// is deterministic, so this is stable across rounds/restarts).
std::set<libzcash::SaplingPaymentAddress> addrs;
pwalletMain->GetSaplingPaymentAddresses(addrs);
for (const auto& a : addrs) {
libzcash::SaplingExtendedSpendingKey extsk;
if (pwalletMain->GetSaplingExtendedSpendingKey(a, extsk)) {
destOut = a;
destStrOut = EncodePaymentAddress(a);
// Cache it so we keep reusing the same address.
pwalletMain->autoShieldAddress = destStrOut;
return true;
}
}
// 3. No spendable z-addr yet: create one (requires unlocked wallet / HD seed).
if (pwalletMain->IsLocked()) {
return false;
}
try {
destOut = pwalletMain->GenerateNewSaplingZKey();
destStrOut = EncodePaymentAddress(destOut);
pwalletMain->autoShieldAddress = destStrOut;
LogPrintf("%s: generated new autoshield destination z-address %s\n", getId(), destStrOut);
return true;
} catch (const std::exception& e) {
LogPrintf("%s: could not generate a destination z-address: %s\n", getId(), e.what());
return false;
}
}
bool AsyncRPCOperation_autoshieldcoinbase::main_impl() {
auto opid = getId();
LogPrintf("%s: Beginning asyncrpcoperation_autoshieldcoinbase.\n", opid);
auto consensusParams = Params().GetConsensus();
int tipHeight;
{
LOCK(cs_main);
tipHeight = (chainActive.Tip() != NULL) ? chainActive.Tip()->GetHeight() : targetHeight_;
}
// Don't create a tx that could be mined before, but expire after, a NU
// activation. Key this off tipHeight (the height we actually set the expiry
// from below), not the stale enqueue-time targetHeight_, so a queue delay
// cannot slip a straddling expiry past this guard.
auto nextActivationHeight = NextActivationHeight(tipHeight, consensusParams);
if (nextActivationHeight && tipHeight + AUTOSHIELD_EXPIRY_DELTA >= nextActivationHeight.get()) {
LogPrintf("%s: autoshield tx could expire across a NU activation. Skipping this round.\n", opid);
return true;
}
libzcash::SaplingPaymentAddress destZaddr;
std::string destStr;
std::vector<ShieldCoinbaseUTXO> inputs;
CAmount shieldedValue = 0;
unsigned int max_tx_size = MAX_TX_SIZE_AFTER_SAPLING;
{
LOCK2(cs_main, pwalletMain->cs_wallet);
// Defensive: the scheduler already skips while locked, but the wallet
// could have been locked between enqueue and execution.
if (pwalletMain->IsLocked()) {
LogPrintf("%s: wallet is locked, skipping autoshield round\n", opid);
return true;
}
if (!resolveDestination(destZaddr, destStr)) {
LogPrintf("%s: no spendable destination z-address available, skipping\n", opid);
return true;
}
// Gather matured, spendable coinbase UTXOs, byte-capped to a single tx.
// AvailableCoins with fOnlySpendable already excludes immature coinbase
// (< COINBASE_MATURITY) and outputs we don't own, so external
// -mineraddress / pool coinbase naturally yields zero inputs.
size_t estimatedTxSize = 2000; // header + sietch outputs headroom
std::vector<COutput> vecOutputs;
pwalletMain->AvailableCoins(vecOutputs, true, NULL, false, true);
for (const COutput& out : vecOutputs) {
if (!out.fSpendable || !out.tx->IsCoinBase()) {
continue;
}
CTxDestination address;
if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) {
continue;
}
size_t increase = (boost::get<CScriptID>(&address) != nullptr)
? AUTOSHIELD_CTXIN_P2SH_SIZE : AUTOSHIELD_CTXIN_DUST_SIZE;
if (estimatedTxSize + increase >= max_tx_size) {
// Size-safe batch; the remainder is shielded next round.
LogPrintf("%s: reached per-tx size cap; deferring remaining coinbase to next round\n", opid);
break;
}
estimatedTxSize += increase;
ShieldCoinbaseUTXO utxo = { out.tx->GetHash(), out.i,
out.tx->vout[out.i].scriptPubKey,
out.tx->vout[out.i].nValue };
inputs.push_back(utxo);
shieldedValue += out.tx->vout[out.i].nValue;
}
}
CAmount fee = pwalletMain->autoShieldFee;
if (inputs.size() < (size_t)pwalletMain->autoShieldMinUtxos) {
LogPrintf("%s: %d matured coinbase utxo(s) < min %d, skipping this round\n",
opid, (int)inputs.size(), pwalletMain->autoShieldMinUtxos);
return true;
}
if (shieldedValue <= fee) {
LogPrintf("%s: matured coinbase value %s <= fee %s, skipping\n",
opid, FormatMoney(shieldedValue), FormatMoney(fee));
return true;
}
// Common outgoing viewing key derived from the HD seed, exactly as
// z_shieldcoinbase does for t->z (keeps the note recoverable).
HDSeed seed;
if (!pwalletMain->GetHDSeedForDerivation(seed)) {
LogPrintf("%s: HD seed not available, skipping\n", opid);
return true;
}
uint256 ovk = ovkForShieldingFromTaddr(seed);
// Build the t->z shield tx. Proof generation happens in Build() WITHOUT
// holding cs_wallet (mirrors the sweep op) so we don't stall wallet RPCs.
auto builder = TransactionBuilder(consensusParams, targetHeight_, pwalletMain);
builder.SetExpiryHeight(tipHeight + AUTOSHIELD_EXPIRY_DELTA);
builder.SetFee(fee);
for (const auto& t : inputs) {
if (t.amount >= ASSETCHAINS_TIMELOCKGTE) {
builder.SetLockTime((uint32_t)tipHeight);
builder.AddTransparentInput(COutPoint(t.txid, t.vout), t.scriptPubKey, t.amount, 0xfffffffe);
} else {
builder.AddTransparentInput(COutPoint(t.txid, t.vout), t.scriptPubKey, t.amount);
}
}
// All input value (less fee) goes back to our own z-address as change.
builder.SendChangeTo(destZaddr, ovk);
// Sietch padding: mirror z_shieldcoinbase's two dummy zouts so autoshield
// txs are structurally indistinguishable from manual coinbase shields.
for (int i = 0; i < 2; i++) {
auto zdust = DecodePaymentAddress(randomSietchZaddr());
if (IsValidPaymentAddress(zdust)) {
builder.AddSaplingOutput(ovk, boost::get<libzcash::SaplingPaymentAddress>(zdust), 0);
}
}
auto maybe_tx = builder.Build();
if (!maybe_tx) {
LogPrintf("%s: Failed to build autoshield transaction.\n", opid);
return false;
}
CTransaction tx = maybe_tx.get();
if (isCancelled()) {
LogPrintf("%s: Cancelled before commit.\n", opid);
return false;
}
if (pwalletMain->CommitAutomatedTx(tx)) {
LogPrintf("%s: shielded %s coinbase (%d utxos) into %s via txid=%s\n",
opid, FormatMoney(shieldedValue - fee), (int)inputs.size(),
destStr, tx.GetHash().ToString());
amountShielded_ += shieldedValue - fee;
shieldTxIds_.push_back(tx.GetHash().ToString());
numTxCreated_++;
return true;
}
LogPrintf("%s: autoshield tx FAILED in CommitTransaction, txid=%s\n", opid, tx.GetHash().ToString());
return false;
}
void AsyncRPCOperation_autoshieldcoinbase::setResult() {
UniValue res(UniValue::VOBJ);
res.push_back(Pair("num_tx_created", numTxCreated_));
res.push_back(Pair("amount_shielded", FormatMoney(amountShielded_)));
UniValue txIds(UniValue::VARR);
for (const std::string& txId : shieldTxIds_) {
txIds.push_back(txId);
}
res.push_back(Pair("shield_txids", txIds));
set_result(res);
}
void AsyncRPCOperation_autoshieldcoinbase::cancel() {
set_state(OperationStatus::CANCELLED);
}
UniValue AsyncRPCOperation_autoshieldcoinbase::getStatus() const {
UniValue v = AsyncRPCOperation::getStatus();
UniValue obj = v.get_obj();
obj.push_back(Pair("method", "autoshieldcoinbase"));
obj.push_back(Pair("target_height", targetHeight_));
return obj;
}

View File

@@ -0,0 +1,58 @@
// Copyright (c) 2016-2024 The Hush developers
// Copyright (c) 2024-2026 The DragonX developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#ifndef ASYNCRPCOPERATION_AUTOSHIELDCOINBASE_H
#define ASYNCRPCOPERATION_AUTOSHIELDCOINBASE_H
#include "amount.h"
#include "asyncrpcoperation.h"
#include "univalue.h"
#include "zcash/Address.hpp"
#include "zcash/zip32.h"
// Default fee for automatic coinbase-shielding transactions
static const CAmount DEFAULT_AUTOSHIELD_FEE = 10000;
// A periodic, wallet-local operation that drains matured *transparent* coinbase
// UTXOs into a wallet-owned Sapling z-address in size-bounded batches. It is the
// automatic sibling of the manual z_shieldcoinbase RPC and mirrors the dispatch
// model of AsyncRPCOperation_sweep (self-gathers on the async worker thread,
// commits via CWallet::CommitAutomatedTx). It never mints a transparent output,
// so it respects the ac_private=1 transparent-output ban, and it deliberately
// does NOT toggle mining (unlike z_shieldcoinbase) so it can run every interval
// on a mining node without thrashing the miner.
class AsyncRPCOperation_autoshieldcoinbase : public AsyncRPCOperation
{
public:
AsyncRPCOperation_autoshieldcoinbase(int targetHeight);
virtual ~AsyncRPCOperation_autoshieldcoinbase();
// We don't want to be copied or moved around
AsyncRPCOperation_autoshieldcoinbase(AsyncRPCOperation_autoshieldcoinbase const&) = delete;
AsyncRPCOperation_autoshieldcoinbase(AsyncRPCOperation_autoshieldcoinbase&&) = delete;
AsyncRPCOperation_autoshieldcoinbase& operator=(AsyncRPCOperation_autoshieldcoinbase const&) = delete;
AsyncRPCOperation_autoshieldcoinbase& operator=(AsyncRPCOperation_autoshieldcoinbase&&) = delete;
virtual void main();
virtual void cancel();
virtual UniValue getStatus() const;
private:
int targetHeight_;
int numTxCreated_ = 0;
CAmount amountShielded_ = 0;
std::vector<std::string> shieldTxIds_;
bool main_impl();
// Resolve a spendable, wallet-owned Sapling destination: the configured
// -autoshieldaddress if set, else the first spendable z-addr the wallet
// holds, else a freshly generated one (requires an unlocked wallet).
// Returns false if none is available (e.g. locked wallet with no z-addr).
bool resolveDestination(libzcash::SaplingPaymentAddress& destOut, std::string& destStrOut);
void setResult();
};
#endif /* ASYNCRPCOPERATION_AUTOSHIELDCOINBASE_H */

View File

@@ -28,8 +28,17 @@ AsyncRPCOperation_saplingconsolidation::AsyncRPCOperation_saplingconsolidation(i
AsyncRPCOperation_saplingconsolidation::~AsyncRPCOperation_saplingconsolidation() {} AsyncRPCOperation_saplingconsolidation::~AsyncRPCOperation_saplingconsolidation() {}
void AsyncRPCOperation_saplingconsolidation::main() { void AsyncRPCOperation_saplingconsolidation::main() {
if (isCancelled()) if (isCancelled()) {
// Only the current op owns the scheduler flag; a stale/cancelled op must
// not clear it out from under a freshly-enqueued successor.
if (pwalletMain) {
LOCK(pwalletMain->cs_wallet);
if (getId() == pwalletMain->saplingConsolidationOperationId) {
pwalletMain->fConsolidationRunning = false;
}
}
return; return;
}
set_state(OperationStatus::EXECUTING); set_state(OperationStatus::EXECUTING);
start_execution_clock(); start_execution_clock();
@@ -76,6 +85,21 @@ void AsyncRPCOperation_saplingconsolidation::main() {
LogPrintf("%s", s); LogPrintf("%s", s);
unlock_notes(); // clean up unlock_notes(); // clean up
LogPrint("zrpc", "%s: consolidation input notes unlocked\n", getId()); LogPrint("zrpc", "%s: consolidation input notes unlocked\n", getId());
// Advance the interval and clear the running flag on EVERY terminal state
// (success, failure, exception) so consolidation runs once per interval
// instead of every block, and a failed round still lets the next one fire.
// Only the CURRENT op does this bookkeeping. This fixes the pre-existing
// wedge where nextConsolidation never advanced and fConsolidationRunning
// was never set/reset.
if (pwalletMain) {
LOCK2(cs_main, pwalletMain->cs_wallet);
if (getId() == pwalletMain->saplingConsolidationOperationId) {
int tipHeight = (chainActive.Tip() != NULL) ? chainActive.Tip()->GetHeight() : targetHeight_;
pwalletMain->nextConsolidation = pwalletMain->consolidationInterval + tipHeight;
pwalletMain->fConsolidationRunning = false;
}
}
} }
bool AsyncRPCOperation_saplingconsolidation::main_impl() { bool AsyncRPCOperation_saplingconsolidation::main_impl() {

View File

@@ -27,8 +27,17 @@ AsyncRPCOperation_sweep::AsyncRPCOperation_sweep(int targetHeight, bool fromRpc)
AsyncRPCOperation_sweep::~AsyncRPCOperation_sweep() {} AsyncRPCOperation_sweep::~AsyncRPCOperation_sweep() {}
void AsyncRPCOperation_sweep::main() { void AsyncRPCOperation_sweep::main() {
if (isCancelled()) if (isCancelled()) {
// Only the current op owns the scheduler flag; a stale/cancelled op must
// not clear it out from under a freshly-enqueued successor.
if (pwalletMain) {
LOCK(pwalletMain->cs_wallet);
if (getId() == pwalletMain->saplingSweepOperationId) {
pwalletMain->fSweepRunning = false;
}
}
return; return;
}
set_state(OperationStatus::EXECUTING); set_state(OperationStatus::EXECUTING);
start_execution_clock(); start_execution_clock();
@@ -64,6 +73,23 @@ void AsyncRPCOperation_sweep::main() {
set_state(OperationStatus::FAILED); set_state(OperationStatus::FAILED);
} }
// Scheduler bookkeeping, done here so it runs on success AND failure AND
// exception (main_impl's terminal code is skipped when it throws). Only the
// current op mutates scheduler state. Preserves the "keep draining every
// block until swept" model: on a successful-but-incomplete round we leave
// fSweepRunning set and nextSweep unadvanced so the next block continues.
// On completion OR on failure/exception we release fSweepRunning and back
// off one interval — critically, a persistently failing sweep no longer
// leaves fSweepRunning stuck true and wedges consolidation + autoshield.
if (pwalletMain) {
LOCK2(cs_main, pwalletMain->cs_wallet);
if (getId() == pwalletMain->saplingSweepOperationId && (!success || sweepComplete_)) {
int tipHeight = (chainActive.Tip() != NULL) ? chainActive.Tip()->GetHeight() : targetHeight_;
pwalletMain->nextSweep = pwalletMain->sweepInterval + tipHeight;
pwalletMain->fSweepRunning = false;
}
}
std::string s = strprintf("%s: Sweep operation finished. (status=%s", getId(), getStateAsString()); std::string s = strprintf("%s: Sweep operation finished. (status=%s", getId(), getStateAsString());
if (success) { if (success) {
s += strprintf(", success)\n"); s += strprintf(", success)\n");
@@ -314,10 +340,11 @@ bool AsyncRPCOperation_sweep::main_impl() {
} }
} }
if (sweepComplete) { // Record whether the wallet is fully swept; the scheduler bookkeeping
pwalletMain->nextSweep = pwalletMain->sweepInterval + chainActive.Tip()->GetHeight(); // (advancing nextSweep / clearing fSweepRunning) is done in main() so it
pwalletMain->fSweepRunning = false; // also runs on the failure/exception/cancel paths and cannot wedge the
} // shared fSweepRunning flag (which now also gates consolidation + autoshield).
sweepComplete_ = sweepComplete;
LogPrintf("%s: Created %d transactions with total output amount=%s, status=%d\n", getId(), numTxCreated, FormatMoney(amountSwept), (int)status); LogPrintf("%s: Created %d transactions with total output amount=%s, status=%d\n", getId(), numTxCreated, FormatMoney(amountSwept), (int)status);
setSweepResult(numTxCreated, amountSwept, sweepTxIds); setSweepResult(numTxCreated, amountSwept, sweepTxIds);

View File

@@ -34,6 +34,10 @@ public:
private: private:
int targetHeight_; int targetHeight_;
bool fromRPC_; bool fromRPC_;
// Set by main_impl(): true iff there was nothing left to sweep this round.
// Read by main() to decide scheduler bookkeeping. Defaults false so an
// exception (which skips main_impl's assignment) is treated as "not done".
bool sweepComplete_ = false;
bool main_impl(); bool main_impl();

Some files were not shown because too many files have changed in this diff Show More