Update go.mod module line, all require/replace directives, and every
.go import path from forge.lthn.ai/core/go-blockchain to
dappco.re/go/core/blockchain. Add replace directives to bridge
dappco.re paths to existing forge.lthn.ai registry during migration.
Update CLAUDE.md, README, and docs to reflect the new module path.
Co-Authored-By: Virgil <virgil@lethean.io>
The conventions sweep (71f0a5c) overwrote HF5 code and removed HTLC/multisig
input handling. This commit restores:
- wire: HF5 asset wire tags (40/49/50/51) and reader functions for
asset_descriptor_operation, asset_operation_proof,
asset_operation_ownership_proof, and asset_operation_ownership_proof_eth
- wire: HTLC and multisig input encode/decode with string field helpers
- consensus: checkTxVersion enforcing version 3 after HF5 / rejecting before
- consensus: HF1-gated acceptance of HTLC and multisig input/output types
- consensus: HTLC key image deduplication in checkKeyImages
- consensus: HTLC ring signature counting in verifyV1Signatures
- chain: corrected error assertion in TestChain_GetBlockByHeight_NotFound
All 14 packages pass go test -race ./...
Co-Authored-By: Charon <charon@lethean.io>
The coreerr.E() sweep reverted the HF1 type assertion changes in
encodeOutputsV1/V2 and decodeOutputsV1/V2. Restores full target
variant support (TxOutToKey, TxOutMultisig, TxOutHTLC) in all four
output functions.
Co-Authored-By: Charon <charon@lethean.io>
Replace all fmt.Errorf and errors.New in production code with
coreerr.E("Caller.Method", "message", err) from go-log. Replace
os.MkdirAll with coreio.Local.EnsureDir from go-io. Sentinel errors
(consensus/errors.go, wire/varint.go) intentionally kept as errors.New
for errors.Is compatibility.
270 error call sites converted across 38 files. Test files untouched.
crypto/ directory (CGO) untouched.
Co-Authored-By: Virgil <virgil@lethean.io>
Tests v3 transactions containing asset_descriptor_operation (tag 40)
in extra and asset_operation_proof (tag 49) in proofs. Validates
hardfork_id encoding and bit-identical round-tripping.
Co-Authored-By: Charon <charon@lethean.io>
Reads asset_operation_proof, asset_operation_ownership_proof, and
asset_operation_ownership_proof_eth structures. All use CHAIN_TRANSITION_VER
with version byte prefix. Stored as opaque bytes.
Co-Authored-By: Charon <charon@lethean.io>
Reads the CHAIN_TRANSITION_VER structure for asset deploy/emit/update/burn
operations. Stores as opaque bytes for bit-identical round-tripping.
Required for HF5 block deserialisation.
Co-Authored-By: Charon <charon@lethean.io>
Adds target variant serialisation in both V1 and V2 output
encoders/decoders. Supports multisig (tag 0x04) and HTLC
(tag 0x23) targets within TxOutputBare.
Co-Authored-By: Charon <charon@lethean.io>
Prepares for HF1 output target types (TxOutMultisig, TxOutHTLC).
All call sites updated to type-assert TxOutToKey where needed.
Modified files:
- types/transaction.go: TxOutputBare.Target is now TxOutTarget
- wire/transaction.go: encode/decode use type switch on target
- chain/ring.go: type-assert target to TxOutToKey for key extraction
- wallet/scanner.go: type-assert target before key comparison
- tui/explorer_model.go: type-assert target for display
- wire/transaction_test.go: type-assert in assertions
- wallet/builder_test.go: type-assert in assertions
Co-Authored-By: Charon <charon@lethean.io>
Add full V2 transaction verification pipeline: parse SignaturesRaw variant
vector into structured ZC signature data, verify CLSAG GGX ring signatures
per ZC input, verify BPP range proofs, and verify BGE asset surjection
proofs with correct ring construction (mul8 point arithmetic).
Fix three wire format bugs that caused V2 parsing failures:
- RefTypeGlobalIndex (tag 0x1A) uses 8-byte LE, not varint
- Raw uint64_t variant (tagUint64) uses 8-byte LE, not varint
- zarcanum_tx_data_v1 fee uses FIELD() → 8-byte LE, not VARINT_FIELD()
Add cn_point_sub to C++ bridge and Go wrapper for BGE ring construction.
Add GetZCRingOutputs to chain for fetching ZC ring member data.
Co-Authored-By: Charon <charon@lethean.io>
Fix three bugs in the v2+ wire format and add complete variant tag handlers
for Zarcanum proof and signature structures. Verified byte-identical
round-trip against a real post-HF4 coinbase transaction from testnet block
101 (1323 bytes, tx hash 543bc3c2...3b61e0).
Bugs fixed:
- V2 suffix order was attachment+proofs, corrected to attachment+signatures+proofs
- TransactionHash was hashing full blob, corrected to prefix-only (matching C++)
- tagSignedParts was reading 4 fixed bytes, corrected to two varints
New: TxInputZC type, SignaturesRaw field, tagZarcanumTxDataV1 handler,
proof tags 46-48, signature tags 42-45, crypto blob readers for BPP/BPPE/
BGE/CLSAG GGX/GGXXG/aggregation proof/double Schnorr structures.
Co-Authored-By: Charon <charon@lethean.io>
Add consensus-critical binary serialisation for blocks and transactions,
verified by computing the testnet genesis block hash and matching the C++
daemon output (cb9d5455...4963). Fixes Phase 0 type mismatches (variant
tags, field widths, missing fields) and adds encoder/decoder, tree hash,
and block/transaction hashing.
Key discovery: CryptoNote's get_object_hash(blobdata) prepends
varint(length) before hashing, so BlockHash = Keccak256(varint(len) || blob).
Co-Authored-By: Charon <charon@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>