Solana 注册机公钥不匹配

Asi*_*raz 6 solana

我正在运行 solana-keygen 工具,但对其输出感到困惑。我的印象是第一个命令输出的公钥应该与使用第二个命令重新创建的公钥相同。但它们是不同的。第一个代表什么?

C:\Users\MSHIRAZ>solana-keygen new --no-outfile
Generating a new keypair

For added security, enter a BIP39 passphrase

NOTE! This passphrase improves security of the recovery seed phrase NOT the
keypair file itself, which is stored as insecure plain text

BIP39 Passphrase (empty for none):

=========================================================================
pubkey: Gu3nU5cW7W8mZesDUhjaym8e1mbsyUBey8fvhgnq7nMM
=========================================================================
Save this seed phrase and your BIP39 passphrase to recover your new keypair:
motor rate october crawl visa family prison hair annual fault tilt animal
=========================================================================

C:\Users\MSHIRAZ>solana-keygen pubkey prompt://
[pubkey recovery] seed phrase:
[pubkey recovery] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
ADarcoVBd5USiMpycBGrhforf2EHqUJTc4YyByC7A8xP

C:\Users\MSHIRAZ>solana-keygen verify ADarcoVBd5USiMpycBGrhforf2EHqUJTc4YyByC7A8xP prompt://
[pubkey recovery] seed phrase:
[pubkey recovery] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
Verification for public key: ADarcoVBd5USiMpycBGrhforf2EHqUJTc4YyByC7A8xP: Success
Run Code Online (Sandbox Code Playgroud)

Cha*_*ker 5

create 上打印的 pubkey 是原始 ed25519 密钥对 pubkey,而solana-keygen pubkey prompt://打印 m/44'/501' 处的 pubkey。如果你运行solana-keygen pubkey ASK它应该打印原始的公钥

目前有一个开放的 PR 可以更新 CLI,但现在您可以按照上面的描述进行操作。

https://github.com/solana-labs/solana/issues/17325#issuecomment-844317674