AI Network
  • What is AI Network
  • AIN Blockchain
    • Architecture
      • Design Principles
      • Event-driven Architectures
      • Blockchain Database
        • States
          • State Types
          • Operations
          • Predefined Structures
        • Rules and Owners
          • Rule Configs
          • Owner Configs
        • Functions
          • Built-in Functions
      • Instant Execution, and Eventual Consistency
      • Network ID and Chain ID
      • Transactions
        • Structure
        • Nonce
        • Read Concern
        • Propagation
      • Block Structure
      • Account and Keys
      • Consensus
      • Scalability
      • Apps
    • Developer Guide
      • Quick Start
      • AI Network Products
        • AI Network Worker
        • AI Network Insight
        • Testnet Server Node
        • Ainize Trigger
          • Project user
          • Project deployer
          • Why do we have to use Ainize Trigger?
      • Token Bridge
      • Trouble Shooting
    • Developer Reference
      • Blockchain API
        • JSON RPC API
        • Node Client API
      • Blockchain SDK
        • ain-js
        • ain-py
      • Validators
    • Staking
  • AIN DAO
    • What is AIN DAO
      • Runo (Run Your Node)
      • GPU Sponsorship Program
    • Onboarding & Participation
    • Governance
    • Tokenomics
      • AI Network Tokenomics
      • AINFT Tokenomics
  • AI Agents
    • AINFT
    • AINFT Factory
    • AINFT Projects
      • 🍳MiniEggs
      • 🦈Baby Shark
      • 🛸Soul Fiction
      • 🎻NFT Classics Society
    • Developer Reference
      • Ainft-Js
      • AINFT tutorial
        • Create AINFT object and Mint
        • Transfer AINFT
        • Set metadata of AINFT
        • Search and Retrieve AINFT
  • AIN Wallet
    • What is AIN Wallet?
    • AIN Wallet API
  • PROPOSAL DOCUMENTS
    • AIN Improvement Memos (AIMs)
    • AIN Improvement Proposals (AIPs)
Powered by GitBook
On this page

Was this helpful?

  1. AIN Blockchain
  2. Architecture

Account and Keys

PreviousBlock StructureNextConsensus

Last updated 4 years ago

Was this helpful?

A private key uniquely determines a single AI Network address, also known as an account.

The usage of accounts in AI Network is more than securing funds. AI Network uses the account for allowing only certain addresses which satisfies the rule in the database path can change the value. In general, AI Network transaction is a request to access a particular database path with a particular account, and it requires a valid digital signature to be included in the blockchain. Anyone can verify that a transaction is valid, by checking that the digital signature matches the transaction details and the account to which access is being requested.

When a transaction is sent to the blockchain in order to change the value at a specific path in the blockchain state, it needs to be sent with a digital signature created with the private key corresponding to an account who has the permission to write the value to the path. More specifically, permission of the database path is controlled by owner and rule which can be also modified by signed transactions. While owner permission at a path is granted by specifying certain actionable types (i.e. branch_owner, write_function, write_owner, write_rule) to accounts, rules are more flexible and can be used with conditional statements. The details are covered in the rules section.

The following diagrams show how an application can utilize owner and rule for managing permission of an app. At first, the application owner can start from branching its own application path, and define rules for an application at subtrees. Some of the rules at subtree may state that the data can be only written by the users themselves, and even application owner cannot modify the user data.

Fig 1. (1) 0xAAAAAAAA does not have write_owner permission at "/apps". (2) 0xAAAAAAAA has a branch permission at "/apps", so it can start a new branch "/apps/afan". (3) 0xAAAAAAAA has a write_rule permission at "/apps/afan", so it can write rule at "/apps/afan/user0". (4) 0xBBBBBBBB does not have a write_rule permission, so it cannot write a rule at "/apps/afan/user0".

Fig 2. (1) 0xAAAAAAAA has permission to write the value at "/apps/afan". (2) 0xAAAAAAAA does not have permission to write the value at "/apps/afan/user0". (3) 0xBBBBBBBB has permission to write the value at "/apps/afan/user0". (4) While 0xCCCCCCCC has permission to write the value at "/apps/afan/user1", 0xBBBBBBBB does not have permission.

CAUTION: The private key must remain secret at all times. It must be backed up and protected from accidental loss. If it’s lost, it cannot be recovered and the funds and data secured by it are lost forever too.