CryptoService class abstract
Cryptographic service interface for Bitcoin operations Provides all cryptographic functionality needed by the wallet
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
deriveAddress(
HDPublicKey hdPublicKey, int addressIndex, {AddressChain chain = AddressChain.receive, NetworkType network = dartsv.NetworkType.MAIN}) → String -
The P2PKH address at
addressIndexonchainof an HD public key. -
deriveHDPublicKey(
HDPrivateKey hdPrivateKey) → HDPublicKey - Derive extended public key from HD private key Returns the extended public key for receiving addresses
-
derivePrivateKey(
HDPrivateKey hdPrivateKey, int addressIndex, {AddressChain chain = AddressChain.receive}) → Future< SVPrivateKey> -
Derive the private key at
addressIndexonchainof an HD private key: the key of the address deriveAddress gives for the same index and chain. See DartSVCryptoService for the path scheme in use. -
doubleSha256(
Uint8List data) → Uint8List - Hash data using double SHA-256 (Bitcoin standard) Returns the double SHA-256 hash of the input data
-
generateMnemonic(
{int strength = 128}) → Future< String> - Generate a new BIP39 mnemonic phrase Returns a 12-word mnemonic phrase for wallet creation
-
generateRandomPrivateKey(
{NetworkType network = dartsv.NetworkType.MAIN}) → SVPrivateKey - Generate a random private key Returns a new random private key (not from mnemonic)
-
getPublicKey(
SVPrivateKey privateKey) → SVPublicKey - Generate public key from private key Returns the public key corresponding to the private key
-
mnemonicToHDPrivateKey(
String mnemonic, {String passphrase = '', NetworkType network = dartsv.NetworkType.MAIN}) → Future< HDPrivateKey> - Convert mnemonic to HD private key (BIP32 root) Returns the root HD private key derived from the mnemonic
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
privateKeyFromWIF(
String wif, {NetworkType network = dartsv.NetworkType.MAIN}) → SVPrivateKey - Import private key from WIF Returns the private key from WIF string
-
privateKeyToWIF(
SVPrivateKey privateKey, {NetworkType network = dartsv.NetworkType.MAIN}) → String - Convert private key to WIF (Wallet Import Format) Returns the WIF representation of the private key
-
sha256(
Uint8List data) → Uint8List - Hash data using single SHA-256 Returns the SHA-256 hash of the input data
-
signData(
SVPrivateKey privateKey, Uint8List data) → Future< SVSignature> - Sign raw data with a private key Returns the signature for arbitrary data
-
signTransactionHash(
SVPrivateKey privateKey, Uint8List transactionHash, int sigHashType) → Future< SVSignature> - Sign a transaction hash with a private key Returns the signature for the given transaction hash
-
toString(
) → String -
A string representation of this object.
inherited
-
validateMnemonic(
String mnemonic) → Future< bool> - Validate a BIP39 mnemonic phrase Returns true if the mnemonic is valid according to BIP39 specification
-
verifySignature(
SVPublicKey publicKey, SVSignature signature, Uint8List data) → bool - Verify a signature against data and public key Returns true if the signature is valid for the data and public key
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited