æternity Documentation Hub
AeternityGitHub
  • æternity Hub
  • Developer Documentation
  • Welcome to æternity documentation
  • Getting Started
    • What is æternity?
    • How to Use Aeternity
  • æternity core concepts
    • Introduction
    • æternity Protocol
      • æternity Coin
      • Fast Æternity Transaction Engine (FATE VM)
      • æternity Nodes
        • Node architecture
        • Node types
        • Node Roles
      • Transactions
        • Types of transactions
        • Transaction Lifecycle
        • Transaction Fees
        • Meta-transactions and Generalized Accounts
        • State Channel Transactions
      • Networks
      • Consensus Mechanisms
        • Next Generation Nakamoto Consensus (Bitcoin-NG)
        • Cuckoo Cycle Proof of Work
        • Hyperchains and Delegated Proof of Stake
        • Governance and Weighted Coin Voting
      • State Channels
      • Oracles
      • Aeternity Naming System (AENS)
    • Hyperchains
      • Hyperchains Whitepaper
    • Aeternity Governance
    • Aeternity Foundation
  • aeternity user tools and services
    • Introduction
    • Run an æternity node
    • Hyperchains web app
    • Hyperchains Bridge app
    • Mine aeternity coin
    • Superhero DEX
    • Superhero Wallet
    • ærc Bridge
    • Make an NFT
    • aepps: decentralized applications on æternity
    • æScan: æternity blockchain explorer
  • æternity Developer tools
    • Quick Start Guide
      • Development Environment Setup
      • Essential Tools Overview
      • Æternity Stack
      • First Steps in Development
    • Protocol
      • Core Protocol Components
        • æternity Consensus Protocol
        • Generalized Accounts
        • Smart Contracts
          • FATE VM
          • Smart contract languages
            • æternity Sophia Language
              • In-Depth Overview
              • Sophia Compiler
              • Sophia Visual Studio
              • Sophia http
              • æREPL
            • Solidity
          • Contract Transactions
        • State Channels
        • Oracles
      • Network Layer
        • Nodes
          • Node Documentation
          • Node API Reference
        • Sync
        • Gossip
        • Stratum
      • Utility Features
        • æternity Naming System (AENS)
        • Seralization Formats
    • æternity Sophia Language
      • In-Depth Overview
      • Sophia Compiler
      • Sophia Visual Studio
      • Sophia http
      • æREPL
    • Development Infrastructure
      • CLIs
      • SDKs and APIs
        • Javascript/Typescript SDK
        • Java SDK
        • Outdated SDKs
        • APIs
          • Node API reference
      • Middleware
      • Testing and Deployment
        • æproject
        • Testnet
          • Localnet
          • Faucet
        • Testnets and Faucet
    • Token Standards
      • æternity token standards
        • AEXs: Aeternity Expansions
        • AEX-1
        • AEX-9
        • AEX-141
    • Aepps: Building apps on Aeternity
      • Boiler Plates
        • Angular Boiler Plate
        • React JS BoilerPlate
        • Vue BoilerPlate
      • Æpp architecture
      • Implementation Guidelines
      • Reference æpps
        • Case Studies
        • Code Examples
        • Aeternity Graffiti
    • Data and analytics
      • æScan
    • ÆRC Bridge
  • Hyperchains
    • Hyperchains Development Guide
    • Hyperchains Bridge
Powered by GitBook
On this page
  • Creating Generalized Accounts Through Attach Transactions
  • Understanding Meta-Transactions and Transaction Processing
  • Implementation Example: Bitcoin Key Integration
  • Security Considerations and Protection Mechanisms
  • Advanced Applications and Future Potential

Was this helpful?

Export as PDF
  1. æternity core concepts
  2. æternity Protocol
  3. Transactions

Meta-transactions and Generalized Accounts

PreviousTransaction FeesNextState Channel Transactions

Last updated 5 months ago

Was this helpful?

In the æternity blockchain, Generalized Accounts provide increased flexibility in transaction authentication. This powerful feature enables custom authorization schemes through the combination of attach transactions and meta-transactions, allowing accounts to implement sophisticated control mechanisms beyond traditional cryptographic signatures.

Creating Generalized Accounts Through Attach Transactions

The journey to creating a generalized account begins with an attach transaction. This special transaction type transforms a standard account into a generalized account by associating it with a smart contract that controls all future authorizations. The attach transaction must include the smart contract code and be signed using the account's standard EdDSA signature. This is a one-way transformation - once an account becomes a generalized account, it cannot revert to a standard account.

The smart contract attached to the account must implement an authentication function that accepts data as input and returns a boolean value indicating whether authentication is successful. This function defines the rules for authorizing transactions from the account, enabling flexible authentication schemes like multi-signature requirements, spending limits, or alternative cryptographic methods.

Understanding Meta-Transactions and Transaction Processing

After an account becomes generalized, all its transactions must be wrapped in meta-transactions. A meta-transaction packages a standard transaction (with its nonce set to zero) along with the necessary authentication data required by the account's smart contract. The meta-transaction includes additional information such as fees and gas needed to execute the smart contract's authorization function.

When the network processes a meta-transaction, it first executes the authentication function in the associated smart contract using the provided authentication data. Only if authentication succeeds does the network process the inner transaction. This two-step process ensures that all transactions follow the custom authorization rules defined in the account's contract while maintaining the security of the network.

Implementation Example: Bitcoin Key Integration

A practical example of generalized accounts is enabling æternity transactions to be signed using Bitcoin private keys. The attached smart contract is initialized with the desired public key and implements ECDSA signature verification using the Secp256k1 curve. The authentication function verifies signatures created by the corresponding Bitcoin private key, allowing users to manage their æternity accounts using familiar Bitcoin key management tools.

In this implementation, the contract tracks its own nonce to prevent transaction replay attacks. Users must maintain awareness of the contract's nonce state to ensure proper transaction sequencing. The contract verifies signatures against a Blake2b hash of the transaction data and nonce, providing secure transaction authorization using Bitcoin keypairs.

Security Considerations and Protection Mechanisms

The implementation of generalized accounts includes careful consideration of potential security risks. To prevent abuse, the system only charges gas for successful authentication attempts, protecting account holders from potential drain attacks through failed authentications. However, this creates a potential risk of resource exhaustion attacks against miners who must execute authentication functions.

To mitigate these risks, authentication functions are restricted from performing expensive chain operations. Miners can also implement rules to reject transactions that appear to be attempting resource exhaustion. These protections ensure the security of both individual accounts and the network as a whole.

Advanced Applications and Future Potential

Generalized accounts enable numerous sophisticated account management schemes. Beyond alternative signature algorithms, they can implement multi-signature wallets, spending limits based on time periods, and restrictions on transaction types. The flexibility of smart contract-based authorization allows for innovative account control mechanisms while maintaining strong security guarantees.

When implementing generalized accounts, developers must carefully design their authorization functions to include proper integrity checking and replay protection. The power and flexibility of this system require thoughtful implementation to prevent potential security vulnerabilities while enabling advanced account management features.

Generalized Accounts Documentation