Add cn_bpp_verify for Bulletproofs++ (1 delta, bpp_crypto_trait_ZC_out)
used by zc_outs_range_proof in post-HF4 transactions. Distinguish from
cn_bppe_verify (2 deltas, bpp_crypto_trait_Zarcanum) used for Zarcanum
PoS proofs.
Key changes:
- Add deserialise_bpp() and cn_bpp_verify() to bridge.cpp
- Add VerifyBPP() Go wrapper in proof.go
- Wire BPPE and BGE stubs into real C++ verify functions
- Add try/catch to all proof verifiers (C++ throws on invalid points)
- Add nil/empty input guards to all Go proof functions
- Test with real BPP proof from testnet block 101 coinbase tx
The BPP proof from tx 543bc3c2... (first post-HF4 coinbase) verifies
successfully through the full CGo pipeline, confirming wire format
deserialisation matches the C++ daemon output.
Co-Authored-By: Charon <charon@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port of C++ get_block_header_mining_hash(). Computes BlockHashingBlob
with nonce=0, Keccak-256's it. CheckNonce wraps RandomX + difficulty.
Co-Authored-By: Charon <charon@lethean.io>
Solo PoW miner against C++ daemon via JSON-RPC. Single-threaded
RandomX nonce grinding with daemon-provided block templates.
Co-Authored-By: Charon <charon@lethean.io>
Add integration test, update architecture docs with consensus/ package
description, record Phase 7 in project history.
Co-Authored-By: Charon <charon@lethean.io>
Add SyncOptions with VerifySignatures flag and hardfork schedule.
ValidateMinerTx and ValidateTransaction called during block processing.
Co-Authored-By: Charon <charon@lethean.io>
VerifyTransactionSignatures with structural checks for v1 NLSAG and
v2+ CLSAG. Crypto bridge calls marked as TODO for wiring.
Co-Authored-By: Charon <charon@lethean.io>
CheckDifficulty compares a 256-bit LE hash against a difficulty target.
CheckPoWHash computes RandomX hash and checks against difficulty.
Co-Authored-By: Charon <charon@lethean.io>
ValidateBlock combines timestamp, miner tx, and reward checks into
a single entry point for block-level consensus validation.
Co-Authored-By: Charon <charon@lethean.io>
ValidateBlockReward checks miner tx output sum against expected reward
with size penalty and hardfork-aware fee treatment.
Co-Authored-By: Charon <charon@lethean.io>
ValidateMinerTx checks genesis input height, input count (1 for PoW,
2 for PoS), and stake input type per hardfork version.
Co-Authored-By: Charon <charon@lethean.io>
Add consensus/ package with doc.go and sentinel error types for all
validation failures. Add MaxTransactionBlobSize constant to config.
Co-Authored-By: Charon <charon@lethean.io>
Layered validation architecture (structural, economic, cryptographic)
in a standalone consensus/ package. Full hardfork coverage (HF0-HF6),
PoW via CGo bridge, optional signature verification during sync.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Builder interface with V1Builder that constructs signed v1 transactions.
Handles change outputs, ECDH output key derivation, ring construction
with sorted global indices, and NLSAG signing per input.
Co-Authored-By: Charon <charon@lethean.io>
RingSelector interface with RPCRingSelector that fetches random outputs
from the daemon, excludes the real output and duplicates, and returns
the requested ring size.
Co-Authored-By: Charon <charon@lethean.io>
Scanner interface with V1Scanner implementation for v0/v1 transactions.
Derives ephemeral keys via ECDH, generates key images, and tracks
coinbase status and unlock times.
Co-Authored-By: Charon <charon@lethean.io>
GenerateAccount, RestoreFromSeed, RestoreViewOnly with deterministic
view key derivation (sc_reduce32(Keccak256(spend_secret))), matching
C++ account_base::generate(). Encrypted persistence via Argon2id
(time=3, mem=64MB) + AES-256-GCM in go-store.
Adds cn_sc_reduce32 to the CGo bridge for scalar reduction mod l,
required to convert a hash output into a valid Ed25519 secret key.
Co-Authored-By: Charon <charon@lethean.io>
Parses tags 22 (tx public key), 14 (unlock time), and 11 (derivation
hint) from raw extra bytes. Unknown tags are skipped. Raw bytes preserved
for round-tripping.
Adds PublicKey.IsZero() to types package.
Co-Authored-By: Charon <charon@lethean.io>
24-word Electrum encoding (4 bytes → 3 words × 8 groups) plus CRC32
checksum word. 1626-word dictionary extracted from C++ source.
Co-Authored-By: Charon <charon@lethean.io>
11 tasks covering mnemonic seeds, TX extra parsing, account management,
transfer storage, scanning, signing, ring selection, tx building, and
wallet orchestration. TDD with complete code for every step.
Co-Authored-By: Charon <charon@lethean.io>
Add comprehensive tests exercising regular transaction processing through
the sync pipeline (key image marking, output indexing, cumulative
difficulty) and not-found error paths for all query methods. Coverage
rises from 65.8% to 80.1%.
Co-Authored-By: Charon <charon@lethean.io>