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 AuthV3Inputs
- type AuthV3PubSignals
- type BJJSignatureProof
- type BaseConfig
- type CircuitID
- type CircuitSubversion
- type CircuitValidatorItem
- type ClaimWithMTPProof
- type ClaimWithSigAndMTPProof
- type ClaimWithSigProof
- type Comparer
- type Data
- type GISTProof
- type Gist
- type InputsMarshaller
- type KeyLoader
- type LevelKey
- type LinkedMultiQueryInputs
- type LinkedMultiQueryPubSignals
- type MTProof
- type MinCircuitInput
- type NodeAuxValue
- type ProofType
- type PubSignals
- type PubSignalsMapper
- type PubSignalsUnmarshaller
- type PublicStatesInfoProvider
- type Query
- type Scalar
- type State
- type StateTransitionInputs
- type StateTransitionPubSignals
- type StatesInfo
- type StatesInfoProvider
- type SybilAtomicMTPInputsdeprecated
- type SybilAtomicMTPPubSignalsdeprecated
- type SybilAtomicSigInputsdeprecated
- type SybilAtomicSigPubSignalsdeprecated
- type TreeState
- type TreesToCheck
- type Validation
- 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" ErrorEmptyStateHash = "empty state hash" ErrorUserProfileMismatch = "profile DID derived from genesis does not match the credential subject or incorrect profile nonce" ErrorNoCircuitsValidatorEntry = "no circuits validator entry found for the given circuit ID" ErrorInputsTypeNotSupported = "inputs type not supported for circuit selection" ErrorInputsTooLarge = "inputs require larger circuit configuration" )
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
LinkedMultiQueryLength constant for linkedMultiQuery.circom
Variables ¶
var AllOperations = func() []int { ops := make([]int, 0, len(QueryOperators)) for _, v := range QueryOperators { ops = append(ops, v) } return ops }()
AllOperations is a list of all available query operators.
var CircuitValidator = map[CircuitID]CircuitValidatorItem{ AtomicQueryMTPV2CircuitID: credentialAtomicQueryV2Validation, AtomicQueryMTPV2OnChainCircuitID: credentialAtomicQueryV2OnChainValidation, AtomicQuerySigV2CircuitID: credentialAtomicQueryV2Validation, AtomicQuerySigV2OnChainCircuitID: credentialAtomicQueryV2OnChainValidation, AtomicQueryV3CircuitID: credentialAtomicQueryV3Validation, AtomicQueryV3OnChainCircuitID: credentialAtomicQueryV3Validation, AuthV2CircuitID: noQueriesValidation, AuthV3CircuitID: noQueriesValidation, AuthV3_8_32CircuitID: noQueriesValidation, StateTransitionCircuitID: noQueriesValidation, LinkedMultiQuery10CircuitID: { Validation: Validation{ MaxQueriesCount: 10, SupportedOperations: AllOperations, }, }, AtomicQueryV3StableCircuitID: { Validation: credentialAtomicQueryV3Validation.Validation, SubVersions: []CircuitSubversion{ { MTLevel: intPtr(16), MTLevelClaim: intPtr(16), TargetCircuitId: CircuitID(string(AtomicQueryV3StableCircuitID) + "-16-16-64"), }, }, }, AtomicQueryV3OnChainStableCircuitID: { Validation: credentialAtomicQueryV3Validation.Validation, SubVersions: []CircuitSubversion{ { MTLevel: intPtr(16), MTLevelClaim: intPtr(16), MTLevelOnChain: intPtr(32), TargetCircuitId: CircuitID(string(AtomicQueryV3OnChainStableCircuitID) + "-16-16-64-16-32"), }, }, }, LinkedMultiQueryStableCircuitID: { Validation: Validation{ MaxQueriesCount: 10, SupportedOperations: AllOperations, }, SubVersions: []CircuitSubversion{ { QueryCount: intPtr(3), TargetCircuitId: CircuitID(LinkedMultiQueryStableCircuitID + "3"), }, { QueryCount: intPtr(5), TargetCircuitId: CircuitID(LinkedMultiQueryStableCircuitID + "5"), }, }, }, }
CircuitValidator map contains validation rules for each circuit ID.
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
V2OnChainOperations is a list of all available on-chain query operators in V2.
V2Operations is a list of all available query operators in V2.
Functions ¶
func CircomSiblings ¶
func CircomSiblings(proof *merkletree.Proof, levels int) []*merkletree.Hash
CircomSiblings returns the full siblings compatible with circom
func HashToStr ¶
func HashToStr(siblings []*merkletree.Hash) []string
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 ¶
func PrepareSiblings(siblings []*merkletree.Hash, levels int) []*big.Int
PrepareSiblings prepare siblings for zk zk
func PrepareSiblingsStr ¶
func PrepareSiblingsStr(siblings []*merkletree.Hash, levels int) []string
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) GetPublicStatesInfo ¶ added in v2.4.1
func (a AtomicQueryMTPV2Inputs) GetPublicStatesInfo() (StatesInfo, error)
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) GetPublicStatesInfo ¶ added in v2.4.1
func (a AtomicQueryMTPV2OnChainInputs) GetPublicStatesInfo() (StatesInfo, error)
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) GetStatesInfo ¶ added in v2.4.1
func (ao AtomicQueryMTPV2OnChainPubSignals) GetStatesInfo() (StatesInfo, error)
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
}
AtomicQueryMTPV2PubSignals public signals
func (AtomicQueryMTPV2PubSignals) GetObjMap ¶
func (ao AtomicQueryMTPV2PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (AtomicQueryMTPV2PubSignals) GetStatesInfo ¶ added in v2.4.1
func (ao AtomicQueryMTPV2PubSignals) GetStatesInfo() (StatesInfo, error)
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) GetPublicStatesInfo ¶ added in v2.4.1
func (a AtomicQuerySigV2Inputs) GetPublicStatesInfo() (StatesInfo, error)
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) GetPublicStatesInfo ¶ added in v2.4.1
func (a AtomicQuerySigV2OnChainInputs) GetPublicStatesInfo() (StatesInfo, error)
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) GetStatesInfo ¶ added in v2.4.1
func (ao AtomicQuerySigV2OnChainPubSignals) GetStatesInfo() (StatesInfo, error)
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) GetStatesInfo ¶ added in v2.4.1
func (ao AtomicQuerySigV2PubSignals) GetStatesInfo() (StatesInfo, error)
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) GetPublicStatesInfo ¶ added in v2.4.1
func (a AtomicQueryV3Inputs) GetPublicStatesInfo() (StatesInfo, error)
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) GetPublicStatesInfo ¶ added in v2.4.1
func (a AtomicQueryV3OnChainInputs) GetPublicStatesInfo() (StatesInfo, error)
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) GetStatesInfo ¶ added in v2.4.1
func (ao AtomicQueryV3OnChainPubSignals) GetStatesInfo() (StatesInfo, error)
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) GetStatesInfo ¶ added in v2.4.1
func (ao AtomicQueryV3PubSignals) GetStatesInfo() (StatesInfo, error)
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) GetPublicStatesInfo ¶ added in v2.4.1
func (a AuthV2Inputs) GetPublicStatesInfo() (StatesInfo, error)
GetPublicStatesInfo returns states and gists information, implements PublicStatesInfoProvider interface
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) GetStatesInfo ¶ added in v2.4.1
func (a AuthV2PubSignals) GetStatesInfo() (StatesInfo, error)
func (*AuthV2PubSignals) PubSignalsUnmarshal ¶
func (a *AuthV2PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal auth.circom public inputs to AuthPubSignals
type AuthV3Inputs ¶ added in v2.4.2
type AuthV3Inputs struct {
BaseConfig `json:"-"`
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"`
}
AuthV3Inputs type represent authV3.circom/authV3-8-32.circom inputs
func (AuthV3Inputs) GetPublicStatesInfo ¶ added in v2.4.2
func (a AuthV3Inputs) GetPublicStatesInfo() (StatesInfo, error)
GetPublicStatesInfo returns states and gists information, implements PublicStatesInfoProvider interface
func (AuthV3Inputs) InputsMarshal ¶ added in v2.4.2
func (a AuthV3Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for auth.circom
func (AuthV3Inputs) MarshalJSON ¶ added in v2.5.0
func (a AuthV3Inputs) MarshalJSON() ([]byte, error)
func (*AuthV3Inputs) UnmarshalJSON ¶ added in v2.5.0
func (a *AuthV3Inputs) UnmarshalJSON(bytes []byte) error
func (AuthV3Inputs) Validate ¶ added in v2.4.2
func (a AuthV3Inputs) Validate() error
type AuthV3PubSignals ¶ added in v2.4.2
type AuthV3PubSignals struct {
UserID *core.ID `json:"userID"`
Challenge *big.Int `json:"challenge"`
GISTRoot *merkletree.Hash `json:"GISTRoot"`
}
AuthV3PubSignals authV3.circom/authV3-8-32.circom public signals
func (AuthV3PubSignals) GetObjMap ¶ added in v2.4.2
func (a AuthV3PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns AuthPubSignals as a map
func (AuthV3PubSignals) GetStatesInfo ¶ added in v2.4.2
func (a AuthV3PubSignals) GetStatesInfo() (StatesInfo, error)
func (*AuthV3PubSignals) PubSignalsUnmarshal ¶ added in v2.4.2
func (a *AuthV3PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal authV3.circom/authV3-8-32.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
GetMTLevelOnChain 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" // AuthV2CircuitID is a type that must be used for authV2.circom AuthV2CircuitID CircuitID = "authV2" // AuthV3CircuitID is a type that must be used for authV3.circom AuthV3CircuitID CircuitID = "authV3" // AuthV3_8_32CircuitID is a type that must be used for authV3-8-32.circom AuthV3_8_32CircuitID CircuitID = "authV3-8-32" // 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" // AtomicQueryV3StableCircuitID is a type for credentialAtomicQueryV3.circom stable version AtomicQueryV3StableCircuitID CircuitID = "credentialAtomicQueryV3" // AtomicQueryV3OnChainStableCircuitID is a type for credentialAtomicQueryV3OnChain.circom stable version AtomicQueryV3OnChainStableCircuitID CircuitID = "credentialAtomicQueryV3OnChain" // LinkedMultiQueryStableCircuitID is a type for linkedMultiQuery.circom stable version LinkedMultiQueryStableCircuitID CircuitID = "linkedMultiQuery" )
func AdjustInputsForMinCircuit ¶ added in v2.5.1
func AdjustInputsForMinCircuit[T MinCircuitInput](input T) (CircuitID, error)
AdjustInputsForMinCircuit inspects the provided circuit inputs, selects the smallest circuit variant that can accommodate them, and modifies the input's configuration in place.
func GetCircuitIdsWithSubVersions ¶ added in v2.5.0
GetCircuitIdsWithSubVersions returns all circuit IDs including their sub-versions for a given filter.
func GetGroupedCircuitIdsWithSubVersions ¶ added in v2.5.0
GetGroupedCircuitIdsWithSubVersions returns all circuit IDs grouped with their sub-versions for a given filter ID.
type CircuitSubversion ¶ added in v2.5.0
type CircuitSubversion struct {
MTLevel *int
MTLevelClaim *int
MTLevelOnChain *int
QueryCount *int
TargetCircuitId CircuitID
}
CircuitSubversion struct represents differences in circuit versions.
func SelectLinkedMultiQueryCircuit ¶ added in v2.5.0
func SelectLinkedMultiQueryCircuit( circuitID CircuitID, queriesCount int, ) (*CircuitSubversion, error)
SelectLinkedMultiQueryCircuit selects the appropriate CircuitSubversion for linked multi-query circuits.
func SelectV3TargetCircuit ¶ added in v2.5.0
func SelectV3TargetCircuit( circuitID CircuitID, treesToCheck []TreesToCheck, isOnChain bool, ) *CircuitSubversion
SelectV3TargetCircuit selects the appropriate CircuitSubversion for V3 circuits.
type CircuitValidatorItem ¶ added in v2.5.0
type CircuitValidatorItem struct {
Validation Validation
SubVersions []CircuitSubversion
}
CircuitValidatorItem struct represents a circuit validation item with its subversions.
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 Gist ¶ added in v2.4.1
type Gist struct {
ID core.ID `json:"id"`
Root merkletree.Hash `json:"root"`
}
Gist information
func (Gist) MarshalJSON ¶ added in v2.4.1
func (*Gist) UnmarshalJSON ¶ added in v2.4.1
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 LevelKey ¶ added in v2.5.0
type LevelKey int
LevelKey tells which depth field of CircuitSubversion to use.
func (LevelKey) Get ¶ added in v2.5.0
func (k LevelKey) Get(sv CircuitSubversion) *int
Get retrieves the corresponding level depth from CircuitSubversion.
type LinkedMultiQueryInputs ¶ added in v2.1.0
type LinkedMultiQueryInputs struct {
BaseConfig
QueryLength int
LinkNonce *big.Int
Claim *core.Claim
Query []*Query
}
LinkedMultiQueryInputs type represent linkedMultiQuery.circom inputs
func (LinkedMultiQueryInputs) InputsMarshal ¶ added in v2.1.0
func (l LinkedMultiQueryInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for linkedMultiQuery.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"`
QueryLength int
}
LinkedMultiQueryPubSignals linkedMultiQuery.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 linkedMultiQuery.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 MinCircuitInput ¶ added in v2.5.1
type MinCircuitInput interface {
*AtomicQueryV3Inputs | *AtomicQueryV3OnChainInputs | *AuthV3Inputs
}
MinCircuitInput is a type constraint for inputs that support minimal circuit selection.
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 PublicStatesInfoProvider ¶ added in v2.4.1
type PublicStatesInfoProvider interface {
GetPublicStatesInfo() (StatesInfo, error)
}
PublicStatesInfoProvider interface should be implemented by Inputs types that can return public states info
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 State ¶ added in v2.4.1
type State struct {
ID core.ID `json:"id"`
State merkletree.Hash `json:"state"`
}
State information
func (State) MarshalJSON ¶ added in v2.4.1
func (*State) UnmarshalJSON ¶ added in v2.4.1
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 StatesInfo ¶ added in v2.4.1
StatesInfo struct. A collection of states and gists
type StatesInfoProvider ¶ added in v2.4.1
type StatesInfoProvider interface {
GetStatesInfo() (StatesInfo, error)
}
StatesInfoProvider interface should be implemented by PubSignals types that can return states info
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 TreesToCheck ¶ added in v2.5.0
type TreesToCheck struct {
Proof *merkletree.Proof
LevelKey LevelKey
}
TreesToCheck holds a Merkle proof and the corresponding level key to check against.
type Validation ¶ added in v2.5.0
Validation struct contains parameters for query validation.
type ValueProof ¶
ValueProof represents a Merkle Proof for a value stored as MT
Source Files
¶
- auth.go
- authV2.go
- authV2_json.go
- authV3.go
- circuits.go
- config_presets.go
- credentialAtomicQueryMTP.go
- credentialAtomicQueryMTPV2.go
- credentialAtomicQueryMTPV2OnChain.go
- credentialAtomicQuerySig.go
- credentialAtomicQuerySigV2.go
- credentialAtomicQuerySigV2OnChain.go
- credentialAtomicQueryV3.go
- credentialAtomicQueryV3OnChain.go
- errors.go
- linkedMultiQuery.go
- min_circuit.go
- query.go
- selector.go
- stateTransition.go
- sybilCredentialAtomicMTP.go
- sybilCredentialAtomicSig.go
- types.go
- utils.go
- validator.go