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 AuthInputs
- type AuthPubSignals
- type AuthV2Inputs
- type AuthV2PubSignals
- type BJJSignatureProof
- type BaseConfig
- type CircuitID
- type ClaimWithMTPProof
- type ClaimWithSigProof
- type Comparer
- type Data
- type GISTProof
- type InputsMarshaller
- type KeyLoader
- type MTProof
- type NodeAuxValue
- type PubSignals
- type PubSignalsMapper
- type PubSignalsUnmarshaller
- type Query
- type Scalar
- type StateTransitionInputs
- type StateTransitionPubSignals
- type SybilAtomicMTPInputs
- type SybilAtomicMTPPubSignals
- type SybilAtomicSigInputs
- type SybilAtomicSigPubSignals
- 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" )
const ( NOOP int = iota // No operation, skip query verification in circuit EQ LT GT IN NIN NE )
List of available operators.
const BatchSize = 5
BatchSize defined by poseidon hash implementation in Solidity
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, }
QueryOperators represents operators for atomic circuits
Functions ¶
func CircomSiblings ¶ added in v1.0.2
func CircomSiblings(proof *merkletree.Proof, levels int) []*merkletree.Hash
CircomSiblingsFromSiblings returns the full siblings compatible with circom
func HashToStr ¶ added in v0.0.34
func HashToStr(siblings []*merkletree.Hash) []string
func PoseidonHashValue ¶ added in v1.0.2
PoseidonHashValue returns the solidity and circom implementation of poseidon hash
func PrepareCircuitArrayValues ¶ added in v0.0.17
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 ¶ added in v0.0.34
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 ¶ added in v0.0.17
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
func (AtomicQueryMTPInputs) InputsMarshal ¶ added in v0.0.34
func (a AtomicQueryMTPInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryMTP.circom
type AtomicQueryMTPPubSignals ¶ added in v0.0.34
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
func (AtomicQueryMTPPubSignals) GetObjMap ¶ added in v0.0.34
func (ao AtomicQueryMTPPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryMTPPubSignals) PubSignalsUnmarshal ¶ added in v0.0.34
func (ao *AtomicQueryMTPPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryMTP.circom public signals array to AtomicQueryMTPPubSignals
type AtomicQueryMTPV2Inputs ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (a AtomicQueryMTPV2Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryMTP.circom
func (AtomicQueryMTPV2Inputs) Validate ¶ added in v1.0.2
func (a AtomicQueryMTPV2Inputs) Validate() error
Validate validates AtomicQueryMTPPubSignals
type AtomicQueryMTPV2OnChainInputs ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (a AtomicQueryMTPV2OnChainInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQueryMTP.circom
func (AtomicQueryMTPV2OnChainInputs) Validate ¶ added in v1.0.2
func (a AtomicQueryMTPV2OnChainInputs) Validate() error
Validate validates AtomicQueryMTPPubSignals
type AtomicQueryMTPV2OnChainPubSignals ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (ao AtomicQueryMTPV2OnChainPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryMTPV2OnChainPubSignals) PubSignalsUnmarshal ¶ added in v1.0.2
func (ao *AtomicQueryMTPV2OnChainPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryMTPV2OnChain.circom public signals array to AtomicQueryMTPPubSignals
type AtomicQueryMTPV2PubSignals ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (ao AtomicQueryMTPV2PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQueryMTPV2PubSignals) PubSignalsUnmarshal ¶ added in v1.0.2
func (ao *AtomicQueryMTPV2PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQueryMTP.circom public signals array to AtomicQueryMTPPubSignals
type AtomicQuerySigInputs ¶ added in v0.0.17
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
func (AtomicQuerySigInputs) InputsMarshal ¶ added in v0.0.34
func (a AtomicQuerySigInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQuerySig.circom
type AtomicQuerySigPubSignals ¶ added in v0.0.34
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"`
}
AtomicQuerySigV2PubSignals public inputs
func (AtomicQuerySigPubSignals) GetObjMap ¶ added in v0.0.34
func (ao AtomicQuerySigPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQuerySigPubSignals) PubSignalsUnmarshal ¶ added in v0.0.34
func (ao *AtomicQuerySigPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQuerySig.circom public signals
type AtomicQuerySigV2Inputs ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (a AtomicQuerySigV2Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQuerySig.circom
func (AtomicQuerySigV2Inputs) Validate ¶ added in v1.0.2
func (a AtomicQuerySigV2Inputs) Validate() error
type AtomicQuerySigV2OnChainInputs ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (a AtomicQuerySigV2OnChainInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for credentialAtomicQuerySig.circom
func (AtomicQuerySigV2OnChainInputs) Validate ¶ added in v1.0.2
func (a AtomicQuerySigV2OnChainInputs) Validate() error
type AtomicQuerySigV2OnChainPubSignals ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (ao AtomicQuerySigV2OnChainPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQuerySigV2OnChainPubSignals) PubSignalsUnmarshal ¶ added in v1.0.2
func (ao *AtomicQuerySigV2OnChainPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQuerySig.circom public signals
type AtomicQuerySigV2PubSignals ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (ao AtomicQuerySigV2PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*AtomicQuerySigV2PubSignals) PubSignalsUnmarshal ¶ added in v1.0.2
func (ao *AtomicQuerySigV2PubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal credentialAtomicQuerySig.circom public signals
type AuthInputs ¶ added in v0.0.12
type AuthInputs struct {
BaseConfig
ID *core.ID
AuthClaim ClaimWithMTPProof
Signature *babyjub.Signature
Challenge *big.Int
}
AuthInputs type represent auth.circom private inputs
func (AuthInputs) InputsMarshal ¶ added in v0.0.34
func (a AuthInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for auth.circom
type AuthPubSignals ¶ added in v0.0.34
type AuthPubSignals struct {
Challenge *big.Int `json:"challenge"`
UserState *merkletree.Hash `json:"userState"`
UserID *core.ID `json:"userID"`
}
AuthPubSignals auth.circom public signals
func (AuthPubSignals) GetObjMap ¶ added in v0.0.34
func (a AuthPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns AuthPubSignals as a map
func (*AuthPubSignals) PubSignalsUnmarshal ¶ added in v0.0.34
func (a *AuthPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal auth.circom public inputs to AuthPubSignals
type AuthV2Inputs ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (a AuthV2Inputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for auth.circom
func (AuthV2Inputs) MarshalJSON ¶ added in v1.0.2
func (a AuthV2Inputs) MarshalJSON() ([]byte, error)
func (*AuthV2Inputs) UnmarshalJSON ¶ added in v1.0.2
func (a *AuthV2Inputs) UnmarshalJSON(in []byte) error
func (AuthV2Inputs) Validate ¶ added in v1.0.2
func (a AuthV2Inputs) Validate() error
type AuthV2PubSignals ¶ added in v1.0.2
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 ¶ added in v1.0.2
func (a AuthV2PubSignals) GetObjMap() map[string]interface{}
GetObjMap returns AuthPubSignals as a map
func (*AuthV2PubSignals) PubSignalsUnmarshal ¶ added in v1.0.2
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 ¶ added in v0.0.34
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 ¶ added in v0.0.34
func (c BaseConfig) GetMTLevel() int
GetMTLevel max circuit MT levels
func (BaseConfig) GetMTLevelOnChain ¶ added in v0.0.43
func (c BaseConfig) GetMTLevelOnChain() int
GetMTLevel max circuit MT levels on chain
func (BaseConfig) GetMTLevelsClaim ¶ added in v1.0.2
func (c BaseConfig) GetMTLevelsClaim() int
GetMTLevelsClaim max jsonld Claim levels
func (BaseConfig) GetValueArrSize ¶ added in v0.0.34
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" // 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" // 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" )
type ClaimWithMTPProof ¶ added in v1.0.2
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 ClaimWithSigProof ¶ added in v1.0.2
type Data ¶ added in v0.0.34
type Data struct {
Input InputsMarshaller // input values type
Output PubSignals // output values type
}
Data circuit type
type GISTProof ¶ added in v1.0.2
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 ¶ added in v0.0.34
InputsMarshaller interface implemented by types that can marshal circuit `input` structures
type KeyLoader ¶ added in v0.0.34
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 MTProof ¶ added in v1.0.2
type MTProof struct {
Proof *merkletree.Proof `json:"proof"` // Proof of inclusion to the Merkle Tree
TreeState TreeState `json:"treeState"` // Identity state
}
type NodeAuxValue ¶ added in v1.0.2
type NodeAuxValue struct {
// contains filtered or unexported fields
}
func GetNodeAuxValue ¶ added in v1.0.2
func GetNodeAuxValue(p *merkletree.Proof) NodeAuxValue
type PubSignals ¶ added in v0.0.34
type PubSignals interface {
PubSignalsUnmarshaller
PubSignalsMapper
}
PubSignals interface implemented by types that can be registered in circuit registry
type PubSignalsMapper ¶ added in v0.0.34
type PubSignalsMapper interface {
GetObjMap() map[string]interface{}
}
PubSignalsMapper interface implemented by types that can unmarshal circuit `output` to map
type PubSignalsUnmarshaller ¶ added in v0.0.34
PubSignalsUnmarshaller interface implemented by types that can unmarshal circuit `output` structures
type Query ¶ added in v0.0.2
type Query struct {
Operator int
Values []*big.Int
SlotIndex int
ValueProof *ValueProof
}
Query represents basic request to claim field with MTP and without
type Scalar ¶ added in v0.0.29
type Scalar struct {
// contains filtered or unexported fields
}
Scalar uses for compare two scalar value.
type StateTransitionInputs ¶ added in v0.0.34
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 ¶ added in v0.0.34
func (c StateTransitionInputs) InputsMarshal() ([]byte, error)
InputsMarshal returns Circom private inputs for stateTransition.circom
type StateTransitionPubSignals ¶ added in v0.0.34
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 ¶ added in v0.0.34
func (s StateTransitionPubSignals) GetObjMap() map[string]interface{}
GetObjMap returns struct field as a map
func (*StateTransitionPubSignals) PubSignalsUnmarshal ¶ added in v0.0.34
func (s *StateTransitionPubSignals) PubSignalsUnmarshal(data []byte) error
PubSignalsUnmarshal unmarshal stateTransition.circom public signals
type SybilAtomicMTPInputs ¶ added in v1.0.2
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
}
func (SybilAtomicMTPInputs) InputsMarshal ¶ added in v1.0.2
func (s SybilAtomicMTPInputs) InputsMarshal() ([]byte, error)
func (SybilAtomicMTPInputs) Validate ¶ added in v1.0.2
func (s SybilAtomicMTPInputs) Validate() error
type SybilAtomicMTPPubSignals ¶ added in v1.0.2
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"`
}
func (SybilAtomicMTPPubSignals) GetObjMap ¶ added in v1.0.2
func (s SybilAtomicMTPPubSignals) GetObjMap() map[string]interface{}
func (*SybilAtomicMTPPubSignals) PubSignalsUnmarshal ¶ added in v1.0.2
func (s *SybilAtomicMTPPubSignals) PubSignalsUnmarshal(data []byte) error
type SybilAtomicSigInputs ¶ added in v1.0.2
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
}
func (SybilAtomicSigInputs) InputsMarshal ¶ added in v1.0.2
func (s SybilAtomicSigInputs) InputsMarshal() ([]byte, error)
func (SybilAtomicSigInputs) Validate ¶ added in v1.0.2
func (s SybilAtomicSigInputs) Validate() error
type SybilAtomicSigPubSignals ¶ added in v1.0.2
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"`
}
func (SybilAtomicSigPubSignals) GetObjMap ¶ added in v1.0.2
func (s SybilAtomicSigPubSignals) GetObjMap() map[string]interface{}
func (*SybilAtomicSigPubSignals) PubSignalsUnmarshal ¶ added in v1.0.2
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 ¶ added in v1.0.2
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
- errors.go
- query.go
- stateTransition.go
- sybilCredentialAtomicMTP.go
- sybilCredentialAtomicSig.go
- types.go
- utils.go