zkp

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserIdSignalsIndex    = 0
	ChallengeSignalsIndex = 1
	GistRootSignalsIndex  = 2
)

https://github.com/iden3/circuits/blob/master/circuits/authV2.circom

Proof pub signals example with description:

21493028867609342730075626961959697053940727668683389257942040837777854978 - user did (index 0) 21493028867609342730075626961959697053940727668683389257942040837777854978 - challenge (index 1) 16285847858933578151298306208524779888950768974039235725833670860163361043104 - gistRoot (index 2)

View Source
const ChallengeExpirationDelta = 5 * time.Minute

Variables

View Source
var (
	ErrChallengeWasNotRequested = errors.New("challenge was not requested")
	ErrChallengeIsInvalid       = errors.New("challenge is already invalid")
)

Functions

This section is empty.

Types

type Challenge

type Challenge struct {
	Value    string
	Exp      time.Time
	Verified bool
}

type Verifier

type Verifier struct {
	Enabled bool
	Schema  string
	// contains filtered or unexported fields
}

func (*Verifier) Challenge

func (v *Verifier) Challenge(user string) (string, error)

func (*Verifier) VerifyProof

func (v *Verifier) VerifyProof(user string, proof *zkptypes.ZKProof) (err error)

VerifyProof performs ZK Groth16 proof verification based on specified verification key and hardcoded/passed parameters.

type Verifierer

type Verifierer interface {
	Verifier() *Verifier
}

func NewVerifierer

func NewVerifierer(getter kv.Getter) Verifierer

Jump to

Keyboard shortcuts

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