Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import wallet created from ckb-cli #354

Open
contrun opened this issue Feb 13, 2024 · 10 comments
Open

Unable to import wallet created from ckb-cli #354

contrun opened this issue Feb 13, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@contrun
Copy link

contrun commented Feb 13, 2024

I am running Neuron-v0.112.0-x86_64.AppImage on nixos. I find neuron cannot import a keystore file created freshly by ckb-cli. After deleting the field origin from the file created by ckb-cli (this trick is discovered by export a wallet created by neuron itself and comparing the file format, I think we need to document this file format somewhere), I successfully imported the keystore file. Below are the steps to reproduce this issue.

My ckb-cli version is

ckb-cli --version
ckb-cli 0.103.0 (1ec3ffd 2022-06-24)

Create a new account with password qwertyui1!

ckb-cli account new 
Your new account is locked with a password. Please give a password. Do not forget this password.
Password: 
Repeat password: 
address:
  mainnet: ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqgs9tg3r04mvanjw8jzkw3rsxkzawydj7c88gugg
  testnet: ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqgs9tg3r04mvanjw8jzkw3rsxkzawydj7cf4rnzs
address(deprecated):
  mainnet: ckb1qyqpq2k3zxltkem8yu0y9vaz8qdv96ugm9asczrphp
  testnet: ckt1qyqpq2k3zxltkem8yu0y9vaz8qdv96ugm9as98a7ma
lock_arg: 0x102ad111bebb6767271e42b3a2381ac2eb88d97b
lock_hash: 0xcd8c4ecbf96bd8c5d782682b065f6446bc6f2a4bd2a37c2d95b285b59426e494

Here is the keystore file to that account, this file can not be imported to neuron wallet.

jq < ~/.ckb-cli/keystore/UTC--2024-02-13T16-30-02.363165640Z--102ad111bebb6767271e42b3a2381ac2eb88d97b
{
  "ckb_root": {
    "chain_code": "eec90d230686c7933afa71d637209605099d1d78d7f73eece97a3fccd78e730b",
    "path": "m/44'/309'/0'",
    "pubkey": "02b88d200cda995d919435f535676bbedc6366dce9fdf0eb0e8b64dbbfc3081067"
  },
  "crypto": {
    "cipher": "aes-128-ctr",
    "cipherparams": {
      "iv": "27ff473a1e579a00d3876b155be6b70d"
    },
    "ciphertext": "3890077b1b138b5f695846b9572ac8f83674fe2b1cb26e979f83aaf0caf324e1ff320bc41470e256ef03a0f75cffa4a4bde332967132e8e1d928d78fb9149946",
    "kdf": "scrypt",
    "kdfparams": {
      "dklen": 32,
      "n": 262144,
      "p": 1,
      "r": 8,
      "salt": "de94db7d697450b2f351f4abbcf2047e90516b2e43df101973a4bbf88fb1a80c"
    },
    "mac": "5d17b965d9a74a30c04758b775492aa20516abb77f3750eee5affe26831de82d"
  },
  "hash160": "102ad111bebb6767271e42b3a2381ac2eb88d97b",
  "id": "c8832c82-8096-429c-88f7-f8633740b2e6",
  "origin": "ckb-cli",
  "version": 3
}

Try to import the file above, and the import will fail

Edit the keystore file manually and delete the field origin

nvim ~/.ckb-cli/keystore/UTC--2024-02-13T16-30-02.363165640Z--102ad111bebb6767271e42b3a2381ac2eb88d97b

Now the field origin is deleted

jq < ~/.ckb-cli/keystore/UTC--2024-02-13T16-30-02.363165640Z--102ad111bebb6767271e42b3a2381ac2eb88d97b
{
  "ckb_root": {
    "chain_code": "eec90d230686c7933afa71d637209605099d1d78d7f73eece97a3fccd78e730b",
    "path": "m/44'/309'/0'",
    "pubkey": "02b88d200cda995d919435f535676bbedc6366dce9fdf0eb0e8b64dbbfc3081067"
  },
  "crypto": {
    "cipher": "aes-128-ctr",
    "cipherparams": {
      "iv": "27ff473a1e579a00d3876b155be6b70d"
    },
    "ciphertext": "3890077b1b138b5f695846b9572ac8f83674fe2b1cb26e979f83aaf0caf324e1ff320bc41470e256ef03a0f75cffa4a4bde332967132e8e1d928d78fb9149946",
    "kdf": "scrypt",
    "kdfparams": {
      "dklen": 32,
      "n": 262144,
      "p": 1,
      "r": 8,
      "salt": "de94db7d697450b2f351f4abbcf2047e90516b2e43df101973a4bbf88fb1a80c"
    },
    "mac": "5d17b965d9a74a30c04758b775492aa20516abb77f3750eee5affe26831de82d"
  },
  "hash160": "102ad111bebb6767271e42b3a2381ac2eb88d97b",
  "id": "c8832c82-8096-429c-88f7-f8633740b2e6",
  "version": 3
}

Import the file again, now it works

@Keith-CY Keith-CY added the bug Something isn't working label Feb 14, 2024
@Keith-CY Keith-CY added this to Neuron Feb 14, 2024
@Keith-CY Keith-CY moved this to 📋 Backlog in Neuron Feb 14, 2024
@yanguoyu
Copy link

nervosnetwork/neuron@1b66ea3 If currently, Neuron can support ckb-cli keystore file, we can remove this logic.

@contrun
Copy link
Author

contrun commented Feb 20, 2024

I would like to know the historical reason of why the functionality of importing ckb-cli keystore file was removed. If there is indeed something that makes ckb-cli keystore file and neuron keystore file incompatible, then I think we should warn the user and tell them what's happening.

@yanguoyu
Copy link

I would like to know the historical reason of why the functionality of importing ckb-cli keystore file was removed. If there is indeed something that makes ckb-cli keystore file and neuron keystore file incompatible, then I think we should warn the user and tell them what's happening.

https://github.com/nervosnetwork/ckb-cli/wiki/Import-ckb-cli-keystore-from%26to-Neuron-wallet#ckb-cli-and-neuron-use-the-keystore-in-different-way
Hi, because they are using different derivative rules, the generated addresses may be different.
I believe we should tell the user the reason why neuron does not support ckb-cli's keystore file. @Danie0918

@Danie0918 Danie0918 self-assigned this Feb 22, 2024
@Keith-CY
Copy link
Member

Some users were confused by this case too, it would be grateful if a brief guide can be added @Danie0918

@Danie0918
Copy link
Contributor

Some users were confused by this case too, it would be grateful if a brief guide can be added @Danie0918

Okay, I'll take it over.

@Danie0918 Danie0918 moved this from 📋 Backlog to 📌Planning in Neuron May 22, 2024
@Danie0918 Danie0918 moved this from 📌Planning to 🎨 Designing in Neuron May 27, 2024
@Danie0918
Copy link
Contributor

Danie0918 commented Jun 3, 2024

Image

【Add a prompt when importing wallets from ckb-cli】

  1. Display prompt text, text fixed display, according to the software to select the language to switch the language.
  2. Add external link instructions, and click to open the browser to jump to the relevant link.

@Kirl70
Copy link

Kirl70 commented Jun 11, 2024

@devchenyan
Copy link

@Danie0918 Danie0918 moved this from 🎨 Designing to 🔎 Code Review in Neuron Jun 21, 2024
@Danie0918 Danie0918 moved this from 🔎 Code Review to 👀 Testing in Neuron Jun 26, 2024
@Danie0918 Danie0918 assigned silySuper and unassigned devchenyan Jun 26, 2024
@silySuper
Copy link

1.Click X to close window does not works.

2024-06-27.17.02.42.mov

2.English shows abnormal.
截屏2024-06-27 17 01 55

@Danie0918 Danie0918 moved this from 👀 Testing to 🚩Pre Release in Neuron Jul 1, 2024
@silySuper silySuper moved this from 🚩Pre Release to 👀 Testing in Neuron Jul 1, 2024
@devchenyan
Copy link

devchenyan commented Jul 1, 2024

1.Click X to close window does not works.

2024-06-27.17.02.42.mov
2.English shows abnormal. 截屏2024-06-27 17 01 55

nervosnetwork/neuron#3192

  1. fixed
  2. The display is not quite right due to the font design.

@Danie0918 Danie0918 moved this from 👀 Testing to 🚩Pre Release in Neuron Jul 1, 2024
@Danie0918 Danie0918 moved this from 🚩Pre Release to ⭐ Release List in Neuron Aug 1, 2024
@Danie0918 Danie0918 moved this from ⭐ Release List to 🚩Pre Release in Neuron Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🚩Pre Release
Development

No branches or pull requests

7 participants