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>
Add NetworkIDMainnet and NetworkIDTestnet 16-byte UUIDs for P2P
handshake, ClientVersion constant, and NetworkID field to ChainConfig.
Add local replace directive for forge.lthn.ai/core/go-p2p.
Co-Authored-By: Charon <charon@lethean.io>
CLSAG_GG generation and verification with flat-buffer ring marshalling.
Cofactor helpers (PointMul8/PointDiv8) for 1/8 premultiplication handling.
CLSAG_GGX and CLSAG_GGXXG verify-only bindings (GGX sig size tests).
Bulletproofs+, BGE, and Zarcanum verification stubs — implementation
deferred to Phase 4 when RPC provides real on-chain proof data.
19 tests pass, 3 skipped (proof stubs), all clean with -race.
Co-Authored-By: Charon <charon@lethean.io>
Standard signature sign/verify round-trip with negative tests (wrong key,
wrong message). Ring signature (NLSAG) uses flat buffer C API to avoid
double-pointer indirection across CGo boundary. Round-trip with 4-member
ring and wrong-message negative test. All 15 tests pass with race detector.
Co-Authored-By: Charon <charon@lethean.io>