Account Addresses
In Thru, all accounts are identified by 32-byte addresses. These addresses can be generated in two distinct ways: derived from keypairs using ED25519 cryptography, or computed deterministically by programs using SHA256 hashing.
Keypair-Derived Addresses
Section titled “Keypair-Derived Addresses”Externally owned accounts (EOAs), also known as user accounts, are accounts that are controlled by
users with their private keys. They are owned by the externally owned
account program, which is located at the address 0 (all zeros). The keypair is
generated using ED25519 public key cryptography. Both the private
and public keys are 32 bytes.
Program-Derived Addresses
Section titled “Program-Derived Addresses”When programs create accounts, their addresses are computed deterministically using SHA256 hashing.
Address Computation
Section titled “Address Computation”Program-derived addresses (PDAs) are computed using the following formula:
SHA256(program_pubkey || is_ephemeral || seed)Parameters:
program_pubkey- The 32-byte public key of the program creating the accountis_ephemeral- A single byte (0 or 1) indicating whether the account is ephemeralseed- A 32-byte seed provided by the program