coin_hww library

Hardware-wallet support.

A Trezor stack: a protobuf wire codec, device/features models, a HardwareDevice abstraction, and a Trezor Bridge HTTP adapter (127.0.0.1:21325). Kept in its own barrel, separate from the core, since it targets a live device. Pulls in package:http (native I/O).

Classes

Addr
Bech32
Chain
CodecGate
CryptoVault
CurveGate
Implementations may use pure Dart math or native FFI/WASM bindings.
Denomination
DerivedKey
DerivedKeyMaterial
DerivedPublicKey
DerivedSecretKey
DigestGate
EcdsaSig
Ed25519Gate
Pluggable backend for Ed25519 curve operations (Monero, etc.). All inputs/outputs are byte arrays so native backends avoid BigInt conversion.
ExTx
FundingPlan<T>
HardwareDevice
HdAccount
An account node m/purpose'/coinType'/account' bound to a ChainParams and a DerivationScheme.
HdWallet
A hierarchical-deterministic wallet root.
InputSig
DER-encoded ECDSA sig + sighash byte.
KeyForge
LegacyAddr
LegacyInput
LegacySigHasher
Legacy sighash (pre-segwit).
Locking
MessageSig
Mnemonic
MultiSig
M-of-N multisig: OP_M <keys...> OP_N OP_CHECKMULTISIG
Op
OpCode
Outpoint
P2pkhAddr
P2pkhInput
scriptSig = sig, pubkey
P2shAddr
P2shMultisigInput
P2wpkhAddr
P2wpkhInput
witness = sig, pubkey
P2wshAddr
PayToPubKeyHash
P2PKH: OP_DUP OP_HASH160 <20> OP_EQUALVERIFY OP_CHECKSIG
PayToScriptHash
P2SH: OP_HASH160 <20> OP_EQUAL
PayToTaproot
P2TR: OP_1 <32>
PayToWitness
Generic witness program (version 0-16).
PayToWitnessPubKey
P2WPKH: OP_0 <20>
PayToWitnessScript
P2WSH: OP_0 <32>
ProtoReader
ProtoWriter
PublicKey
PushData
PushDataMatcher
Matches any push of a given size, for pattern matching against scripts.
RawInput
RawLocking
RecoverableEcdsaSig
SchnorrInputSig
Schnorr sig: 64 bytes, or 65 with non-default sighash.
SchnorrSig
Script
ScriptOp
SecretKey
SegwitAddr
SigHasher
SigHashType
TapBranch
TapLeaf
Taproot
TaprootAddr
Taproot address (bech32m, witness v1).
TaprootKeyInput
Key-path spend; witness = schnorr_sig.
TaprootScriptInput
Script-path spend; witness = ...stack, script, controlBlock.
TaprootSigHasher
BIP-341 taproot sighash.
TapTree
TrezorBridgeAdapter
TrezorDevice
TrezorFailure
TrezorFeatures
TrezorHardwareWalletDevice
TrezorMsgType
TrezorPublicKey
Tx
TxBody
Components of a transaction body (everything after the version word), shared by Tx.fromReader and ExTx.fromReader.
TxInput
TxOutput
UnknownWitnessAddr
For witness versions 2-16 (future soft forks).
VaultKeeper
Call initialize once before using any crypto operations. Defaults to pure Dart backends; register FFI backends with register or registerAsync before calling initialize.
WireMeasure
Counts serialized size without allocating.
WireReader
WireWriter
WitnessInput
WitnessSigHasher
BIP-143 witness v0 sighash.

Enums

DerivationScheme
BIP standard derivation schemes, each mapping to a single address type.
HardwareWalletConnectionType
HardwareWalletDeviceFamily

Functions

base58Decode(String encoded) Uint8List
base58Encode(Uint8List payload) String
buildButtonAck() Uint8List
buildGetPublicKey({required List<int> addressN, bool showDisplay = false}) Uint8List
buildInitialize() Uint8List
buildPassphraseAck({String passphrase = ''}) Uint8List
buildPinMatrixAck(String pin) Uint8List
bytesEqual(Uint8List a, Uint8List b) bool
checkInt32(int i) → void
checkUint16(int i) → void
checkUint32(int i) → void
checkUint64(BigInt i) → void
checkUint8(int i) → void
compareBytes(Uint8List a, Uint8List b) int
concatBytes(List<Uint8List> parts) Uint8List
copyCheckBytes(Uint8List bytes, int length, [String name = 'bytes']) Uint8List
decodeFrame(String hex) → (int, Uint8List)
encodeFrame(int msgType, Uint8List payload) String
fromHex(String hex) Uint8List
generateSecureBytes(int n) Uint8List
hash160(Uint8List data) Uint8List
hexDecode(String hex) Uint8List
Accepts optional "0x" prefix.
hexEncode(Uint8List bytes) String
hmacSha256(Uint8List key, Uint8List data) Uint8List
hmacSha512(Uint8List key, Uint8List data) Uint8List
initCoin() Future<void>
keccak256(Uint8List data) Uint8List
parseFailure(Uint8List bytes) TrezorFailure
parseFeatures(Uint8List bytes) TrezorFeatures
parsePublicKey(Uint8List bytes) TrezorPublicKey
ripemd160(Uint8List data) Uint8List
sha256(Uint8List data) Uint8List
sha256d(Uint8List data) Uint8List
sha512(Uint8List data) Uint8List
taggedHash(String tag, Uint8List data) Uint8List
toHex(Uint8List bytes) String
wifDecode(String wif, Chain chain) → (Uint8List, bool)
wifEncode(Uint8List privKey, Chain chain, {bool compressed = true}) String

Exceptions / Errors

OutOfData