我想了解为什么无法使用 polkadotJs 密钥环验证子密钥签名。
当它使用密钥环签名时,一切都很好:
const msg = "message to be verified"
const keyring_signature = alice.sign(msg)
console.log("isvalid keyring: ", alice.verify(msg, keyring_signature)) // true
console.log(u8aToHex(alice.publicKey)) // 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
但是,当我尝试使用相同的 Alice 帐户对其子密钥进行签名时,验证返回 false:
subkey inspect //Alice
Secret Key URI `//Alice` is account:
Secret seed: 0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a
Public key (hex): 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
Account ID: 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
SS58 Address: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
echo "message to be verified" | subkey sign 0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a
// this returned a 64bytes signature
const msg = "message to be verified"
const subkey_signature = "96c02390e077231595c4805aecdd242bbdd43456d289c6050ad819d42275032836eb5ea4a48a2aa2b1150219904b7de2b08f5b1a63e3ad8459c29d0e7dd00e8e"
console.log("isvalid subkey : ", alice.verify(msg, subkey_signature)) // false
任何人都可以帮忙吗?谢谢!