Documentation
¶
Index ¶
- Constants
- Variables
- func CircomSiblings(proof *merkletree.Proof, levels int) []*merkletree.Hash
- func HashToStr(siblings []*merkletree.Hash) []string
- func PoseidonHashValue(values []*big.Int) (*big.Int, error)
- func PrepareCircuitArrayValues(arr []*big.Int, size int) ([]*big.Int, error)
- func PrepareSiblings(siblings []*merkletree.Hash, levels int) []*big.Int
- func PrepareSiblingsStr(siblings []*merkletree.Hash, levels int) []string
- func RegisterCircuit(id CircuitID, c Data)
- func UnmarshalCircuitOutput(id CircuitID, b []byte) (map[string]interface{}, error)
- type AtomicQueryMTPInputs
- type AtomicQueryMTPPubSignals
- type AtomicQueryMTPV2Inputs
- type AtomicQueryMTPV2OnChainInputs
- type AtomicQueryMTPV2OnChainPubSignals
- type AtomicQueryMTPV2PubSignals
- type AtomicQuerySigInputs
- type AtomicQuerySigPubSignals
- type AtomicQuerySigV2Inputs
- type AtomicQuerySigV2OnChainInputs
- type AtomicQuerySigV2OnChainPubSignals
- type AtomicQuerySigV2PubSignals
- type AtomicQueryV3Inputs
- type AtomicQueryV3OnChainInputs
- type AtomicQueryV3OnChainPubSignals
- type AtomicQueryV3PubSignals
- type AuthInputs
- type AuthPubSignals
- type AuthV2Inputs
- type AuthV2PubSignals
- type BJJSignatureProof
- type BaseConfig
- type CircuitID
- type ClaimWithMTPProof
- type ClaimWithSigAndMTPProof
- type ClaimWithSigProof
- type Comparer
- type Data
- type GISTProof
- type InputsMarshaller
- type KeyLoader
- type LinkedMultiQueryInputs
- type LinkedMultiQueryPubSignals
- type MTProof
- type NodeAuxValue
- type ProofType
- type PubSignals
- type PubSignalsMapper
- type PubSignalsUnmarshaller
- type Query
- type Scalar
- type StateTransitionInputs
- type StateTransitionPubSignals
- type SybilAtomicMTPInputsdeprecated
- type SybilAtomicMTPPubSignalsdeprecated
- type SybilAtomicSigInputsdeprecated
- type SybilAtomicSigPubSignalsdeprecated
- type TreeState
- type ValueProof
- type Vector
Constants ¶
const ( ErrorEmptyAuthClaimProof = "empty auth claim mtp proof" ErrorEmptyAuthClaimInNewStateProof = "empty auth claim in new state mtp proof" ErrorEmptyAuthClaimNonRevProof = "empty auth claim non-revocation mtp proof" ErrorEmptyChallengeSignature = "empty challenge signature" ErrorEmptyClaimSignature = "empty claim signature" ErrorEmptyClaimProof = "empty claim mtp proof" ErrorEmptyClaimNonRevProof = "empty claim non-revocation mtp proof" ErrorEmptyIssuerAuthClaimProof = "empty issuer auth claim mtp proof" ErrorEmptyIssuerClaim = "empty issuer claim" ErrorEmptyStateCommitmentClaim = "empty state commitment claim" ErrorEmptyIssuerAuthClaimNonRevProof = "empty issuer auth claim non-revocation mtp proof" ErrorEmptyJsonLDQueryProof = "empty JSON-LD query mtp proof" ErrorEmptyJsonLDQueryValue = "empty JSON-LD query value" ErrorEmptyJsonLDQueryPath = "empty JSON-LD query path" ErrorEmptyQueryValue = "empty query value" ErrorEmptyJsonLDQueryValues = "empty JSON-LD query values" ErrorEmptyID = "empty ID" ErrorEmptyChallenge = "empty challenge" ErrorEmptyGISTProof = "empty GIST identity mtp proof" ErrorEmptyRequestID = "empty request ID" ErrorEmptyLinkNonce = "empty link nonce" ErrorEmptyClaim = "empty claim" ErrorEmptyQueries = "empty queries" ErrorTooManyQueries = "too many queries" ErrorInvalidProofType = "invalid proof type" ErrorEmptySignatureProof = "empty signature proof" ErrorEmptyMTPProof = "empty MTP proof" ErrorInvalidValuesArrSize = "invalid query Values array size" )
const ( NOOP int = iota // No operation, skip query verification in circuit EQ LT GT IN NIN NE LTE GTE BETWEEN NONBETWEEN EXISTS SD = 16 NULLIFY = 17 )
List of available operators.
const BatchSize = 5
BatchSize defined by poseidon hash implementation in Solidity
const LinkedMultiQueryLength = 10
Variables ¶
var ErrorCircuitIDNotFound = errors.New("circuit id not supported")
ErrorCircuitIDNotFound returns if CircuitID is not registered
var QueryOperators = map[string]int{ "$noop": NOOP, "$eq": EQ, "$lt": LT, "$gt": GT, "$in": IN, "$nin": NIN, "$ne": NE, "$lte": LTE, "$gte": GTE, "$between": BETWEEN, "$nonbetween": NONBETWEEN, "$exists": EXISTS, "$sd": SD, "$nullify": NULLIFY, }
QueryOperators represents operators for atomic circuits
Functions ¶
func CircomSiblings ¶
func CircomSiblings(proof *merkletree.Proof, levels int) []*merkletree.Hash
CircomSiblingsFromSiblings returns the full siblings compatible with circom
func PoseidonHashValue ¶
PoseidonHashValue returns the solidity and circom implementation of poseidon hash
func PrepareCircuitArrayValues ¶
PrepareCircuitArrayValues padding values to size. Validate array size and throw an exception if array is bigger than size if array is bigger circuit cannot compile because number of inputs does not match
func PrepareSiblings ¶
PrepareSiblings prepare siblings for zk zk
func PrepareSiblingsStr ¶
func RegisterCircuit ¶
RegisterCircuit is factory for circuit init. This is done during init() in the method's implementation
Types ¶
type AtomicQueryMTPInputs ¶
type AtomicQueryMTPInputs struct { BaseConfig // auth ID *core.ID AuthClaim ClaimWithMTPProof Challenge *big.Int Signature *babyjub.Signature Claim ClaimWithMTPProof // claim issued for user CurrentTimeStamp int64 // query Query }
AtomicQueryMTPInputs ZK private inputs for credentialAtomicQueryMTP.circom Deprecated: use AtomicQueryMTPV2Inputs instead
func (AtomicQueryMTPInputs) InputsMarshal ¶
func (a AtomicQueryMTPInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryMTP.circom
type AtomicQueryMTPPubSignals ¶
type AtomicQueryMTPPubSignals struct { BaseConfig UserID *core.ID `json:"userID"` UserState *merkletree.Hash `json:"userState"` Challenge *big.Int `json:"challenge"` ClaimSchema core.SchemaHash `json:"claimSchema"` IssuerClaimIdenState *merkletree.Hash `json:"issuerClaimIdenState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` IssuerID *core.ID `json:"issuerID"` SlotIndex int `json:"slotIndex"` Values []*big.Int `json:"values"` Operator int `json:"operator"` Timestamp int64 `json:"timestamp"` }
AtomicQueryMTPPubSignals public signals Deprecated: use AtomicQueryMTPV2PubSignals instead
func (AtomicQueryMTPPubSignals) GetObjMap ¶
func (ao AtomicQueryMTPPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryMTPPubSignals) PubSignalsUnmarshal ¶
func (ao *AtomicQueryMTPPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryMTP.circom public signals array to AtomicQueryMTPPubSignals
type AtomicQueryMTPV2Inputs ¶
type AtomicQueryMTPV2Inputs struct { BaseConfig // auth ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int Claim ClaimWithMTPProof // claim issued for user SkipClaimRevocationCheck bool RequestID *big.Int CurrentTimeStamp int64 // query Query }
AtomicQueryMTPV2Inputs ZK private inputs for credentialAtomicQueryMTPV2.circom
func (AtomicQueryMTPV2Inputs) InputsMarshal ¶
func (a AtomicQueryMTPV2Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryMTP.circom
func (AtomicQueryMTPV2Inputs) Validate ¶
func (a AtomicQueryMTPV2Inputs) Validate() error
Validate validates AtomicQueryMTPPubSignals
type AtomicQueryMTPV2OnChainInputs ¶
type AtomicQueryMTPV2OnChainInputs struct { BaseConfig // auth ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int Claim ClaimWithMTPProof // claim issued for user SkipClaimRevocationCheck bool RequestID *big.Int CurrentTimeStamp int64 AuthClaim *core.Claim `json:"authClaim"` AuthClaimIncMtp *merkletree.Proof `json:"authClaimIncMtp"` AuthClaimNonRevMtp *merkletree.Proof `json:"authClaimNonRevMtp"` TreeState TreeState `json:"treeState"` GISTProof GISTProof `json:"gistProof"` Signature *babyjub.Signature `json:"signature"` Challenge *big.Int `json:"challenge"` // query Query }
AtomicQueryMTPV2OnChainInputs ZK private inputs for credentialAtomicQueryMTPV2OnChain.circom
func (AtomicQueryMTPV2OnChainInputs) InputsMarshal ¶
func (a AtomicQueryMTPV2OnChainInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryMTP.circom
func (AtomicQueryMTPV2OnChainInputs) Validate ¶
func (a AtomicQueryMTPV2OnChainInputs) Validate() error
Validate validates AtomicQueryMTPPubSignals
type AtomicQueryMTPV2OnChainPubSignals ¶
type AtomicQueryMTPV2OnChainPubSignals struct { BaseConfig RequestID *big.Int `json:"requestID"` UserID *core.ID `json:"userID"` IssuerID *core.ID `json:"issuerID"` IssuerClaimIdenState *merkletree.Hash `json:"issuerClaimIdenState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` Timestamp int64 `json:"timestamp"` Merklized int `json:"merklized"` IsRevocationChecked int `json:"isRevocationChecked"` // 0 revocation not check, // 1 for check revocation QueryHash *big.Int `json:"circuitQueryHash"` Challenge *big.Int `json:"challenge"` GlobalRoot *merkletree.Hash `json:"gistRoot"` }
AtomicQueryMTPPubSignals public signals
func (AtomicQueryMTPV2OnChainPubSignals) GetObjMap ¶
func (ao AtomicQueryMTPV2OnChainPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryMTPV2OnChainPubSignals) PubSignalsUnmarshal ¶
func (ao *AtomicQueryMTPV2OnChainPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryMTPV2OnChain.circom public signals array to AtomicQueryMTPPubSignals
type AtomicQueryMTPV2PubSignals ¶
type AtomicQueryMTPV2PubSignals struct { BaseConfig RequestID *big.Int `json:"requestID"` UserID *core.ID `json:"userID"` IssuerID *core.ID `json:"issuerID"` IssuerClaimIdenState *merkletree.Hash `json:"issuerClaimIdenState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` ClaimSchema core.SchemaHash `json:"claimSchema"` SlotIndex int `json:"slotIndex"` Operator int `json:"operator"` Value []*big.Int `json:"value"` Timestamp int64 `json:"timestamp"` Merklized int `json:"merklized"` ClaimPathKey *big.Int `json:"claimPathKey"` ClaimPathNotExists int `json:"claimPathNotExists"` // 0 for inclusion, 1 for non-inclusion IsRevocationChecked int `json:"isRevocationChecked"` // 0 revocation not check, // 1 for check revocation }
AtomicQueryMTPPubSignals public signals
func (AtomicQueryMTPV2PubSignals) GetObjMap ¶
func (ao AtomicQueryMTPV2PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryMTPV2PubSignals) PubSignalsUnmarshal ¶
func (ao *AtomicQueryMTPV2PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryMTP.circom public signals array to AtomicQueryMTPPubSignals
type AtomicQuerySigInputs ¶
type AtomicQuerySigInputs struct { BaseConfig // auth ID *core.ID AuthClaim ClaimWithMTPProof Challenge *big.Int Signature *babyjub.Signature Claim ClaimWithSigProof // issuerClaim Query CurrentTimeStamp int64 }
AtomicQuerySigInputs ZK private inputs for credentialAtomicQuerySig.circom Deprecated: use AtomicQuerySigV2Inputs instead
func (AtomicQuerySigInputs) InputsMarshal ¶
func (a AtomicQuerySigInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQuerySig.circom
type AtomicQuerySigPubSignals ¶
type AtomicQuerySigPubSignals struct { BaseConfig UserID *core.ID `json:"userID"` UserState *merkletree.Hash `json:"userState"` Challenge *big.Int `json:"challenge"` ClaimSchema core.SchemaHash `json:"claimSchema"` IssuerID *core.ID `json:"issuerID"` IssuerAuthState *merkletree.Hash `json:"issuerAuthState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` SlotIndex int `json:"slotIndex"` Values []*big.Int `json:"values"` Operator int `json:"operator"` Timestamp int64 `json:"timestamp"` }
AtomicQuerySigPubSignals public inputs Deprecated: use AtomicQuerySigV2PubSignals instead
func (AtomicQuerySigPubSignals) GetObjMap ¶
func (ao AtomicQuerySigPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQuerySigPubSignals) PubSignalsUnmarshal ¶
func (ao *AtomicQuerySigPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQuerySig.circom public signals
type AtomicQuerySigV2Inputs ¶
type AtomicQuerySigV2Inputs struct { BaseConfig RequestID *big.Int // auth ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int Claim ClaimWithSigProof // issuerClaim SkipClaimRevocationCheck bool // query Query Query CurrentTimeStamp int64 }
AtomicQuerySigInputs ZK private inputs for credentialAtomicQuerySig.circom
func (AtomicQuerySigV2Inputs) InputsMarshal ¶
func (a AtomicQuerySigV2Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQuerySig.circom
func (AtomicQuerySigV2Inputs) Validate ¶
func (a AtomicQuerySigV2Inputs) Validate() error
type AtomicQuerySigV2OnChainInputs ¶
type AtomicQuerySigV2OnChainInputs struct { BaseConfig RequestID *big.Int // auth ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int Claim ClaimWithSigProof // issuerClaim SkipClaimRevocationCheck bool AuthClaim *core.Claim `json:"authClaim"` AuthClaimIncMtp *merkletree.Proof `json:"authClaimIncMtp"` AuthClaimNonRevMtp *merkletree.Proof `json:"authClaimNonRevMtp"` TreeState TreeState `json:"treeState"` GISTProof GISTProof `json:"gistProof"` Signature *babyjub.Signature `json:"signature"` Challenge *big.Int `json:"challenge"` // query Query Query CurrentTimeStamp int64 }
AtomicQuerySigV2OnChainInputs ZK private inputs for credentialAtomicQuerySig.circom
func (AtomicQuerySigV2OnChainInputs) InputsMarshal ¶
func (a AtomicQuerySigV2OnChainInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQuerySig.circom
func (AtomicQuerySigV2OnChainInputs) Validate ¶
func (a AtomicQuerySigV2OnChainInputs) Validate() error
type AtomicQuerySigV2OnChainPubSignals ¶
type AtomicQuerySigV2OnChainPubSignals struct { BaseConfig RequestID *big.Int `json:"requestID"` UserID *core.ID `json:"userID"` IssuerID *core.ID `json:"issuerID"` IssuerAuthState *merkletree.Hash `json:"issuerAuthState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` Timestamp int64 `json:"timestamp"` Merklized int `json:"merklized"` IsRevocationChecked int `json:"isRevocationChecked"` // 0 revocation not check, // 1 for check revocation QueryHash *big.Int `json:"circuitQueryHash"` Challenge *big.Int `json:"challenge"` GlobalRoot *merkletree.Hash `json:"gistRoot"` }
AtomicQuerySigV2OnChainPubSignals public inputs
func (AtomicQuerySigV2OnChainPubSignals) GetObjMap ¶
func (ao AtomicQuerySigV2OnChainPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQuerySigV2OnChainPubSignals) PubSignalsUnmarshal ¶
func (ao *AtomicQuerySigV2OnChainPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQuerySig.circom public signals
type AtomicQuerySigV2PubSignals ¶
type AtomicQuerySigV2PubSignals struct { BaseConfig RequestID *big.Int `json:"requestID"` UserID *core.ID `json:"userID"` IssuerID *core.ID `json:"issuerID"` IssuerAuthState *merkletree.Hash `json:"issuerAuthState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` ClaimSchema core.SchemaHash `json:"claimSchema"` SlotIndex int `json:"slotIndex"` Operator int `json:"operator"` Value []*big.Int `json:"value"` Timestamp int64 `json:"timestamp"` Merklized int `json:"merklized"` ClaimPathKey *big.Int `json:"claimPathKey"` ClaimPathNotExists int `json:"claimPathNotExists"` // 0 for inclusion, 1 for non-inclusion IsRevocationChecked int `json:"isRevocationChecked"` // 0 revocation not check, // 1 for check revocation }
AtomicQuerySigV2PubSignals public inputs
func (AtomicQuerySigV2PubSignals) GetObjMap ¶
func (ao AtomicQuerySigV2PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQuerySigV2PubSignals) PubSignalsUnmarshal ¶
func (ao *AtomicQuerySigV2PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQuerySig.circom public signals
type AtomicQueryV3Inputs ¶ added in v2.0.1
type AtomicQueryV3Inputs struct { BaseConfig RequestID *big.Int // auth ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int Claim ClaimWithSigAndMTPProof SkipClaimRevocationCheck bool // query Query Query CurrentTimeStamp int64 ProofType ProofType LinkNonce *big.Int VerifierID *core.ID NullifierSessionID *big.Int }
AtomicQueryV3Inputs ZK private inputs for credentialAtomicQuerySig.circom
func (AtomicQueryV3Inputs) InputsMarshal ¶ added in v2.0.1
func (a AtomicQueryV3Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryV3.circom
func (AtomicQueryV3Inputs) Validate ¶ added in v2.0.1
func (a AtomicQueryV3Inputs) Validate() error
type AtomicQueryV3OnChainInputs ¶ added in v2.0.1
type AtomicQueryV3OnChainInputs struct { BaseConfig RequestID *big.Int ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int Claim ClaimWithSigAndMTPProof SkipClaimRevocationCheck bool AuthClaim *core.Claim `json:"authClaim"` AuthClaimIncMtp *merkletree.Proof `json:"authClaimIncMtp"` AuthClaimNonRevMtp *merkletree.Proof `json:"authClaimNonRevMtp"` TreeState TreeState `json:"treeState"` GISTProof GISTProof `json:"gistProof"` Signature *babyjub.Signature `json:"signature"` Challenge *big.Int `json:"challenge"` // query Query Query CurrentTimeStamp int64 ProofType ProofType LinkNonce *big.Int VerifierID *core.ID NullifierSessionID *big.Int IsBJJAuthEnabled int }
AtomicQueryV3OnChainInputs ZK private inputs for credentialAtomicQueryV3OnChain.circom
func (AtomicQueryV3OnChainInputs) InputsMarshal ¶ added in v2.0.1
func (a AtomicQueryV3OnChainInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryV3OnChain.circom
func (AtomicQueryV3OnChainInputs) Validate ¶ added in v2.0.1
func (a AtomicQueryV3OnChainInputs) Validate() error
type AtomicQueryV3OnChainPubSignals ¶ added in v2.0.1
type AtomicQueryV3OnChainPubSignals struct { BaseConfig RequestID *big.Int `json:"requestID"` UserID *core.ID `json:"userID"` IssuerID *core.ID `json:"issuerID"` IssuerState *merkletree.Hash `json:"issuerState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` Timestamp int64 `json:"timestamp"` QueryHash *big.Int `json:"circuitQueryHash"` Challenge *big.Int `json:"challenge"` GlobalRoot *merkletree.Hash `json:"gistRoot"` ProofType int `json:"proofType"` LinkID *big.Int `json:"linkID"` Nullifier *big.Int `json:"nullifier"` OperatorOutput *big.Int `json:"operatorOutput"` IsBJJAuthEnabled int `json:"isBJJAuthEnabled"` }
AtomicQueryV3OnChainPubSignals public inputs
func (AtomicQueryV3OnChainPubSignals) GetObjMap ¶ added in v2.0.1
func (ao AtomicQueryV3OnChainPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryV3OnChainPubSignals) PubSignalsUnmarshal ¶ added in v2.0.1
func (ao *AtomicQueryV3OnChainPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryV3OnChain.circom public signals
type AtomicQueryV3PubSignals ¶ added in v2.0.1
type AtomicQueryV3PubSignals struct { BaseConfig RequestID *big.Int `json:"requestID"` UserID *core.ID `json:"userID"` IssuerID *core.ID `json:"issuerID"` IssuerState *merkletree.Hash `json:"issuerState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` ClaimSchema core.SchemaHash `json:"claimSchema"` SlotIndex int `json:"slotIndex"` Operator int `json:"operator"` Value []*big.Int `json:"value"` Timestamp int64 `json:"timestamp"` Merklized int `json:"merklized"` ClaimPathKey *big.Int `json:"claimPathKey"` IsRevocationChecked int `json:"isRevocationChecked"` // 0 revocation not check, // 1 for check revocation ProofType int `json:"proofType"` LinkID *big.Int `json:"linkID"` Nullifier *big.Int `json:"nullifier"` OperatorOutput *big.Int `json:"operatorOutput"` VerifierID *core.ID `json:"verifierID"` NullifierSessionID *big.Int `json:"nullifierSessionID"` ActualValueArraySize int `json:"valueArraySize"` }
AtomicQueryV3PubSignals public inputs
func (AtomicQueryV3PubSignals) GetObjMap ¶ added in v2.0.1
func (ao AtomicQueryV3PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryV3PubSignals) PubSignalsUnmarshal ¶ added in v2.0.1
func (ao *AtomicQueryV3PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryV3.circom public signals
type AuthInputs ¶
type AuthInputs struct { BaseConfig ID *core.ID AuthClaim ClaimWithMTPProof Signature *babyjub.Signature Challenge *big.Int }
AuthInputs type represent auth.circom private inputs Deprecated: use AuthV2Inputs instead
func (AuthInputs) InputsMarshal ¶
func (a AuthInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for auth.circom
type AuthPubSignals ¶
type AuthPubSignals struct { Challenge *big.Int `json:"challenge"` UserState *merkletree.Hash `json:"userState"` UserID *core.ID `json:"userID"` }
AuthPubSignals auth.circom public signals Deprecated: use AuthV2PubSignals instead
func (AuthPubSignals) GetObjMap ¶
func (a AuthPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns AuthPubSignals as a map
func (*AuthPubSignals) PubSignalsUnmarshal ¶
func (a *AuthPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal auth.circom public inputs to AuthPubSignals
type AuthV2Inputs ¶
type AuthV2Inputs struct { BaseConfig GenesisID *core.ID `json:"genesisID"` ProfileNonce *big.Int `json:"profileNonce"` AuthClaim *core.Claim `json:"authClaim"` AuthClaimIncMtp *merkletree.Proof `json:"authClaimIncMtp"` AuthClaimNonRevMtp *merkletree.Proof `json:"authClaimNonRevMtp"` TreeState TreeState `json:"treeState"` GISTProof GISTProof `json:"gistProof"` Signature *babyjub.Signature `json:"signature"` Challenge *big.Int `json:"challenge"` }
AuthV2Inputs type represent authV2.circom inputs
func (AuthV2Inputs) InputsMarshal ¶
func (a AuthV2Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for auth.circom
func (AuthV2Inputs) MarshalJSON ¶
func (a AuthV2Inputs) MarshalJSON() ([]byte, error)
func (*AuthV2Inputs) UnmarshalJSON ¶
func (a *AuthV2Inputs) UnmarshalJSON(in []byte) error
func (AuthV2Inputs) Validate ¶
func (a AuthV2Inputs) Validate() error
type AuthV2PubSignals ¶
type AuthV2PubSignals struct { UserID *core.ID `json:"userID"` Challenge *big.Int `json:"challenge"` GISTRoot *merkletree.Hash `json:"GISTRoot"` }
AuthV2PubSignals auth.circom public signals
func (AuthV2PubSignals) GetObjMap ¶
func (a AuthV2PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns AuthPubSignals as a map
func (*AuthV2PubSignals) PubSignalsUnmarshal ¶
func (a *AuthV2PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal auth.circom public inputs to AuthPubSignals
type BJJSignatureProof ¶
type BJJSignatureProof struct { // Signature Signing the claim with the private key of the issuer associated with the issuerAuthClaim Signature *babyjub.Signature `json:"signature"` IssuerAuthClaim *core.Claim `json:"issuerAuthClaim"` // issuer AuthClaim // IssuerAuthIncProof proof of inclusion of issuer AuthClaim to // the issuer claims tree IssuerAuthIncProof MTProof `json:"issuerAuthIncProof"` // IssuerAuthNonRevProof proof of non revocation of issuer // AuthClaim in the issuer the latest state IssuerAuthNonRevProof MTProof `json:"issuerAuthNonRevProof"` }
BJJSignatureProof is a proof of issuer AuthClaim signature over a claim
type BaseConfig ¶
type BaseConfig struct { MTLevel int // Max levels of MT ValueArraySize int // Size if value array in identity circuits MTLevelOnChain int // Max levels of MT on chain MTLevelClaim int // Max level of JSONLD claim }
BaseConfig base circuit's config, provides default configuration for default circuits
func (BaseConfig) GetMTLevel ¶
func (c BaseConfig) GetMTLevel() int
GetMTLevel max circuit MT levels
func (BaseConfig) GetMTLevelOnChain ¶
func (c BaseConfig) GetMTLevelOnChain() int
GetMTLevel max circuit MT levels on chain
func (BaseConfig) GetMTLevelsClaim ¶
func (c BaseConfig) GetMTLevelsClaim() int
GetMTLevelsClaim max jsonld Claim levels
func (BaseConfig) GetValueArrSize ¶
func (c BaseConfig) GetValueArrSize() int
GetValueArrSize return size of circuits value array size
type CircuitID ¶
type CircuitID string
CircuitID is alias for circuit identifier
const ( // AuthCircuitID is a type that must be used for auth.circom AuthCircuitID CircuitID = "auth" // AuthCircuitID is a type that must be used for authV2.circom AuthV2CircuitID CircuitID = "authV2" // StateTransitionCircuitID is a type that must be used for stateTransition.circom StateTransitionCircuitID CircuitID = "stateTransition" // AtomicQueryMTPCircuitID is a type for credentialAtomicQueryMTP.circom AtomicQueryMTPCircuitID CircuitID = "credentialAtomicQueryMTP" // AtomicQueryMTPV2CircuitID is a type for credentialAtomicQueryMTPV2.circom AtomicQueryMTPV2CircuitID CircuitID = "credentialAtomicQueryMTPV2" // AtomicQueryV3CircuitID is a type for credentialAtomicQueryV3.circom AtomicQueryV3CircuitID CircuitID = "credentialAtomicQueryV3-beta.1" // AtomicQueryMTPV2OnChainCircuitID is a type for credentialAtomicQueryMTPV2OnChain.circom AtomicQueryMTPV2OnChainCircuitID CircuitID = "credentialAtomicQueryMTPV2OnChain" // AtomicQuerySigCircuitID is a type for credentialAttrQuerySig.circom AtomicQuerySigCircuitID CircuitID = "credentialAtomicQuerySig" // AtomicQuerySigV2CircuitID is a type for credentialAttrQuerySigV2.circom AtomicQuerySigV2CircuitID CircuitID = "credentialAtomicQuerySigV2" // AtomicQuerySigV2OnChainCircuitID is a type for credentialAttrQuerySigV2OnChain.circom AtomicQuerySigV2OnChainCircuitID CircuitID = "credentialAtomicQuerySigV2OnChain" // AtomicQueryV3OnChainCircuitID is a type for credentialAtomicQueryV3OnChain.circom AtomicQueryV3OnChainCircuitID CircuitID = "credentialAtomicQueryV3OnChain-beta.1" // JsonLDAtomicQueryMTPCircuitID is a type for credentialJsonLDAtomicQueryMTP.circom JsonLDAtomicQueryMTPCircuitID CircuitID = "credentialJsonLDAtomicQueryMTP" // SybilMTPCircuitID is a type for sybilMTP.circom SybilMTPCircuitID CircuitID = "sybilCredentialAtomicMTP" // SybilSigCircuitID is a type for sybilSig.circom SybilSigCircuitID CircuitID = "sybilCredentialAtomicSig" // LinkedMultiQuery10CircuitID is a type for linkedMultiQuery10.circom LinkedMultiQuery10CircuitID CircuitID = "linkedMultiQuery10-beta.1" )
type ClaimWithMTPProof ¶
type ClaimWithMTPProof struct { IssuerID *core.ID `json:"issuerId"` Claim *core.Claim `json:"claim"` IncProof MTProof `json:"incProof"` // proof of inclusion `Claim` to the issuer claims tree NonRevProof MTProof `json:"nonRevProof"` // proof of non revocation of the `Claim` in the issuer revocation tree }
type ClaimWithSigAndMTPProof ¶ added in v2.0.1
type ClaimWithSigAndMTPProof struct { IssuerID *core.ID `json:"issuerID"` Claim *core.Claim `json:"claim"` NonRevProof MTProof `json:"nonRevProof"` // Claim non revocation proof SignatureProof *BJJSignatureProof `json:"signatureProof"` IncProof *MTProof `json:"incProof"` // proof of inclusion `Claim` to the issuer claims tree }
type ClaimWithSigProof ¶
type Data ¶
type Data struct { Input InputsMarshaller // input values type Output PubSignals // output values type }
Data circuit type
type GISTProof ¶
type GISTProof struct { Root *merkletree.Hash `json:"root"` // GIST root Proof *merkletree.Proof `json:"proof"` // proof of inclusion or non inclusion of the identity to the GIST }
GISTProof global identity state tree proof represents the state of the global identities tree published on the blockchain
type InputsMarshaller ¶
InputsMarshaller interface implemented by types that can marshal circuit `input` structures
type KeyLoader ¶
KeyLoader interface, if key should be fetched from file system, CDN, IPFS etc, this interface may be implemented for key loading from a specific place
type LinkedMultiQueryInputs ¶ added in v2.1.0
type LinkedMultiQueryInputs struct { BaseConfig LinkNonce *big.Int Claim *core.Claim Query []*Query }
LinkedMultiQueryInputs type represent linkedMultiQuery10.circom inputs
func (LinkedMultiQueryInputs) InputsMarshal ¶ added in v2.1.0
func (l LinkedMultiQueryInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for linkedMultiQuery10.circom
func (LinkedMultiQueryInputs) Validate ¶ added in v2.2.0
func (l LinkedMultiQueryInputs) Validate() error
type LinkedMultiQueryPubSignals ¶ added in v2.1.0
type LinkedMultiQueryPubSignals struct { LinkID *big.Int `json:"linkID"` Merklized int `json:"merklized"` OperatorOutput []*big.Int `json:"operatorOutput"` CircuitQueryHash []*big.Int `json:"circuitQueryHash"` }
LinkedMultiQueryPubSignals linkedMultiQuery10.circom public signals
func (LinkedMultiQueryPubSignals) GetObjMap ¶ added in v2.1.0
func (l LinkedMultiQueryPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns LinkedMultiQueryPubSignals as a map
func (*LinkedMultiQueryPubSignals) PubSignalsUnmarshal ¶ added in v2.1.0
func (lo *LinkedMultiQueryPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal linkedMultiQuery10.circom public inputs to LinkedMultiQueryPubSignals
type MTProof ¶
type MTProof struct { Proof *merkletree.Proof `json:"proof"` // Proof of inclusion to the Merkle Tree TreeState TreeState `json:"treeState"` // Identity state }
type NodeAuxValue ¶
type NodeAuxValue struct {
// contains filtered or unexported fields
}
func GetNodeAuxValue ¶
func GetNodeAuxValue(p *merkletree.Proof) NodeAuxValue
type PubSignals ¶
type PubSignals interface { PubSignalsUnmarshaller PubSignalsMapper }
PubSignals interface implemented by types that can be registered in circuit registry
type PubSignalsMapper ¶
type PubSignalsMapper interface {
GetObjMap() map[string]interface{}
}
PubSignalsMapper interface implemented by types that can unmarshal circuit `output` to map
type PubSignalsUnmarshaller ¶
PubSignalsUnmarshaller interface implemented by types that can unmarshal circuit `output` structures
type Query ¶
type Query struct { Operator int Values []*big.Int SlotIndex int ValueProof *ValueProof }
Query represents basic request to claim field with MTP and without
func (Query) ValidateValueArraySize ¶ added in v2.1.0
Validate value size for operator
type Scalar ¶
type Scalar struct {
// contains filtered or unexported fields
}
Scalar uses for compare two scalar value.
type StateTransitionInputs ¶
type StateTransitionInputs struct { BaseConfig ID *core.ID OldTreeState TreeState NewTreeState TreeState IsOldStateGenesis bool AuthClaim *core.Claim `json:"claim"` AuthClaimIncMtp *merkletree.Proof `json:"authClaimIncMtp"` AuthClaimNonRevMtp *merkletree.Proof `json:"authClaimNonRevMtp"` AuthClaimNewStateIncMtp *merkletree.Proof `json:"authClaimNewStateIncMtp"` Signature *babyjub.Signature }
StateTransitionInputs ZK private inputs for stateTransition.circom
func (StateTransitionInputs) InputsMarshal ¶
func (c StateTransitionInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for stateTransition.circom
type StateTransitionPubSignals ¶
type StateTransitionPubSignals struct { UserID *core.ID `json:"userID"` OldUserState *merkletree.Hash `json:"oldUserState"` NewUserState *merkletree.Hash `json:"newUserState"` IsOldStateGenesis bool `json:"isOldStateGenesis"` }
StateTransitionPubSignals stateTransition.circom public inputs
func (StateTransitionPubSignals) GetObjMap ¶
func (s StateTransitionPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*StateTransitionPubSignals) PubSignalsUnmarshal ¶
func (s *StateTransitionPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal stateTransition.circom public signals
type SybilAtomicMTPInputs
deprecated
type SybilAtomicMTPInputs struct { BaseConfig ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int IssuerClaim ClaimWithMTPProof StateCommitmentClaim ClaimWithMTPProof GISTProof GISTProof CRS *big.Int RequestID *big.Int Timestamp int64 }
Deprecated: trusted setup is not done for that circuits. In future releases
new circuit with sybil support will be added.
func (SybilAtomicMTPInputs) InputsMarshal ¶
func (s SybilAtomicMTPInputs) InputsMarshal() ([]byte, error)
func (SybilAtomicMTPInputs) Validate ¶
func (s SybilAtomicMTPInputs) Validate() error
type SybilAtomicMTPPubSignals
deprecated
type SybilAtomicMTPPubSignals struct { BaseConfig SybilID *big.Int `json:"sybilID"` UserID *core.ID `json:"userID"` RequestID *big.Int `json:"requestID"` IssuerID *core.ID `json:"issuerID"` Timestamp int64 `json:"timestamp"` IssuerClaimIdenState *merkletree.Hash `json:"issuerClaimIdenState"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` ClaimSchema core.SchemaHash `json:"claimSchema"` CRS *big.Int `json:"crs"` GISTRoot *merkletree.Hash `json:"gistRoot"` }
Deprecated: trusted setup is not done for that circuits. In future releases
new circuit with sybil support will be added.
func (SybilAtomicMTPPubSignals) GetObjMap ¶
func (s SybilAtomicMTPPubSignals) GetObjMap() map[string]interface{}
func (*SybilAtomicMTPPubSignals) PubSignalsUnmarshal ¶
func (s *SybilAtomicMTPPubSignals) PubSignalsUnmarshal(data []byte) error
type SybilAtomicSigInputs
deprecated
type SybilAtomicSigInputs struct { BaseConfig ID *core.ID ProfileNonce *big.Int ClaimSubjectProfileNonce *big.Int IssuerClaim ClaimWithSigProof StateCommitmentClaim ClaimWithMTPProof GISTProof GISTProof CRS *big.Int RequestID *big.Int Timestamp int64 }
Deprecated: trusted setup is not done for that circuits. In future released
new circuit with sybil support will be added.
func (SybilAtomicSigInputs) InputsMarshal ¶
func (s SybilAtomicSigInputs) InputsMarshal() ([]byte, error)
func (SybilAtomicSigInputs) Validate ¶
func (s SybilAtomicSigInputs) Validate() error
type SybilAtomicSigPubSignals
deprecated
type SybilAtomicSigPubSignals struct { BaseConfig SybilID *big.Int `json:"sybilID"` UserID *core.ID `json:"userID"` RequestID *big.Int `json:"requestID"` IssuerID *core.ID `json:"issuerID"` Timestamp int64 `json:"timestamp"` IssuerClaimNonRevState *merkletree.Hash `json:"issuerClaimNonRevState"` ClaimSchema core.SchemaHash `json:"claimSchema"` CRS *big.Int `json:"crs"` GISTRoot *merkletree.Hash `json:"gistRoot"` IssuerAuthState *merkletree.Hash `json:"issuerAuthState"` }
Deprecated: trusted setup is not done for that circuits. In future released
new circuit with sybil support will be added.
func (SybilAtomicSigPubSignals) GetObjMap ¶
func (s SybilAtomicSigPubSignals) GetObjMap() map[string]interface{}
func (*SybilAtomicSigPubSignals) PubSignalsUnmarshal ¶
func (s *SybilAtomicSigPubSignals) PubSignalsUnmarshal(data []byte) error
type TreeState ¶
type TreeState struct { State *merkletree.Hash `json:"state"` // identity state ClaimsRoot *merkletree.Hash `json:"claimsRoot"` // claims tree root RevocationRoot *merkletree.Hash `json:"revocationRoot"` // revocation tree root RootOfRoots *merkletree.Hash `json:"rootOfRoots"` // root of roots tree root }
TreeState represents the identity state
type ValueProof ¶
ValueProof represents a Merkle Proof for a value stored as MT
Source Files
¶
- auth.go
- authV2.go
- authV2_json.go
- circuits.go
- credentialAtomicQueryMTP.go
- credentialAtomicQueryMTPV2.go
- credentialAtomicQueryMTPV2OnChain.go
- credentialAtomicQuerySig.go
- credentialAtomicQuerySigV2.go
- credentialAtomicQuerySigV2OnChain.go
- credentialAtomicQueryV3.go
- credentialAtomicQueryV3OnChain.go
- errors.go
- linkedMultiQuery.go
- query.go
- stateTransition.go
- sybilCredentialAtomicMTP.go
- sybilCredentialAtomicSig.go
- types.go
- utils.go