solana-keygen new生成的地址与用其助记词导入钱包后的地址不一致

问题:solana-keygen new生成的地址与用其助记词导入钱包后的地址不一致

答案:将输入BIP39 Passphrase这一步省了,也就是直接回车,啥也不输入。
原理:输入Passphrase会再进行一次加密运算(私钥,公钥都会影响),但钱包里是 仅且只能 用助记词按着衍生路径推导出的。所以会不一致。
在这里插入图片描述
这样不输入的,按助记词导入钱包就会和本地生成的地址一致。
在这里插入图片描述
常用命令:

 ~/Doc/solana/zhuhai/hello_world  on master ?12  solana-keygen new --help                                                       ok  at 10:03:05 
solana-keygen-new 
Generate new keypair file from a random seed phrase and optional BIP39 passphrase

USAGE:
    solana-keygen new [OPTIONS]

OPTIONS:
    -C, --config <FILEPATH>
            Configuration file to use [default: /Users/hanpeng/.config/solana/cli/config.yml]

        --derivation-path [<DERIVATION_PATH>...]
            Derivation path. All indexes will be promoted to hardened. If arg is not presented then
            derivation path will not be used. If arg is presented with empty DERIVATION_PATH value
            then m/44'/501'/0'/0' will be used.

    -f, --force
            Overwrite the output file if it exists

    -h, --help
            Print help information

        --language <LANGUAGE>
            Specify the mnemonic language that will be present in the generated seed phrase
            [default: english] [possible values: english, chinese-simplified, chinese-traditional,
            japanese, spanish, korean, french, italian]

        --no-bip39-passphrase
            Do not prompt for a BIP39 passphrase

        --no-outfile
            Only print a seed phrase and pubkey. Do not output a keypair file

    -o, --outfile <FILEPATH>
            Path to generated file

    -s, --silent
            Do not display seed phrase. Useful when piping output to other programs that prompt for
            user input, like gpg

        --word-count <NUMBER>
            Specify the number of words that will be present in the generated seed phrase [default:
            12] [possible values: 12, 15, 18, 21, 24]




solana-keygen new  --derivation-path m/44'/501'/0'/0' --force  
solana address
solana-keygen pubkey
solana balance

需要注意如果不加这个参数(显示声明使用衍生路径)

–derivation-path

那么生成的地址也会和钱包导入的对不上。

所以

1:生成的时候用:

solana-keygen new  --derivation-path m/44'/501'/0'/0' --force 

或者 
solana-keygen new  --derivation-path --force 

都可以

2: 直接回车 不要输入Passphrase

参考:
https://docs.solanalabs.com/cli/wallets/paper
https://www.learnblockchain.cn/article/7425
https://learnblockchain.cn/question/2683

  • 9
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值