Accounts on EGC Chain

An EGC Blockchain account is an entity with an EGC (EGC Coin) balance that can initiate transactions or receive assets. Accounts can be controlled by private keys (user-owned) or governed entirely by code (smart contracts).

Prerequisites

Review the introduction to EGC Blockchain to understand how the protocol handles transactions, balances, and execution.

Account Types

EGC Blockchain supports two account types:

1

Externally-Owned Account (EOA)

  • Controlled by an individual or application holding the private keys.

  • Can receive, store, and send EGC or other assets.

  • Can interact with deployed smart contracts and dApps.

  • Can initiate transactions directly.

  • Transactions between EOAs are limited to asset transfers (EGC or tokens).

  • Composed of a cryptographic key pair (public key + private key) controlling account access.

2

Contract Account

  • A smart contract deployed to the network, governed by its embedded code rather than a private key.

  • Can receive, store, and send EGC or other assets.

  • Can interact with deployed smart contracts and dApps.

  • Cannot initiate transactions independently; it only responds to incoming transactions.

  • Transactions from EOAs to contracts can trigger arbitrary code execution (e.g., token transfers, governance actions, deploying other contracts).

  • Has no private keys; fully governed by the logic in its smart contract code.

  • Creation requires EGC to cover network storage costs.

Key Differences

See the sections above for the main behavioral and operational differences between EOAs and contract accounts. (Source: https://docs.eaglecoin.ai/developer-docs/accounts-on-egc-chain#key-differences)

Internal Structure of an EGC Account

Each EGC Blockchain account has four key fields:

1

nonce

A counter that tracks the number of transactions sent (for EOAs) or the number of contracts created (for contract accounts). It ensures each transaction is unique, preventing replay attacks.

2

balance

The amount of EGC held by the account, measured in the smallest unit (1 EGC = 10¹⁸ subunits).

3

codeHash

The hash of the account’s EVM-compatible bytecode. For contract accounts, this points to executable code stored in the state database. For EOAs, it is the hash of an empty string.

4

storageRoot

The root hash of the Merkle Patricia Trie storing the contract’s persistent variables. For EOAs, this is empty.

EOAs and Key Pairs

An EOA consists of a public and private key pair, ensuring that only the rightful owner can authorize transactions.

  • Private Key – A 256-bit number (64 hexadecimal characters) that must be kept secret.

  • Public Key – Derived from the private key using elliptic curve cryptography (specifically secp256k1).

  • Address – The last 20 bytes of the Keccak-256 hash of the public key, prefixed with 0x, forming a 42-character identifier.

Example address:

Important: You never “hold” EGC itself; you hold private keys that grant you the ability to move EGC recorded on the blockchain ledger.

Account Creation

When creating an account, most EGC -compatible libraries or wallets generate a random private key. The key can be stored in an encrypted keystore file protected by a password.

Example private key (hexadecimal, shortened for clarity):

From this private key:

  • A public key is derived using elliptic curve operations.

  • An account address is generated from the Keccak-256 hash of the public key.

Contract Accounts

Contract accounts also have 42-character hexadecimal addresses. Their address is deterministically derived from:

  • The creator’s address

  • The creator’s nonce at deployment time

Example:

Once deployed, a contract’s bytecode cannot be altered, but its state variables can be updated according to the logic written in its code.

Validator Keys

In EGC Blockchain’s Proof-of-Stake consensus (based on the Parlia mechanism), validator identities are secured using ECDSA secp256k1 keys — the same cryptographic standard used for all externally owned accounts (EOAs) in Ethereum-compatible networks. These keys digitally sign consensus messages, enabling validators to participate in block production and finalisation.

Validator keys are distinct from regular account keys used for holding EGC balances. While an EOA is required for staking and rewards management, the validator’s operational key is dedicated to consensus duties, ensuring that control over funds remains separate from the infrastructure responsible for securing the network.

Wallets vs Accounts

  • Account: a data structure representing a public/private key pair or contract code on the EGC Blockchain.

  • Wallet: an interface (application, extension, or hardware device) that helps users interact with their accounts.

    • Wallets store and protect your private keys.

    • They enable you to sign transactions, manage assets, and interact with dApps.

(Source: https://docs.eaglecoin.ai/developer-docs/accounts-on-egc-chain#wallets-vs-accounts)

Privacy policy: https://eaglecoin.ai/privacy

Last updated