Commit graph

23 commits

Author SHA1 Message Date
Virgil
602c886400 fix(types): track decoded address prefixes
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 22:46:12 +00:00
Virgil
0512861330 refactor(types): centralise transparent spend-key lookup
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 22:00:07 +00:00
Virgil
92628cec35 refactor(types): centralise to-key target extraction
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 20:50:54 +00:00
Virgil
92cb5a8fbb feat(wallet): mark HTLC spends during sync
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 20:42:56 +00:00
Virgil
c787990b9a refactor(ax): clarify ring and wallet names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / Test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-04 20:36:16 +00:00
Snider
34128d8e98 refactor: migrate module path to dappco.re/go/core/blockchain
Some checks failed
Security Scan / security (pull_request) Successful in 11s
Test / Test (pull_request) Failing after 19s
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>
2026-03-22 01:49:26 +00:00
Snider
71f0a5c1d5 refactor: replace fmt.Errorf/os.* with go-io/go-log conventions
Some checks failed
Security Scan / security (push) Successful in 11s
Test / Test (push) Failing after 23s
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>
2026-03-16 21:17:49 +00:00
Claude
0408d2f3fa
refactor(types): change TxOutputBare.Target to TxOutTarget interface
Some checks failed
Security Scan / security (push) Successful in 9s
Test / Test (push) Failing after 15s
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>
2026-03-16 20:23:27 +00:00
Claude
6324e5f3ca
chore: use slices.Contains for linear search
Some checks failed
Security Scan / security (pull_request) Successful in 12s
Test / Test (pull_request) Failing after 35s
Replace manual loop-and-break index search with slices.IndexFunc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:19:31 +00:00
Claude
5df40c1de1
chore: sort.Slice → slices.SortFunc
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:17:40 +00:00
Claude
33a0b57d72
chore: use range-over-integer (Go 1.22+)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:14:08 +00:00
Claude
aefec104d4
chore: fmt.Errorf(static) → errors.New
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:11:27 +00:00
Claude
112da0e123
feat(chain): integrate consensus validation into sync
Add SyncOptions with VerifySignatures flag and hardfork schedule.
ValidateMinerTx and ValidateTransaction called during block processing.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-21 01:11:33 +00:00
Claude
459ff80f1f
docs: Phase 6 wallet core documentation and integration test
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 23:32:07 +00:00
Claude
11b50d0491
feat(wallet): orchestrator with sync, balance, and send
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 23:29:42 +00:00
Claude
b8841a1a3b
feat(wallet): V1Builder for transaction construction with ring signatures
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>
2026-02-20 23:23:33 +00:00
Claude
7e31e706c5
feat(wallet): RPCRingSelector for decoy output selection
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>
2026-02-20 23:20:15 +00:00
Claude
359952075a
feat(wallet): V1Scanner with ECDH output detection
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>
2026-02-20 23:17:22 +00:00
Claude
f66ef2e61d
feat(wallet): account key management with Argon2id encryption
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>
2026-02-20 23:14:17 +00:00
Claude
ff97d51550
feat(wallet): NLSAGSigner with ring signature interface
Signer interface abstracts signature generation for v1/v2+ extensibility.
NLSAGSigner wraps the CGo ring signature functions for v0/v1 transactions.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 23:08:50 +00:00
Claude
b7349a054d
feat(wallet): transfer type and go-store persistence
Transfer struct tracks owned outputs with key image, amount, block height,
and spend status. Storage helpers use go-store JSON serialisation keyed by
key image hex. IsSpendable checks coinbase maturity and unlock time.

Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 23:05:08 +00:00
Claude
ee257baa83
feat(wallet): TX extra parsing for wallet-critical tags
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>
2026-02-20 23:02:13 +00:00
Claude
5b677d1f36
feat(wallet): mnemonic seed encode/decode with Electrum wordlist
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>
2026-02-20 22:59:16 +00:00