5

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

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
4

1 回答 1

3

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

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

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

于 2021-07-09T00:38:24.723 回答