Module jormungandr_lib::crypto::account
source · Expand description
Account Signing Key and Identifier
While managing account there are a couple of items the user will
need to manage. The first one being their SigningKey
. This is
the key that will be used to sign transactions. Owning this key
means that any value associated to this Account can be spent.
From the SigningKey
we can extract the public Identifier
.
This is the data that will be used to publicly represent our
Account on the blockchain.
Example
// generate a signing key
let signing_key = SigningKey::generate(thread_rng());
// extract the associated identifier
let identifier = signing_key.identifier();
// get the address to this account:
let address = identifier.to_address(Discrimination::Test);
println!(
"Please, send money to my account: {}",
AddressReadable::from_address("ca", &address)
);
Structs
- Account identifier, used to identify an account. Cryptographically linked to the account
SigningKey
. - account Singing key. Used to sign transaction. Any owner of this key can utilise the associated values or stake.