LogoLogo
  • Introduction
    • What is Arichain
    • Why Arichain
    • Vision: Redefining Layer 1, Empowering Every Builder.
    • TL;DR Summary for Builders
    • Details to read
  • Architectural Philosophy
    • Monolithic vs Modular: Why Multi-VM
    • Native Composability over Interoperability
    • Unified Chain State and Execution Environment
    • Chain Structure: Multi-VM under One Consensus
    • Identity & User Abstraction
  • General Architecture Overview
    • Multi-VM Execution Environment
    • Consensus Mechanism
    • Token Design
    • Unified Gas System
    • GAID: Global Account Identity
    • Future Roadmap
  • Technical Overview
    • Consensus Protocol Details
    • Token Design and Interoperability
    • Gas System Architecture
    • GAID Architecture
    • State Management
    • Bridge Infrastructure
  • Developer Experience
    • SDK
    • Developer tools
  • Validator
    • Validator Roles & Node Types
    • Reward System
    • Staking
    • Use Cases
    • Node Operations
  • Security
    • Design Goals
    • Threat Model and Risk Assessment
    • Continuous Security Verification
  • Token Economics & Validator Incentives
    • Token Utility
    • Validator Incentives
    • Token Supply and Distribution
    • Onboarding Workflow
  • Roadmap
Powered by GitBook
On this page
  1. Technical Overview

GAID Architecture

Details are provisional and may be updated during development.

GAID (Global Account Identity) is Arichain's universal identity system that assigns unified identities to users across multiple virtual machines, enabling seamless Multi-VM interactions and consistent user experience.

GAID Technical Architecture

Core Identity Structure:

pub struct GAID {
    pub global_id: [u8; 32],          // Unique 256-bit identifier
    pub evm_address: Option<[u8; 20]>, // Ethereum-style address
    pub svm_pubkey: Option<[u8; 32]>,  // Solana-style public key
    pub wasm_account: Option<[u8; 32]>, // Future WASM account ID
    pub zkvm_identity: Option<[u8; 32]>, // Future ZK-VM identity
    pub nonce: u64,                    // Global nonce for replay protection
    pub permissions: PermissionMap,     // Multi-VM Permissions
    pub metadata: AccountMetadata,      // Additional account data
}

pub struct PermissionMap {
    pub evm_permissions: Vec<Permission>,
    pub svm_permissions: Vec<Permission>,
    pub bridge_permissions: Vec<BridgePermission>,
    pub admin_capabilities: Vec<AdminCap>,
}

GAID Implementation Details

Identity Generation & Mapping

Initial Registration: When a user first interacts with Arichain, GAID automatically generates a global identity:

// GAID Generation Process - Import Existing Wallet
fn generate_gaid_from_existing_wallet(existing_address: &str, vm_type: VMType, signature: &Signature) -> GAID {
    let global_id = match vm_type {
        VMType::EVM => {
            // Use existing EVM address (e.g., MetaMask wallet)
            let evm_address = parse_evm_address(existing_address)?;
            keccak256([evm_address, b"arichain_gaid"].concat())
        },
        VMType::SVM => {
            // Use existing SVM pubkey (e.g., Phantom wallet)
            let svm_pubkey = parse_svm_pubkey(existing_address)?;
            keccak256([svm_pubkey, b"arichain_gaid"].concat())
        }
    };
    
    match vm_type {
        VMType::EVM => {
            let evm_address = parse_evm_address(existing_address)?;
            // Derive SVM address from existing EVM address
            let svm_pubkey = derive_svm_from_evm(&evm_address, signature);
            GAID::new(global_id, Some(evm_address), Some(svm_pubkey), None, None)
        },
        VMType::SVM => {
            let svm_pubkey = parse_svm_pubkey(existing_address)?;
            // Derive EVM address from existing SVM pubkey
            let evm_address = derive_evm_from_svm(&svm_pubkey, signature);
            GAID::new(global_id, Some(evm_address), Some(svm_pubkey), None, None)
        }
    }
}

// Helper functions for address derivation
fn derive_svm_from_evm(evm_address: &[u8; 20], signature: &Signature) -> [u8; 32] {
    let derivation_seed = keccak256([evm_address, signature.r(), b"to_svm"].concat());
    ed25519_pubkey_from_seed(&derivation_seed)
}

fn derive_evm_from_svm(svm_pubkey: &[u8; 32], signature: &Signature) -> [u8; 20] {
    let derivation_seed = keccak256([svm_pubkey, signature.r(), b"to_evm"].concat());
    let derived_key = secp256k1_privkey_from_seed(&derivation_seed);
    ethereum_address_from_privkey(&derived_key)
}

This GAID system provides the technical foundation for unified identity management while maintaining security and compatibility across all supported virtual machine environments.

PreviousGas System ArchitectureNextState Management

Last updated 23 days ago