MwebAddr class

A Litecoin MWEB ("Mimblewimble Extension Block") stealth address.

Slice A scope: this is a STANDALONE parser/encoder. It deliberately does NOT implement the Addr interface and is NOT routed through SegwitAddr:

  • The Addr contract (toLocking() / scriptPubKey) is meaningless for an MWEB address, which has no canonical-chain script.
  • SegwitAddr hard-rejects anything but a 20/32-byte witness program at version 0, whereas a real ltcmweb1... address carries a ~66-byte payload (a scan pubkey + a spend pubkey).

The encoding matches Litecoin Core's MWEB address codec: plain bech32 (NOT bech32m) over a 5-bit data part whose FIRST group is a witness-version byte fixed at 0; the remaining groups ConvertBits<5,8,false> to exactly 66 payload bytes (a 33-byte scan pubkey followed by a 33-byte spend pubkey, both compressed secp256k1). There is no 20/32-byte segwit length cap. We do NOT validate that the payload is a legitimate stealth address or attempt to derive the underlying scan/spend pubkey pair - that is mwebd's job.

Constructors

MwebAddr({required String hrp, required Uint8List payload})
MwebAddr.fromString(String s, Chain chain)
Parse s as an MWEB address for chain. The HRP must match chain.mwebHrp. Throws FormatException on HRP mismatch, mixed case, bad characters, or checksum failure.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
hrp String
The human-readable prefix (e.g. ltcmweb, tmweb).
final
payload Uint8List
The decoded raw payload bytes (8-bit). For real MWEB addresses this is ~66 bytes (scan + spend compressed pubkeys).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

encode(Chain chain) String
Encode the payload as an MWEB address using chain.mwebHrp. Provided primarily for round-trip testing; in production MWEB addresses come from mwebd.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited