Documentation ¶
Overview ¶
Package signature handles all lower level support for signing transactions.
Index ¶
- Constants
- func FromAddress(value any, v, r, s *big.Int) (string, error)
- func Hash(value any) string
- func Sign(value any, privateKey *ecdsa.PrivateKey) (v, r, s *big.Int, err error)
- func SignatureString(v, r, s *big.Int) string
- func ToSignatureBytes(v, r, s *big.Int) []byte
- func ToSignatureBytesWithQID(v, r, s *big.Int) []byte
- func VerifySignature(v, r, s *big.Int) error
Constants ¶
View Source
const QID = 29
QID is an arbitrary value added to the v component of the signature similar to Ethereum and Bitcoin.
View Source
const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"
ZeroHash is the hash of an empty string.
Variables ¶
This section is empty.
Functions ¶
func FromAddress ¶
FromAddress extracts the address from the signature that signed the data.
func SignatureString ¶
SignatureString returns the signature in the [R|S|V] format.
func ToSignatureBytes ¶
ToSignatureBytes converts the v, r, s components into the original 65 bytes signature without QID.
func ToSignatureBytesWithQID ¶
ToSignatureBytesWithQID converts the v, r, s components into the original 65 bytes signature with QID.
func VerifySignature ¶
VerifySignature verifies the signature conforms to the standards.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.