mhda v1.1.0
URN grammar 1.1 — a behavioral mirror of the go-mhda 1.1.0 reference. The URN
format stays bit-for-bit compatible between the two implementations; parity
was verified with a differential harness (hand-crafted corpus, ~50k random
was verified with a differential harness (hand-crafted corpus, ~50k random
mutations, targeted coin-type fuzz) comparing accept/reject decisions and
canonical output byte for byte.
Breaking changes
Breaking changes
- Chain identity is the
(nt, ci)pair.chain::str()/chain::key()
returnnt:<network>:ci:<chain_id>;operator==compares the identity
only. The constructor ischain(network_type, chain_id)— the
three-argument form is gone. - The coin type is optional metadata.
chain::coin()returns
std::optional<coin_type>;set_coin()/clear_coin()manage it. When
set, it is emitted afterciin decimal; it never appears in the key.
error_code::missing_coin_typeis removed. chain::from_keyis strict. A chain key must be the canonical identity
string. A key carryingct(the pre-1.1 format) throws
parse_errorwith the newerror_code::coin_type_in_chain_key; any other
residue — non-identity components, unknown tokens, reordering,
non-canonical case — throwserror_code::invalid_chain_key.
chain::from_nssstays lenient.- Network type values renamed to the accepted lowercase network names:
bitcoin,tron,avalanche,solana,xrpl,stellar,aptos,
cardano,algorand;evm,cosmos,near,sui,tonunchanged. No
aliases; the constant identifiers in the C++ API are unchanged. - The
addressconstructor validates its optional string params through
the same setters as parsed input and throws on an invalid value. coins::atomis 118 per the SLIP-44 registry (168 belongs to
Helleniccoin).
New
`set_wallet_type()` / `set_wallet_id()`.
- Coin type registry extended with 34 modern SLIP-44 registrations,
values verified against the registry. - New
error_code::invalid_valuefor rejected free-form setter values.
Parser hardening (in lockstep with the reference)
- NSS values are enforced to printable ASCII; trimming is ASCII-only and
locale-independent. Free-form values are case-preserving. - Free-form setters reject
:,?,#, whitespace and non-ASCII bytes —
a client-supplied wallet id can no longer inject foreign components into
the serialised URN. - The SLIP-44 numeric grammar is pinned to plain decimal and
0xhex.
Versioning note
The previous release shipped as tag v1.0.0 while its in-tree version markers
still read 0.1.0. This release restores consistency: the CMake project
version, the changelog and the README all say 1.1.0.
Testing
139 test cases, 100% green under the full warning set (-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion -Werror) and again under
AddressSanitizer/UBSan/LeakSanitizer with halt_on_error=1 — zero
diagnostics. New suites mirror the Go reference: wallet domain, strict chain
keys, and the hardening pack (duplicates, canonical-only keys, setter
injection attempts, coin-type spellings, non-ASCII rejection, case
preservation, registry spot checks). The hash reference vectors were
recomputed for the new canonical strings.