nip11, nip13, nip46 changes from promenade port.
and verify pubkey validity when decoding it from an arbitrary json object.
This commit is contained in:
3
keys.go
3
keys.go
@@ -74,6 +74,9 @@ func (pk *PubKey) UnmarshalJSON(buf []byte) error {
|
||||
return fmt.Errorf("must be a hex string of 64 characters")
|
||||
}
|
||||
_, err := hex.Decode(pk[:], buf[1:65])
|
||||
if _, err := schnorr.ParsePubKey(pk[:]); err != nil {
|
||||
return fmt.Errorf("pubkey is not valid %w", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user