Wallets and Accounts
In the ArcBlock ecosystem, understanding the distinction and relationship between Wallets and Accounts is fundamental. While often used interchangeably in general blockchain discussions, they serve distinct but interconnected roles in managing your digital identity and assets. This section clarifies these concepts, building upon the foundational knowledge of Decentralized Identifiers (DIDs), Non-Fungible Tokens (NFTs), and Tokens.
What is a Wallet?#
A wallet in ArcBlock is primarily a cryptographic tool that holds your secret key (SK) and public key (PK), from which your address (DID) is derived. It's the secure container for the private information that proves your ownership.
Wallet Components#
A wallet typically comprises:
- Secret Key (SK): A private, cryptographic key that must be kept confidential. It is used to generate the public key and sign transactions.
- Public Key (PK): Derived from the secret key. It can be shared publicly and is used to verify signatures made with the corresponding secret key.
- Address (DID): A unique decentralized identifier generated from the public key. This is your public identity on the blockchain.
Wallet Functions#
Wallets are crucial for several operations:
- Signing Transactions: Using the secret key, a wallet signs transactions or other messages, proving that the sender authorized the action.
- Verifying Messages: The public key stored in the wallet can be used by others to verify that a message or transaction was indeed signed by the owner of that wallet.
It is paramount to keep your secret keys safe, as anyone with knowledge of your secret key can spoof signatures and send unauthorized transactions on your behalf.
What is an Account?#
An account is a data entry that resides on the blockchain ledger. Unlike a wallet, which holds your keys, an account represents your presence and holdings directly on the chain. Each account is uniquely identified by a DID.
Account Capabilities#
Accounts on the ArcBlock chain can:
- Own Tokens: Hold various fungible tokens (cryptocurrencies).
- Own NFTs: Possess Non-Fungible Tokens (digital collectibles or unique assets).
- Be Migrated: Accounts can be migrated to a new account, offering flexibility in identity management.
- Multiple Accounts: Users can manage multiple accounts, often facilitated through a DID Wallet, allowing for different identities or purposes.
- Transaction Prerequisite: A user needs at least one account to send and receive transactions on the chain.
Account Structure (TAccountState
)#
The AccountState
defines the structure of an account on the ArcBlock blockchain. Here are some key fields:
Field Name | Type | Description |
---|---|---|
|
| The unique DID of the account. |
|
| The primary token balance of the account. |
|
| A unique number used to prevent replay attacks for transactions originating from this account. |
|
| The total number of transactions initiated by this account. |
|
| The public key associated with the account. |
|
| Defines the cryptographic types used for the wallet (e.g., key type, hash type). |
|
| A human-readable name or alias for the account. |
|
| The total number of assets (NFTs) owned by the account. |
|
| A list of tokens and their amounts held by the account. |
|
| A list of DIDs to which this account has been migrated. |
|
| A list of DIDs from which this account was migrated. |
|
| The DID of the entity that issued this account. |
|
| The balance designated for transaction gas fees. |
|
| Contextual information about the account's state, including genesis and renaissance transaction details. |
|
| Arbitrary data associated with the account. |
Relationship between Wallet and Account#
The relationship is one of control and ownership. A wallet, through its secret key, controls an account. The account, in turn, is where digital assets (tokens, NFTs) are recorded on the blockchain.
This means:
- Control: Your wallet's secret key is the ultimate proof of ownership and control over the funds and assets in the associated account.
- Ownership of Funds: If you lose your wallet's secret key, you lose access to and ownership of the funds and assets held in that account, as you can no longer sign transactions to move them.
In essence, the wallet is your digital key ring, and the account is the vault on the blockchain that your keys open.
Having understood Wallets and Accounts, you are now ready to explore Verifiable Credentials (VCs), another critical concept for digital identity and trust in the ArcBlock ecosystem.