Skip to main content
Version: 1.0

Wireshape Accounts

On the Wireshape blockchain, accounts are the fundamental units that interact within its ecosystem, just like in Ethereum. There are two main types of accounts: Externally Owned Accounts (EOAs) and Contract Accounts. Both types can hold the blockchain's native token, WIRE, and are identified by an address, but they serve different functions.

Externally Owned Accounts (EOAs)

Ownership: Controlled by individuals or entities possessing the private keys.

Functionality: EOAs can initiate transactions, such as transferring WIRE tokens, interacting with contract accounts, or deploying new contracts to the blockchain.

Key Pair: EOAs are created through cryptographic key generation, with the public key being hashed to form the account address. The private key is used to sign transactions, securing ownership and control over the account and its WIRE tokens.

warning

For EOAs, managing private keys with utmost care is essential; losing the key means losing access to the account and its assets.

Contract Accounts

Ownership: Governed by the deployed contract code, without any private key.

Functionality: These accounts hold and execute smart contract code upon receiving transactions, which can modify the blockchain's state or trigger further transactions.

Creation: When a contract is deployed to Wireshape, the blockchain generates a contract account. Its address is derived from the creator's address and the number of transactions that creator has made, ensuring a unique address.

warning

Contract accounts, must have their code audited thoroughly to prevent exploits, ensuring the integrity and safety of the contracts and the tokens they handle.

Key Features and Operations

WIRE Token Transactions: Both EOAs and contract accounts can hold, send, and receive WIRE tokens, facilitating a wide range of transactions on the Wireshape blockchain.

Address Formation: The blockchain uses a 20-byte address format for both account types. EOAs derive their addresses from their public keys, while contract accounts receive their addresses upon creation.

Interactions and Executions: EOAs are the initiators of transactions, which can include WIRE transfers or contract interactions. Contract accounts, on the other hand, execute their code in response to transactions they receive.

Gas and Transaction Fees: Every operation on the Wireshape blockchain, from simple transfers to complex contract executions, requires gas, paid in WIRE. This mechanism compensates validators for processing transactions and secures the network against spam.

Account Structure

nonce: A counter indicating the number of transactions sent from an account (for EOAs) or the number of contract creations made by the account (if it's a contract account). This nonce ensures every transaction is processed once and helps prevent replay attacks.

balance: Measured in WIRE, the native token, this represents the total amount of currency the account holds. Just as ETH is used in Ethereum for transaction fees and contract interactions, WIRE serves similar purposes in Wireshape, facilitating transactions, smart contract executions, and payment of gas fees.

storageRoot: A hash of the root node of a Merkle Patricia tree, which encodes the storage contents of the account. This structure is critical for contract accounts, enabling the blockchain to efficiently verify the state of contract storage without needing to hold the entire state on-chain.

codeHash: Unique to contract accounts, this is the hash of the smart contract code associated with the account. It allows the blockchain to reference and execute the contract code when the account receives a transaction.