harmoniis-wallet
Reference CLI wallet for Harmoniis contracts plus Webcash mining.
Credits
- Webminer architecture/perf direction inspired by
maaku/webminer. - RGB model inspired by
RGB-WG/rgb. - Witness custody/replace flow inspired by Webcash server semantics (replace invalidates old secret).
Key Model (Current)
The wallet stores one BIP39 master mnemonic/entropy pair and derives every slot using hardened BIP32 paths:
RGB identity key(wallet contract identity)Webcash master secretBitcoin deterministic slot keyPGP-style signing identities(multiple, labeled, selectable)
PGP identities are managed with labels:
hrmw identity register signs with the active PGP label by default.
Master key backup / restore:
Password manager storage at setup time:
Modes:
required(default): setup fails if no supported password manager is available.best-effort: continue setup if password-manager storage fails.off: skip password-manager storage.
On macOS, this stores in Keychain under a harmoniis service label. If iCloud Keychain sync is enabled in macOS settings, those entries sync; hrmw cannot force iCloud sync from CLI.
Deterministic slot map:
pgp[i]fori=0..999(identity scan range)webcash[0]deterministic webcash masterrgb[0]deterministic RGB identity rootbitcoin[0]deterministic Bitcoin slot seed material
This allows reconstruction from only the master mnemonic (or entropy hex) plus server discovery.
Database model:
master.dbstores root material metadata, slot registry, and PGP identity registry.rgb.dbstores wallet-level contract/certificate/local timeline state.webcash.dbstores Webcash balance state.bitcoin.dbstores Bitcoin/ARK wallet persistence (including ARK boarding outputs).
Important:
- RGB contract state is wallet-scoped (
rgb.db), not partitioned by active PGP key label. - PGP identities are signing keys derived from master key slots; switching active PGP label does not switch to a different RGB state database.
Install
1) Install Rust
Ubuntu/Debian:
|
macOS:
|
Windows (PowerShell):
winget install Rustlang.Rustup
rustup default stable
FreeBSD:
NetBSD:
2) Install harmoniis-wallet
Default Paths
- Master wallet DB:
~/.harmoniis/master.db - RGB DB:
~/.harmoniis/rgb.db - Webcash DB:
~/.harmoniis/webcash.db - Bitcoin DB:
~/.harmoniis/bitcoin.db - Miner log (daemon):
~/.harmoniis/miner.log - Miner status JSON:
~/.harmoniis/miner_status.json - Pending mined keeps:
~/.harmoniis/miner_pending_keeps.log
Quick Start
# Optional: create/select additional labeled signing keys
Contract Usage
Buyer flow:
Seller/holder flow:
Transfer custody safely:
replace rotates witness state: the old secret is invalid after replacement.
Webcash Usage
Payment Rails
- Both rails are supported; backend config controls which rails are enabled.
- Webcash rail uses
X-Webcash-Secretwithwats. - Bitcoin rail uses
X-Bitcoin-Secretwithsats. - In ARK mode,
X-Bitcoin-Secretmust beark:<vtxo_txid>:<amount_sats>. - Backend ARK mode verifies incoming VTXOs via ASP/wallet state before settlement.
- Client API exposes payment-header abstractions so either rail can be used cleanly.
CLI rail flags:
# default (webcash)
# bitcoin header mode (requires explicit secret and backend support)
# or via env
HRMW_BITCOIN_SECRET="<vtxo-or-ark-secret>"
ARK helper commands (Arkade ASP):
Deterministic Bitcoin Wallet (Taproot + SegWit Fallback)
The wallet derives a deterministic Bitcoin slot (bitcoin[0]) from the root key and exposes:
- Taproot (
BIP86) as the primary receive path. - SegWit (
BIP84) as compatibility fallback for payers without Taproot support.
# show descriptors + deterministic address and sync balances
# explicit sync settings
# deterministic taproot address at index N
# deterministic segwit fallback address at index N
Notes:
- This is deterministic reconstruction support (no separate seed file needed).
hrmw bitcoin infoandhrmw bitcoin syncreport both Taproot and SegWit next receive addresses.- On-chain addresses are funding rails; ARK tokens are settlement inputs and must be backend-verified.
- Default esplora endpoints are auto-selected by network and can be overridden with
--esplora.
Mining
Foreground (recommended for live logs):
Backend order in auto: CUDA -> Vulkan/wgpu -> CPU.
Examples:
Accepted mined keeps are inserted into wallet with replace semantics (old secret invalidated).
If insert fails after acceptance, pending keeps are stored in miner_pending_keeps.log.
Backup and Restore
Backup the entire wallet directory:
Restore:
Then validate:
If you accidentally pass --wallet .../webcash.db, hrmw now auto-corrects to the sibling master.db path.
For deterministic restore on a new machine:
Project test wallets (Alice/Bob with recovery verification):
This creates wallets/mainnet-test/{alice,bob} and recovered verification wallets under the project root.
Full mnemonic rebuild proof (root + RGB + Webcash + Bitcoin + ARK + PGP identities):
This writes wallets/rebuild-proof/RESULT.txt plus source/restored snapshots for parity checks.
Build and Test