stark

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package stark implements utilities for generating imx.L2Signer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey() (*big.Int, error)

GenerateKey generates a random key that can be used to create StarkSigner. On creation save this key for future usage as this key will be required to reuse your stark signer. @return Randomly generated private key.

Types

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

StarkSigner implements L2Signer interface.

func NewSigner

func NewSigner(privateKey *big.Int) (*Signer, error)

NewSigner created a new stark signer with the given private stark key.

func (*Signer) GetAddress

func (base *Signer) GetAddress() string

GetAddress returns the stark public key of the StarkSigner as a 64 digit hex string prefixed with 0x.

func (*Signer) SignMessage

func (base *Signer) SignMessage(message string) (string, error)

func (*Signer) VerifySignature

func (base *Signer) VerifySignature(hash *big.Int, signature, signersPublicKey string) error

VerifySignature validates the given signature is signed by the requiredSigner or not.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL