TRUMP(特朗普币)芝麻开门交易所

Analysis on the principles of creating a Little Ant NEO wallet a

Date:2024-04-19 19:06:16 Channel:Crypto Read:
The principle of creating a Little Ant NEO wallet account is a wonderful fusion of digital cryptography. Let us explore this fascinating process in depth.
In today's digital era, with the rise of cryptocurrencies, people's demand for secure digital asset management is growing. As a popular digital asset management tool, the Ant NEO wallet has complex and sophisticated cryptographic principles hidden behind its account creation process. Let us lift the veil of mystery and gain an in-depth understanding of the principles of the Little Ant NEO wallet account.
First of all, the creation process of the Little Ant NEO wallet account is based on an asymmetric encryption algorithm, such as the RSA algorithm. This algorithm consists of two parts: public key and private key. The public key is used for encryption and the private key is used for decryption. When a user creates an Ant NEO wallet account, the system will generate a pair of public and private keys. The public key serves as the user's address and is used to receive cryptocurrency, while the private key is the unique identifier of the user's identity and is used to sign transactions to verify identity.
Secondly, the security of the Ant NEO wallet account is based on elliptic curve cryptography (ECC). ECC is an efficient and secure encryption algorithm that can reduce the consumption of computing and storage resources while ensuring security. Ant NEO wallet uses ECC to generate points on the elliptic curve to implement digital signatures to ensure the security and non-tamperability of transactions.
In addition, the creation of a Little Ant NEO wallet account also involves the concepts of mnemonic words and seed phrases. The mnemonic phrase is a set of random words used to recover the private key of the wallet, while the seed phrase is the seed that generates the mnemonic phrase through a certain algorithm. Users need to keep the mnemonic words and seed phrases properly when creating a Ant NEO wallet so that they can restore the wallet when needed.
In addition to cryptographic principles, the creation of Ant NEO wallet accounts also involves technologies in network security and identity verification. Through technical means such as multi-signature and smart contracts, Ant NEO wallet provides a safer and more convenient way to manage digital assets, attracting more and more users to join it.
In general, the creation principle of the Ant NEO wallet account integrates technologies from multiple fields such as cryptography, network security, and identity verification to ensure the security and privacy of users' digital assets. With the continuous development of blockchain technology, I believe that Ant NEO wallet will have more innovations in the future, providing users with a more convenient and secure digital asset management experience. Let us look forward to the wonderful future of this digital era!

The four most famous international exchanges:

Binance INTL
OKX INTL
Gate.io INTL
Huobi INTL
Binance International Line OKX International Line Gate.io International Line Huobi International Line
China Line APP DL China Line APP DL
China Line APP DL
China Line APP DL

Note: The above exchange logo is the official website registration link, and the text is the APP download link.

Xiaoyi NEO blockchain wallet account

Wallet account

The neo wallet mainly includes address, privateKey, publicKey, scriptHash, and WIF; there is a certain conversion relationship between them: NEP<=>WIF
<=> Private => Public => ScriptHash <=> Address is no joke, except address
Don’t tell anyone else except what you can tell others. The address is similar to a bank card number, which is used when others want to transfer money to you.

Create wallet account

import { wallet } from '@cityofzion/neon-js';/  Generate a new neo account based on passpase 
@param {} passphase  @param {} confirmPassphase  @param {} wif /export
function createWalletAccount(passphase: string, confirmPassphase: string,
wif?: string): ?WalletAccount { if (passphase !== confirmPassphase) return
null; var account = new wallet.Account(wif || wallet.generatePrivateKey());
const encryptedWIF = wallet.encrypt(account.WIF, passphase); const result:
WalletAccount = { address: account.address, privateKey: account.privateKey,
publicKey: account.publicKey, scriptHash: account.scriptHash, WIF:
account.WIF, encryptedWIF, passphase, } return result;}

Create wallet account unit test

Unit test the method of creating a wallet through jest test('createWalletAccount ', () => { const passphase =
'123456'; const account = createWalletAccount(passphase, passphase);
console.log(account); expect(account.address !==
null).toBe(true);});The running result is as follows, which is the currently generated account information. You can use neo-wallet to log in and try it. {address:
'AUMgtJsw3kBrcA7poBYNaonZTGMNoqZNLy', privateKey:
'10bb026b4015c481f0b5142aa5de36de40a99fc8c26e956011a3f820f7708fba', publicKey:
'03af2ad8725c4926632d6816f5502d8f749dec369afadfe0bb5ac697fe22a0ef77',
scriptHash: 'a8f677c132f2c82d73ff138e817e784c25ab068a', WIF:
'KwnETPM2m8wTAY3qySvDVLf3Vpfg77nvJhxR2Qyi8uMWKoqP1Q3f', encryptedWIF:
'6PYVHykkA1TfyQ2344wftv5e7vRoecV4iVwEVZ62aqCAx3dh3LDrRV19AS', passphase:
'123456' }

Convert

As mentioned before, various data in the wallet have certain conversion relationships. As for the detailed principles of mutual conversion, we will not discuss them first. We can use neon-
js related API to check whether the conversion is correct. NEP<=>WIF <=> Private => Public => ScriptHash <=>
Address: First create a new jtest unit test file Core.spec.js

Conversion of private key to public key

The test account generated above is used here for testing. Note that because it is a test account, I will not use it again, so it is exposed. If it is your personal account, please be sure not to expose the WIF and privateKey. The unit test code is as follows: import
{wallet} from '@cityofzion/neon-
js';test('private:10bb026b4015c481f0b5142aa5de36de40a99fc8c26e956011a3f820f7708fba
get PUb_Key',()=>{ const pubKey =
wallet.getPublicKeyFromPrivateKey('10bb026b4015c481f0b5142aa5de36de40a99fc8c26e956011a3f820f7708fba');
expect(pubKey).toBe('03af2ad8725c4926632d6816f5502d8f749dec369afadfe0bb5ac697fe22a0ef77');});Run the unit test using the command: npm
run test __test__/neo/Core.spec.js results:

All conversions

The complete conversion relationship is as follows: import {wallet} from '@cityofzion/neon-js'; const walletAccount = {
address: 'AUMgtJsw3kBrcA7poBYNaonZTGMNoqZNLy', privateKey:
'10bb026b4015c481f0b5142aa5de36de40a99fc8c26e956011a3f820f7708fba', publicKey:
'03af2ad8725c4926632d6816f5502d8f749dec369afadfe0bb5ac697fe22a0ef77',
scriptHash: 'a8f677c132f2c82d73ff138e817e784c25ab068a', WIF:
'KwnETPM2m8wTAY3qySvDVLf3Vpfg77nvJhxR2Qyi8uMWKoqP1Q3f', encryptedWIF:
'6PYVHykkA1TfyQ2344wftv5e7vRoecV4iVwEVZ62aqCAx3dh3LDrRV19AS', passphase:
'123456' };// WIF <=> privateKeytest('WIF <=> privateKey',()=>{ const wif =
wallet.getWIFFromPrivateKey(walletAccount.privateKey);
expect(wif).toBe(walletAccount.WIF); const privateKey =
wallet.getPrivateKeyFromWIF(walletAccount.WIF);
expect(privateKey).toBe(walletAccount.privateKey);});// privateKey =>
publicKeytest(`privateKey => publicKey:${walletAccount.privateKey}`,()=>{
const pubKey = wallet.getPublicKeyFromPrivateKey(walletAccount.privateKey);
expect(pubKey).toBe(walletAccount.publicKey);});// publicKey =>
ScriptHashtest(`publicKey => ScriptHash:${walletAccount.publicKey}`,()=>{
const scriptHash = wallet.getScriptHashFromPublicKey(walletAccount.publicKey);
expect(scriptHash).toBe(walletAccount.scriptHash);});// scriptHash <=>
addresstest('scriptHash <=> address',()=>{ const address =
wallet.getAddressFromScriptHash(walletAccount.scriptHash);
expect(address).toBe(walletAccount.address); const scriptHash =
wallet.getScriptHashFromAddress(walletAccount.address);
expect(scriptHash).toBe(walletAccount.scriptHash);});

Summarize

As above, it mainly explains the creation of neo account and the conversion relationship between the various fields of the account. The API used in this article is neon-
js, this is the neo wallet API open sourced by coz in the github community. It contains all the APIs for wallet development. I think it is a good material for learning wallets. Of course, neo-gui, neo-
cli itself is also open source, and you can use their source code to learn. However, compared to C, for developing cross-platform applications, I prefer electron-based solutions. In order to learn to develop neo wallet, I built an electron boilerplate as the basis for quick start, so that other friends who also want to use this solution do not have to set up the environment again. This boilerplate specifically integrates the following technical solutions: electron, React, dva, flow, antd; I will take the time to integrate the jest mentioned in the article later so that I can write unit tests out of the box.

I'll answer.

2512

Ask

965K+

reading

0

Answer

3H+

Upvote

2H+

Downvote