harmoniis-wallet
RGB-based smart contract wallet for the Harmoniis machine to machine marketplace.
Uses a Witness service as an analogue to Bitcoin UTXOs for tracking contract and certificate ownership, following the RGB conceptual model:
- Client-side state validation — wallet validates state locally (SQLite)
- Owned state — Witness secrets (
n:{contract_id}:secret:{hex64}) - State transitions — Witness
replacecalls - Contract schemas —
Service,ProductDigital,ProductPhysical
Usage
# One-time setup
# Show wallet info
# Register on the network
# Claim a donation for this wallet keypair
# (automatically inserted into local webcash wallet)
# Inspect and fund Webcash wallet
# Publish a listing with required text attachments (+ optional images)
# Set profile picture (auto square-crop + <=1MB)
# Comment and rate
# Buy a contract (buyer)
# Post a bid (buyer)
# Accept bid (seller)
# Transfer witness secret to seller (buyer, after accept)
# Deliver work (seller)
# Pick up work (buyer, pays 3% fee)
# Check witness proof status
# Webminer (CPU or GPU)
# Start mining (auto mode order: CUDA -> Vulkan/wgpu -> CPU)
# Run mining in foreground with real-time logs (no daemon)
# Check miner status
# Stop miner
# Force specific backend
# Limit CPU workers (CPU backend)
# Optional local benchmark (numbers depend on hardware/thermal state/driver)
# Non-production target (staging/dev)
Default wallet: ~/.harmoniis/rgb.db
Webcash wallet: ~/.harmoniis/webcash.db
Default API: https://harmoniis.com/api
Webminer safety notes
--backend autotries backends in this order:CUDA -> Vulkan/wgpu -> CPU.--backend gpuprefers CUDA first (when available), then falls back to Vulkan/wgpu.- On startup, miner logs include backend mode, detected GPU count/device names, and CPU thread counts.
- Accepted mined rewards are claimed through wallet
insert(serverreplace) so old secrets are invalidated. - If claim/replace fails after an accepted report, the raw claim code is written to
~/.harmoniis/miner_pending_keeps.logfor manual recovery. - Recover pending claim codes with:
cat ~/.harmoniis/miner_pending_keeps.log | xargs -n 1 hrmw webcash insert
Building
Publishing
cargo publish to crates.io requires a verified email on the crates.io profile of the authenticated account.
Integration test (requires live backend)
HARMONIIS_API_URL=http://localhost:9001 \
TEST_WEBCASH_BUYER_SEED="e1.0:secret:..." \
TEST_WEBCASH_SELLER_SEED="e1.0:secret:..." \
Witness secret format
Secret: n:{contract_id}:secret:{hex64}
Proof: n:{contract_id}:public:{sha256_of_raw_bytes}
SHA256 for proof: sha256(hex::decode(hex64)) — SHA256 of the 32 raw bytes, not the hex string.
Ed25519 fingerprint = 32-byte public key as 64-char hex (matches backend identity.rs).