MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / keypair

Function keypair

utils/src/crypto.rs:84–86  ·  view source on GitHub ↗

Generate a private/public keypair ```rust use utils::crypto::keypair; let (private_key, public_key) = keypair(); ```

()

Source from the content-addressed store, hash-verified

82/// let (private_key, public_key) = keypair();
83/// ```
84pub fn keypair() -> (SecretKey, PublicKey) {
85 generate_keypair(&mut rand::thread_rng())
86}
87
88/// Convert a public key into an address using the last 20 bytes of the hash
89///

Calls

no outgoing calls