mleku on Nostr: i used standard btcec library to do it i don't get how it's being rejected, whatever ...
i used standard btcec library to do it
i don't get how it's being rejected, whatever algorithm you have checking the validity of the public key it generates is rejecting valid secp256k1 curve points
this is the checker in btcec:
// isOnCurve returns whether or not the affine point (x,y) is on the curve.
func isOnCurve(fx, fy *FieldVal) bool {
// Elliptic curve equation for secp256k1 is: y^2 = x^3 + 7
y2 := new(FieldVal).SquareVal(fy).Normalize()
result := new(FieldVal).SquareVal(fx).Mul(fx).AddInt(7).Normalize()
return y2.Equals(result)
}
i added that to recoder thing i did in case there was some issue, it decodes the nsec to raw bytes, then converts it to a btcec key pair, and runs the curve check on it and it's definitely a valid key
whatever library you are using is rejecting valid public keys, i guess i hit the jackpot lol
i don't get how it's being rejected, whatever algorithm you have checking the validity of the public key it generates is rejecting valid secp256k1 curve points
this is the checker in btcec:
// isOnCurve returns whether or not the affine point (x,y) is on the curve.
func isOnCurve(fx, fy *FieldVal) bool {
// Elliptic curve equation for secp256k1 is: y^2 = x^3 + 7
y2 := new(FieldVal).SquareVal(fy).Normalize()
result := new(FieldVal).SquareVal(fx).Mul(fx).AddInt(7).Normalize()
return y2.Equals(result)
}
i added that to recoder thing i did in case there was some issue, it decodes the nsec to raw bytes, then converts it to a btcec key pair, and runs the curve check on it and it's definitely a valid key
whatever library you are using is rejecting valid public keys, i guess i hit the jackpot lol