No description
Find a file
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
chain test(chain): boost coverage to >80% with multi-block sync and error paths 2026-02-20 22:02:10 +00:00
config feat(config): P2P network IDs and go-p2p dependency 2026-02-20 19:33:24 +00:00
crypto feat(crypto): CLSAG ring signatures (GG/GGX/GGXXG) and proof verification stubs 2026-02-20 18:47:08 +00:00
difficulty feat: Phase 0 scaffold -- config, types, wire, difficulty 2026-02-20 15:10:33 +00:00
docs docs: Phase 6 wallet core implementation plan 2026-02-20 22:51:19 +00:00
p2p test(p2p): integration test against C++ testnet daemon 2026-02-20 19:45:24 +00:00
rpc test(rpc): integration test against C++ testnet daemon 2026-02-20 21:14:36 +00:00
types feat(wallet): TX extra parsing for wallet-critical tags 2026-02-20 23:02:13 +00:00
wallet feat(wallet): TX extra parsing for wallet-critical tags 2026-02-20 23:02:13 +00:00
wire feat(wire): Phase 1 wire serialisation — bit-identical to C++ daemon 2026-02-20 17:16:08 +00:00
.gitignore feat(crypto): Phase 2a scaffold — vendored C++ and CMake build 2026-02-20 18:21:44 +00:00
CLAUDE.md docs: Phase 2 crypto bridge documentation 2026-02-20 18:49:21 +00:00
go.mod feat(chain): Chain struct with block storage and retrieval 2026-02-20 21:44:57 +00:00
go.sum feat(chain): Chain struct with block storage and retrieval 2026-02-20 21:44:57 +00:00
README.md docs: graduate Phase 0 into production documentation 2026-02-20 15:24:38 +00:00

go-blockchain

Pure Go implementation of the Lethean blockchain protocol. Provides chain configuration, core cryptographic data types, CryptoNote wire serialisation, and LWMA difficulty adjustment for the Lethean CryptoNote/Zano-fork chain. Follows ADR-001: protocol logic in Go, cryptographic primitives deferred to a C++ bridge in later phases. Lineage: CryptoNote to IntenseCoin (2017) to Lethean to Zano rebase.

Module: forge.lthn.ai/core/go-blockchain Licence: EUPL-1.2 Language: Go 1.25

Quick Start

import (
    "forge.lthn.ai/core/go-blockchain/config"
    "forge.lthn.ai/core/go-blockchain/types"
    "forge.lthn.ai/core/go-blockchain/wire"
    "forge.lthn.ai/core/go-blockchain/difficulty"
)

// Query the active hardfork version at a given block height
version := config.VersionAtHeight(config.MainnetForks, 10081) // returns HF2

// Check if a specific hardfork is active
active := config.IsHardForkActive(config.MainnetForks, config.HF4Zarcanum, 50000) // false

// Encode and decode a Lethean address
addr := &types.Address{SpendPublicKey: spendKey, ViewPublicKey: viewKey}
encoded := addr.Encode(config.AddressPrefix)
decoded, prefix, err := types.DecodeAddress(encoded)

// Varint encoding for the wire protocol
buf := wire.EncodeVarint(0x1eaf7)
val, n, err := wire.DecodeVarint(buf)

// Calculate next block difficulty
nextDiff := difficulty.NextDifficulty(timestamps, cumulativeDiffs, 120)

Documentation

Build & Test

go test ./...
go test -race ./...
go vet ./...
go build ./...

Licence

European Union Public Licence 1.2 -- see LICENCE for details.