eip712

package
v0.0.0-...-73b4c3b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

功能

  • Go 后端生成 EIP-712 消息并将其发送给用户
  • 用户使用 Metamask 签署消息
  • 生成的签名被发送到后端并进行验证以确保其真实性。

具体实现

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EIP712Sign

func EIP712Sign(prv *ecdsa.PrivateKey, data *apitypes.TypedData) (string, error)

EIP712Sign eth EIP712 签名

func Eip712Hash

func Eip712Hash() (*common.Hash, error)

func RecoverEIP712Signature

func RecoverEIP712Signature(sig string, data *apitypes.TypedData) (dataHash hexutil.Bytes, recoveredAddr ethcommon.Address, err error)

EIP712SignatureRecover eth EIP712 恢复 signer 地址

func RecoverRawMsgSignature

func RecoverRawMsgSignature(sig, msg string) (signerAddr string, err error)

func Verifying

func Verifying(dataHash []byte, userAddress common.Address, signature string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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