Account Migration Guide (CLI)
Last updated
Last updated
This upgrade introduces a new address which will enable ethereum
compatibility.
Things to note❗:
a. This guide can be done on Pundi AIFX Mainnet & Testnet.
b. Ensure the is done.
c. Ensure you have Pundi AIFX installed.
d. Your address should not be bonded to any validator (Address should not have a prior successful create-validator
command).
Accounts in Pundi AIFX
Accounts in Pundi AIFX
can be represented in both Bech32 and hex format for Ethereum's Web3 tooling compatibility.
The Bech32 format is the default format for Cosmos-SDK queries and transactions through CLI and REST clients.
Address (Bech32) with the prefix fx
eg: fx1xzyws0l8p8alt6v7tztvqlph8r22lhn4femgr7
Address (EIP55 Hex) with the prefix 0x
eg: 0x3088e83FE709fBf5e99e5896C07c3738d4aFDE75
The hex format on the other hand, is the Ethereum common.Address
representation of a Cosmos sdk.AccAddress
Compressed Public Key (Bech32): (used to encrypt data) fxpub17weu6qepqgca6ed53q7frh8ftcr6c0kucfhm0yuat4sxx4hc3u2y7pydcwwyc65xl7f
Prerequisites:
This account must have on-chain assets
This account must have made an on-chain transaction before if not it's data would not be registered on-chain
Prepare a wallet/key derived with secp256k1 curve, which Cosmos hub uses to identify for accounts:
example:
By default, the
fxcored keys add
command is defaulted to--algo=eth_secp256k1 --coin-type=60
without specifying the flag, specifying it will have the same result.
Prerequisites
This account must not have sent an on-chain transaction
Prepare a new wallet/key derived using the eth_secp256k1
curve after migration:
example:
The result should show the account balance, delegation, de-delegate, re-delegate, and votes, if any.
The result fields should display null as <0x-0> is a brand new wallet.
Migration of address
The following command will move everything in the previous old <fx-0>
address, such as token assets, delegations, delegating rewards, and proposals, if any.
The results returned from the above query should show the account balance of <fx-0> address (FX, PUNDIX, PURSE...), delegate, de-delegate, re-delegate, and vote as either null or zero.
The results returned from the above query should show account balance of <0x-0> address (FX, PUNDIX, PURSE...), delegate, de-delegate, re-delegate, and votes.
Now you can export your private key from the Pundi AIFX terminal using the following command. Again, make sure to replace <0x-0_keyName> with the name of the key that you want to export and use the correct keyring-backend
:
The MetaMask browser extension is a wallet for accessing Ethereum-enabled applications and managing user identities.
Open the MetaMask extension on your browser, you may have to log in to your MetaMask account if you are not already. Then click the top right circle and go to Settings
> Networks
> Add Network
and fill the form as shown below.
Here is the list of fields that you can use to paste on Metamask:
Network Name: DhobyGhaut Testnet
New RPC URL: https://testnet-fx-json-web3.functionx.io:8545
Chain ID: 90001
Currency Symbol (optional): FX
For more details, you may refer to below page:
Once you have added DhobyGhaut Testnet
to the Metamask Networks
, you can automatically import your accounts by:
Close the Settings
, go to My Accounts
(top right circle) and select Import Account
. You should see an image like the following one:
In Metamask and select the Private Key
option. Then paste the private key(hexadecimal) exported from the command in step 6, to import your new EVM-compatible account in MetaMask.
Your account balance will show up, as such. If it takes some time to load the balance of the account, change the network to Main Ethereum Network
and then switch back to DhobyGhaut Testnet
.Once you have imported your wallet in MetaMask, you can transfer your assets to the EVM-compatible wallet address and spend within Dapps in the Pundi AIFX ecosystem.
You will need to store your mnemonic phrase in a safe location. You may use the to get some test funds in your wallet.