Module kaspa_wasm::keypair
source · Expand description
keypair
module encapsulates Keypair
and PrivateKey
.
The Keypair
provides access to the secret and public keys.
let keypair = Keypair.random();
let privateKey = keypair.privateKey;
let publicKey = keypair.publicKey;
// to obtain an address from a keypair
let address = keypair.toAddress(NetworkType.Mainnnet);
// to obtain a keypair from a private key
let keypair = privateKey.toKeypair();
Structs§
- Data structure that contains a secret and public keys.
- Data structure that envelops a Private Key