You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let caip10 = `eip155:1:${App.ADDR}`
let domain = "domain.eth"
let msg = `Generate Deterministic IPNS Keys for '${domain}'\n\nSigned By: ${caip10}`;
let sig = await App.SIGNER.signMessage(msg);
let password = "pass12#$"
let inputKey = sha256(
hexToBytes(
sig.toLowerCase().startsWith('0x') ? sig.slice(2) : sig
)
)
let info = `${caip10}:${domain}`
let salt = sha256(`${info}:${password ? password : ''}:${sig.slice(-64)}`)
let hashKey = hkdf(sha256, inputKey, salt, info, 42)
let privKey = hashToPrivateScalar(hashKey, ed25519.CURVE.n).toString(16)
let pubKey = await ed25519.getPublicKey(privKey)
utils.js:86 Uncaught (in promise) Error: private key must be valid hex string, got "d06c76f87d42fe0e683b454318543ba25463b34a4c17594f32c05a3051ae608". Cause: Error: hex string is invalid: unpadded 63
The text was updated successfully, but these errors were encountered:
The error is pretty clear: you need padded hex. d06 bad, 0d06 good.
I've used let privateKey = hashToPrivateScalar(hashKey, ed25519.CURVE.n).toString(16).padStart(64, "0").
it's always 63 char long so privkey always starts with "0x0...".
The text was updated successfully, but these errors were encountered: