Documentation ¶
Index ¶
- Constants
- func ComputeDepositMessageSigningRoot(network core.Network, message *phase0.DepositMessage) (phase0.Root, error)
- func Decrypt(pk *rsa.PrivateKey, msg []byte) ([]byte, error)
- func DepositDataRootForFork(fork [4]byte, validatorPK []byte, withdrawalCredentials []byte, ...) (phase0.Root, error)
- func ETH1WithdrawalCredentials(withdrawalAddr []byte) []byte
- func EncodeRSAPublicKey(pk *rsa.PublicKey) ([]byte, error)
- func Encrypt(pub *rsa.PublicKey, msg []byte) ([]byte, error)
- func GenerateRSAKeys() (*rsa.PrivateKey, *rsa.PublicKey, error)
- func GetNetworkByFork(fork [4]byte) (core.Network, error)
- func InitBLS()
- func IsEOAAccount(client eip1271.ETHClient, address common.Address) (bool, error)
- func ParseRSAPublicKey(pk []byte) (*rsa.PublicKey, error)
- func RecoverBLSSignature(ids []uint64, partialSigs []*bls.Sign) (*bls.Sign, error)
- func RecoverValidatorPublicKey(ids []uint64, sharePks []*bls.PublicKey) (*bls.PublicKey, error)
- func SignRSA(sk *rsa.PrivateKey, byts []byte) ([]byte, error)
- func VerifyDepositData(network core.Network, depositData *phase0.DepositData) error
- func VerifyPartialSigs(sigs []*bls.Sign, pubs []*bls.PublicKey, data []byte) error
- func VerifyRSA(pk *rsa.PublicKey, msg, signature []byte) error
- func VerifySignedMessageByOwner(client eip1271.ETHClient, owner [20]byte, hash [32]byte, signature []byte) error
Constants ¶
View Source
const ( // https://eips.ethereum.org/EIPS/eip-7251 MIN_ACTIVATION_BALANCE phase0.Gwei = 32000000000 MAX_EFFECTIVE_BALANCE phase0.Gwei = 2048000000000 ETH1WithdrawalPrefixByte = byte(1) )
Variables ¶
This section is empty.
Functions ¶
func DepositDataRootForFork ¶
func GenerateRSAKeys ¶
func GenerateRSAKeys() (*rsa.PrivateKey, *rsa.PublicKey, error)
GenerateRSAKeys creates a random RSA key pair
func GetNetworkByFork ¶
GetNetworkByFork translates the network fork bytes into name
TODO: once eth2_key_manager implements this we can get rid of it and support all networks ekm supports automatically
func IsEOAAccount ¶
func ParseRSAPublicKey ¶
ParseRSAPublicKey parses encoded to base64 x509 RSA public key
func RecoverBLSSignature ¶
RecoverBLSSignature recovers a BLS master signature from T-threshold partial signatures
func RecoverValidatorPublicKey ¶
RecoverValidatorPublicKey recovers a BLS master public key (validator pub key) from provided partial pub keys
func SignRSA ¶
func SignRSA(sk *rsa.PrivateKey, byts []byte) ([]byte, error)
SignRSA create a RSA signature for incoming bytes
func VerifyDepositData ¶
func VerifyDepositData(network core.Network, depositData *phase0.DepositData) error
VerifyDepositData reconstructs and checks BLS signatures for ETH2 deposit message
func VerifyPartialSigs ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.