BotTT Ep 4: AIN Account and Key Signing

AI Network Dev Team
AI Network
Published in
2 min readOct 27, 2022

This is the fourth episode of our ‘Blockchain on the Tea Table’ series. You can download a printer-friendly version.

by Dongil Seo

AIN Account

Like other blockchain projects, AIN Blockchain also provides services to create and manage user crypto accounts called AIN accounts, which are essential for self-sovereign identity (SSI). Using AIN accounts, users can securely manage their digital assets such as native AIN token on the blockchain and prove their identities by key signing (Note that for ERC20 AIN token, you need an Ethereum account).

How to create an AIN account?

AIN accounts can be easily created using tools/account/createAccounts.js tool in the following manner:

$ node createAccounts.js 1
Number of accounts to create: 1
Creating an account with prefix ''..
Account: {
"address": "0x0cef4322BaA1f2350D7247e04E40A9c2953B301b",
"private_key": "18189971c254ab3ac1e853d2c59218c744bd99736174cfa065469e621aed4a95",
"public_key": "4804e25f570d644c0d05927020c4076f55087100c43e1cc1db8f8870f39ca02445d501b9fc212aadd4567d8f3ef873aa8f77d301aa706d58eb4b7ec4a5879054"
}
Created accounts:
[
{
"address": "0x0cef4322BaA1f2350D7247e04E40A9c2953B301b",
"private_key": "18189971c254ab3ac1e853d2c59218c744bd99736174cfa065469e621aed4a95",
"public_key": "4804e25f570d644c0d05927020c4076f55087100c43e1cc1db8f8870f39ca02445d501b9fc212aadd4567d8f3ef873aa8f77d301aa706d58eb4b7ec4a5879054"
}
]

An AIN account consists of an address, a public key and a private key. The private key, also known as secret key, is the core part of the account that should be kept very carefully as the other parts can be easily derived from it.

Key Signing

Key signing is a process of creating a signature from target data and a private key. The signature can be used later to verify that 1) the signing was done by an account of a specific address and 2) the target data is not manipulated from when it was signed. For example, a transaction body can be signed as in signTransaction() as follows:

where chainId is the ID of the blockchain (i.e., whether it’s the testnet or the mainnet) the signing is done with respect to (see Network ID and Chain ID). Signatures with different chain IDs cannot be used interchangeably, e.g., a signature for the testnet is not valid for mainnet.

Signature Verification

Signature verification for target data, a signature, and an address can be done as in verifyTransaction():

Besides for the data verification, AIN accounts and key signing can be used for several different purposes:

  • User authentication (i.e., login method)
  • Access control to an API server
  • Secure communication via asymmetric encryption (see Public-key cryptography)

If you created an AIN account, you just got a pass to the AIN Blockchain world. Have fun!

AIN Blockchain is still a young project and we’re working around-the-clock to improve its flexibility, performance, and security. For further updates, please check the following links:

Printer-friendly version:
https://docs.google.com/document/d/1eMl0cbGTe-Cu2-ygvsbHsZrKmzgTeMcrovAnL-Q8kKM/edit

--

--