The account private key is used to authorize a transaction, which updates the global state of account records. The account view key is used to decrypt account records, which are encrypted under the user's account address. Lastly, the account address enables users to interact with one another, sending and receiving records that encode values and application data.
To protect user assets and record data, one should never disclose their account private key to any third parties. For real-world applications on Aleo, users should derive a compute key from their account private key to allow third parties to trustlessly run applications and generate transactions on a user's behalf.
Generate a new Aleo account here.
Account Private Key
An account private key is constructed from a randomly-sampled account seed. This account seed is used to generate:
- a secret key for the account signature scheme,
- a pseudorandom function seed for transaction serial numbers, and
- a commitment randomness for the account commitment scheme.
Private Key Format
An account private key is formatted as a Base58 string, comprised of 59 characters.
The account private key is encoded with a private key prefix that reads
that it is a private key and should not be shared with other users.
Account View Key
An Aleo account view key is derived from an account private key and enables users to decrypt their records from the global ledger. As account view keys are able to access every record in a user's account, this key can be used by third-party auditors to verify the complete history of an account.
The account view key is comprised of:
- a secret key for the account encryption scheme.
View Key Format
An account view key is formatted as a Base58 string, comprised of 53 characters.
The account view key is encoded with a view key prefix that reads
that it is a view key and should only be shared with authorized parties.
An Aleo account address is a unique identifier that allows users to transfer value and record data to one another in transactions.
The account address is comprised of:
- a public key for the account encryption scheme.
An account address is formatted as a Bech32 string, comprised of 63 characters.
The account address is encoded with an address prefix that reads
|Type||Human-Readable Prefix||Prefix Bytes|
|Account Private Key||bytes|
|Account View Key||bytes|
In many instances such as enterprise settings, it is advisable to handle sensitive keys and data on isolated, offline machines. An Aleo account can be created on an offline machine and available for immediate use. In conjunction with account proving keys, a user can ensure their private key remains offline even for creating transactions.
While no solution is perfect, it is advisable to create a new Aleo account on a disconnected device to minimize the risk of leaking one's account private key to unintended parties.
Account Commitment Outputs
The account commitment output is used to create an account view key, which is comprised of an encryption secret key. This encryption secret key is a scalar field element derived from the account commitment output. To ensure the validity of the account view key, the account commitment output should be representable in the scalar field.
Create an Account
Given global instantiated Aleo parameters and subroutines.
Generate a Private Key
Sample a 32 byte
Construct private key components
where | denotes concatenation, and where
BLAKE2sdenotes unkeyed BLAKE2s-256, as defined in RFC 7693.
private_key = (
The 0 and 1 used to calculate
sk_prf are each encoded as an unsigned
16-bit integer and turned into two bytes in little endian order before being
concatenated to the right of the seed, then the resulting byte sequence is passed to BLAKE2s.
counter used to calculate
r_pk is an unsigned 16-bit integer
that is turned into two bytes in little endian order
before being concatenated to the right of the seed, then the resulting byte sequence is passed to BLAKE2s;
the counter is iterated on, starting from 2, until a valid
view_key (see below) can be derived from the private key.
Learn more about BLAKE2s here.
Generate a View Key
Generate an Address
A["Seed (32 Bytes)"]
A --> |"BLAKE2s(Seed, 0)" | B(sk_sig)
A --> |"BLAKE2s(Seed, 1)" | C(sk_prf)
A --> |"BLAKE2s(Seed, counter)" | D(r_pk)
B --> E(Account Private Key)
C --> E(Account Private Key)
D --> E(Account Private Key)
E --> F(Account View Key)
F --> G(Account Address)