From 4d9351b582bcdd62f0327cbc5293ee7a85db7f05 Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Mon, 20 Nov 2023 13:27:04 -0500 Subject: [PATCH 1/6] New function AtomicQueryV3InputsFromJson --- go.mod | 2 +- go.sum | 4 +- inputs_sig.go | 163 ++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 162 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 4536515..3e78433 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ethereum/go-ethereum v1.12.0 github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0 github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4 - github.com/iden3/go-circuits/v2 v2.0.0 + github.com/iden3/go-circuits/v2 v2.0.1-0.20231120131017-dffd68ac9fba github.com/iden3/go-iden3-core/v2 v2.0.0 github.com/iden3/go-iden3-crypto v0.0.15 github.com/iden3/go-merkletree-sql/v2 v2.0.6 diff --git a/go.sum b/go.sum index e147185..90f2e7c 100644 --- a/go.sum +++ b/go.sum @@ -80,8 +80,8 @@ github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0- github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0/go.mod h1:8fkd2xyUG/V7ovpvZRyD2LyK2zZ4ALbgf5vJGyhzKdg= github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4 h1:iPvYa/AhhGo3juoUFDm/fBE2CZKy4WfQu7JY90tRf9Q= github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4/go.mod h1:TxgIrXCvxms3sbOdsy8kTvffUCIpEEifNy0fSXdkU4w= -github.com/iden3/go-circuits/v2 v2.0.0 h1:Bw0mpsqeip06d6I2ktgfhTVB7Jk9mSHi8myHZWkoc6w= -github.com/iden3/go-circuits/v2 v2.0.0/go.mod h1:VIFIp51+IH0hOzjnKhb84bCeyq7hq76zX/C14ua6zh4= +github.com/iden3/go-circuits/v2 v2.0.1-0.20231120131017-dffd68ac9fba h1:e18WqLZU8jYePK9igHxFRI6NcPNXZhZqHN3VzA5qNEY= +github.com/iden3/go-circuits/v2 v2.0.1-0.20231120131017-dffd68ac9fba/go.mod h1:VIFIp51+IH0hOzjnKhb84bCeyq7hq76zX/C14ua6zh4= github.com/iden3/go-iden3-core/v2 v2.0.0 h1:sQEuuq3RLfyYSY8qPiqxQ6YBpGbiAwepHJD/vjf1adA= github.com/iden3/go-iden3-core/v2 v2.0.0/go.mod h1:L9PxhWPvoS9qTb3inEkZBm1RpjHBt+VTwvxssdzbAdw= github.com/iden3/go-iden3-crypto v0.0.15 h1:4MJYlrot1l31Fzlo2sF56u7EVFeHHJkxGXXZCtESgK4= diff --git a/inputs_sig.go b/inputs_sig.go index 34d55a2..9cf3d5b 100644 --- a/inputs_sig.go +++ b/inputs_sig.go @@ -192,6 +192,12 @@ func resolveRevocationStatusFromIssuerService(ctx context.Context, return out, nil } +type errProofNotFound verifiable.ProofType + +func (e errProofNotFound) Error() string { + return fmt.Sprintf("proof not found: %v", string(e)) +} + func claimWithSigProofFromObj(ctx context.Context, cfg EnvConfig, w3cCred verifiable.W3CCredential, skipClaimRevocationCheck bool) (circuits.ClaimWithSigProof, error) { @@ -200,8 +206,7 @@ func claimWithSigProofFromObj(ctx context.Context, cfg EnvConfig, proofI := findProofByType(w3cCred, verifiable.BJJSignatureProofType) if proofI == nil { - return out, fmt.Errorf("no %v proofs found", - verifiable.BJJSignatureProofType) + return out, errProofNotFound(verifiable.BJJSignatureProofType) } var err error @@ -759,6 +764,95 @@ func AtomicQuerySigV2OnChainInputsFromJson(ctx context.Context, cfg EnvConfig, return out, nil } +func AtomicQueryV3InputsFromJson(ctx context.Context, cfg EnvConfig, + in []byte) (AtomicQueryInputsResponse, error) { + + var out AtomicQueryInputsResponse + var inpMarsh circuits.AtomicQueryV3Inputs + + var obj inputsRequest + err := json.Unmarshal(in, &obj) + if err != nil { + return out, err + } + + inpMarsh.RequestID, err = bigIntByPath(obj.Request, "id", true) + if err != nil { + return out, err + } + inpMarsh.ID = &obj.ID + inpMarsh.ProfileNonce = obj.ProfileNonce.BigInt() + inpMarsh.ClaimSubjectProfileNonce = obj.ClaimSubjectProfileNonce.BigInt() + + circuitID, err := stringByPath(obj.Request, "circuitId") + if err != nil { + return out, err + } + if circuitID != string(circuits.AtomicQueryV3CircuitID) { + return out, errors.New("wrong circuit") + } + var w3cCred verifiable.W3CCredential + err = json.Unmarshal(obj.VerifiableCredentials, &w3cCred) + if err != nil { + return out, err + } + + inpMarsh.SkipClaimRevocationCheck, err = querySkipRevocation(obj.Request) + if err != nil { + return out, err + } + + reqProofType, err := queryProofType(obj.Request) + if err != nil { + return out, err + } + + inpMarsh.Claim, inpMarsh.ProofType, err = claimWithSigAndMtpProofFromObj( + ctx, cfg, w3cCred, inpMarsh.SkipClaimRevocationCheck, reqProofType) + if err != nil { + return out, err + } + + inpMarsh.Query, out.VerifiablePresentation, err = queryFromObj(ctx, w3cCred, + obj.Request, inpMarsh.Claim.Claim, cfg.documentLoader()) + if err != nil { + return out, err + } + + inpMarsh.CurrentTimeStamp = time.Now().Unix() + + // TODO: what to do with LinkNonce, VerifierID, VerifierSessionID + + out.Inputs = inpMarsh + + return out, nil +} + +// return empty circuits.ProofType if not found +func queryProofType(requestObj jsonObj) (circuits.ProofType, error) { + result, err := getByPath(requestObj, "query.proofType") + if errors.As(err, &errPathNotFound{}) { + return "", nil + } + if err != nil { + return "", err + } + + resS, ok := result.(string) + if !ok { + return "", errors.New("value of proofType is not string") + } + + switch circuits.ProofType(resS) { + case circuits.MTPProofType: + return circuits.MTPProofType, nil + case circuits.SigProotType: + return circuits.SigProotType, nil + } + return "", fmt.Errorf("unknown proofType: %v", resS) + +} + func buildQueryPath(ctx context.Context, contextURL string, contextType string, field string, documentLoader ld.DocumentLoader) (path merklize.Path, err error) { @@ -1145,8 +1239,7 @@ func claimWithMtpProofFromObj(ctx context.Context, cfg EnvConfig, } else if proofI = findProofByType(w3cCred, verifiable.ProofType(verifiable.Iden3OnchainSparseMerkleTreeProof2023)); proofI != nil { } else { - return out, fmt.Errorf("no %v proofs found", - verifiable.Iden3SparseMerkleTreeProofType) + return out, errProofNotFound(verifiable.Iden3SparseMerkleTreeProofType) } issuerID, err := core.IDFromDID(*issuerDID) @@ -1174,6 +1267,68 @@ func claimWithMtpProofFromObj(ctx context.Context, cfg EnvConfig, return out, nil } +func v3ProofFromMTP( + p circuits.ClaimWithMTPProof) circuits.ClaimWithSigAndMTPProof { + return circuits.ClaimWithSigAndMTPProof{ + IssuerID: p.IssuerID, + Claim: p.Claim, + NonRevProof: p.NonRevProof, + IncProof: &p.IncProof, + } +} + +func v3ProofFromSig(p circuits.ClaimWithSigProof) circuits.ClaimWithSigAndMTPProof { + return circuits.ClaimWithSigAndMTPProof{ + IssuerID: p.IssuerID, + Claim: p.Claim, + NonRevProof: p.NonRevProof, + SignatureProof: &p.SignatureProof, + } + +} + +func claimWithSigAndMtpProofFromObj(ctx context.Context, cfg EnvConfig, + w3cCred verifiable.W3CCredential, skipClaimRevocationCheck bool, + proofType circuits.ProofType) (circuits.ClaimWithSigAndMTPProof, circuits.ProofType, error) { + + switch proofType { + case circuits.MTPProofType: + claimWithMtpProof, err := claimWithMtpProofFromObj(ctx, cfg, w3cCred, + skipClaimRevocationCheck) + if err != nil { + return circuits.ClaimWithSigAndMTPProof{}, proofType, err + } + return v3ProofFromMTP(claimWithMtpProof), proofType, nil + case circuits.SigProotType: + claimWithSigProof, err := claimWithSigProofFromObj(ctx, cfg, w3cCred, + skipClaimRevocationCheck) + if err != nil { + return circuits.ClaimWithSigAndMTPProof{}, proofType, err + } + return v3ProofFromSig(claimWithSigProof), proofType, nil + case "": + claimWithMtpProof, err := claimWithMtpProofFromObj(ctx, cfg, w3cCred, + skipClaimRevocationCheck) + var tErr errProofNotFound + switch { + case errors.As(err, &tErr): + claimWithSigProof, err := claimWithSigProofFromObj(ctx, cfg, + w3cCred, skipClaimRevocationCheck) + if err != nil { + return circuits.ClaimWithSigAndMTPProof{}, proofType, err + } + return v3ProofFromSig(claimWithSigProof), circuits.SigProotType, nil + case err != nil: + return circuits.ClaimWithSigAndMTPProof{}, proofType, err + } + + return v3ProofFromMTP(claimWithMtpProof), circuits.MTPProofType, nil + default: + return circuits.ClaimWithSigAndMTPProof{}, proofType, + fmt.Errorf("unknown proofType: %v", proofType) + } +} + func circuitsTreeStateFromSchemaState( state verifiable.State) (ts circuits.TreeState, err error) { From 9702706e827011a6c631577e41e8590f7e76d6ca Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Mon, 20 Nov 2023 13:38:46 -0500 Subject: [PATCH 2/6] New function AtomicQueryV3OnChainInputsFromJson --- inputs_sig.go | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/inputs_sig.go b/inputs_sig.go index 9cf3d5b..36f6415 100644 --- a/inputs_sig.go +++ b/inputs_sig.go @@ -764,6 +764,90 @@ func AtomicQuerySigV2OnChainInputsFromJson(ctx context.Context, cfg EnvConfig, return out, nil } +func AtomicQueryV3OnChainInputsFromJson(ctx context.Context, cfg EnvConfig, + in []byte) (AtomicQueryInputsResponse, error) { + + var out AtomicQueryInputsResponse + var inpMarsh circuits.AtomicQueryV3OnChainInputs + + var obj onChainInputsRequest + err := json.Unmarshal(in, &obj) + if err != nil { + return out, err + } + + inpMarsh.RequestID, err = bigIntByPath(obj.Request, "id", true) + if err != nil { + return out, err + } + + if obj.ID == nil { + return out, errors.New(`"id" field is required`) + } + + inpMarsh.ID = obj.ID + inpMarsh.ProfileNonce = obj.ProfileNonce.BigInt() + inpMarsh.ClaimSubjectProfileNonce = obj.ClaimSubjectProfileNonce.BigInt() + + inpMarsh.AuthClaim = obj.AuthClaim + inpMarsh.AuthClaimIncMtp = obj.AuthClaimIncMtp + inpMarsh.AuthClaimNonRevMtp = obj.AuthClaimNonRevMtp + + if obj.TreeState == nil { + return out, errors.New("treeState is required") + } + inpMarsh.TreeState = *obj.TreeState + + if obj.GistProof == nil { + return out, errors.New("gistProof is required") + } + inpMarsh.GISTProof = *obj.GistProof + + inpMarsh.Signature = (*babyjub.Signature)(obj.Signature) + inpMarsh.Challenge = obj.Challenge.BigInt() + + circuitID, err := stringByPath(obj.Request, "circuitId") + if err != nil { + return out, err + } + if circuitID != string(circuits.AtomicQueryV3OnChainCircuitID) { + return out, errors.New("wrong circuit") + } + var w3cCred verifiable.W3CCredential + err = json.Unmarshal(obj.VerifiableCredentials, &w3cCred) + if err != nil { + return out, err + } + + inpMarsh.SkipClaimRevocationCheck, err = querySkipRevocation(obj.Request) + if err != nil { + return out, err + } + + reqProofType, err := queryProofType(obj.Request) + if err != nil { + return out, err + } + + inpMarsh.Claim, inpMarsh.ProofType, err = claimWithSigAndMtpProofFromObj( + ctx, cfg, w3cCred, inpMarsh.SkipClaimRevocationCheck, reqProofType) + if err != nil { + return out, err + } + + inpMarsh.Query, out.VerifiablePresentation, err = queryFromObj(ctx, w3cCred, + obj.Request, inpMarsh.Claim.Claim, cfg.documentLoader()) + if err != nil { + return out, err + } + + inpMarsh.CurrentTimeStamp = time.Now().Unix() + + out.Inputs = inpMarsh + + return out, nil +} + func AtomicQueryV3InputsFromJson(ctx context.Context, cfg EnvConfig, in []byte) (AtomicQueryInputsResponse, error) { From 5a0b84616802bb2a32ce17f1935727310865163c Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Tue, 21 Nov 2023 03:51:02 -0500 Subject: [PATCH 3/6] Expose v3 circuits function to C header file, add tests, update go-circuits to latest head. --- cmd/polygonid/polygonid.go | 22 +++++ go.mod | 2 +- go.sum | 4 +- inputs_sig.go | 18 ++-- inputs_sig_test.go | 54 ++++++++++ testdata/atomic_query_v3_mtp_inputs.json | 99 +++++++++++++++++++ testdata/atomic_query_v3_mtp_output.json | 1 + ...ery_v3_no_proof_type_both_have_inputs.json | 98 ++++++++++++++++++ ...uery_v3_no_proof_type_sig_only_inputs.json | 73 ++++++++++++++ testdata/atomic_query_v3_sig_inputs.json | 99 +++++++++++++++++++ testdata/atomic_query_v3_sig_output.json | 1 + 11 files changed, 460 insertions(+), 11 deletions(-) create mode 100644 testdata/atomic_query_v3_mtp_inputs.json create mode 100644 testdata/atomic_query_v3_mtp_output.json create mode 100644 testdata/atomic_query_v3_no_proof_type_both_have_inputs.json create mode 100644 testdata/atomic_query_v3_no_proof_type_sig_only_inputs.json create mode 100644 testdata/atomic_query_v3_sig_inputs.json create mode 100644 testdata/atomic_query_v3_sig_output.json diff --git a/cmd/polygonid/polygonid.go b/cmd/polygonid/polygonid.go index e5d98b8..aa68957 100644 --- a/cmd/polygonid/polygonid.go +++ b/cmd/polygonid/polygonid.go @@ -737,6 +737,28 @@ func PLGNAtomicQueryMtpV2OnChainInputs(jsonResponse **C.char, in *C.char, jsonResponse, in, cfg, status) } +// PLGNAtomicQueryV3Inputs returns the inputs for the credentialAtomicQueryV3 +// circuit with optional selective disclosure. +// +//export PLGNAtomicQueryV3OInputs +func PLGNAtomicQueryV3Inputs(jsonResponse **C.char, in *C.char, + cfg *C.char, status **C.PLGNStatus) bool { + + return prepareInputs(c_polygonid.AtomicQueryV3InputsFromJson, jsonResponse, + in, cfg, status) +} + +// PLGNAtomicQueryV3OnChainInputs returns the inputs for the +// credentialAtomicQueryV3OnChain circuit with optional selective disclosure. +// +//export PLGNAtomicQueryV3OnChainInputs +func PLGNAtomicQueryV3OnChainInputs(jsonResponse **C.char, in *C.char, + cfg *C.char, status **C.PLGNStatus) bool { + + return prepareInputs(c_polygonid.AtomicQueryV3OnChainInputsFromJson, + jsonResponse, in, cfg, status) +} + //export PLGNFreeStatus func PLGNFreeStatus(status *C.PLGNStatus) { if status == nil { diff --git a/go.mod b/go.mod index 3e78433..c115404 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ethereum/go-ethereum v1.12.0 github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0 github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4 - github.com/iden3/go-circuits/v2 v2.0.1-0.20231120131017-dffd68ac9fba + github.com/iden3/go-circuits/v2 v2.0.1-0.20231121082343-9d0c77664cd9 github.com/iden3/go-iden3-core/v2 v2.0.0 github.com/iden3/go-iden3-crypto v0.0.15 github.com/iden3/go-merkletree-sql/v2 v2.0.6 diff --git a/go.sum b/go.sum index 90f2e7c..74ecf06 100644 --- a/go.sum +++ b/go.sum @@ -80,8 +80,8 @@ github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0- github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0/go.mod h1:8fkd2xyUG/V7ovpvZRyD2LyK2zZ4ALbgf5vJGyhzKdg= github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4 h1:iPvYa/AhhGo3juoUFDm/fBE2CZKy4WfQu7JY90tRf9Q= github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4/go.mod h1:TxgIrXCvxms3sbOdsy8kTvffUCIpEEifNy0fSXdkU4w= -github.com/iden3/go-circuits/v2 v2.0.1-0.20231120131017-dffd68ac9fba h1:e18WqLZU8jYePK9igHxFRI6NcPNXZhZqHN3VzA5qNEY= -github.com/iden3/go-circuits/v2 v2.0.1-0.20231120131017-dffd68ac9fba/go.mod h1:VIFIp51+IH0hOzjnKhb84bCeyq7hq76zX/C14ua6zh4= +github.com/iden3/go-circuits/v2 v2.0.1-0.20231121082343-9d0c77664cd9 h1:AXbL1aF6ZjpKi1DGbgP5hjk1uUbbSnZQ1UtmW1pnLeU= +github.com/iden3/go-circuits/v2 v2.0.1-0.20231121082343-9d0c77664cd9/go.mod h1:VIFIp51+IH0hOzjnKhb84bCeyq7hq76zX/C14ua6zh4= github.com/iden3/go-iden3-core/v2 v2.0.0 h1:sQEuuq3RLfyYSY8qPiqxQ6YBpGbiAwepHJD/vjf1adA= github.com/iden3/go-iden3-core/v2 v2.0.0/go.mod h1:L9PxhWPvoS9qTb3inEkZBm1RpjHBt+VTwvxssdzbAdw= github.com/iden3/go-iden3-crypto v0.0.15 h1:4MJYlrot1l31Fzlo2sF56u7EVFeHHJkxGXXZCtESgK4= diff --git a/inputs_sig.go b/inputs_sig.go index 36f6415..ab55221 100644 --- a/inputs_sig.go +++ b/inputs_sig.go @@ -928,10 +928,10 @@ func queryProofType(requestObj jsonObj) (circuits.ProofType, error) { } switch circuits.ProofType(resS) { - case circuits.MTPProofType: - return circuits.MTPProofType, nil - case circuits.SigProotType: - return circuits.SigProotType, nil + case circuits.Iden3SparseMerkleTreeProofType: + return circuits.Iden3SparseMerkleTreeProofType, nil + case circuits.BJJSignatureProofType: + return circuits.BJJSignatureProofType, nil } return "", fmt.Errorf("unknown proofType: %v", resS) @@ -1376,14 +1376,14 @@ func claimWithSigAndMtpProofFromObj(ctx context.Context, cfg EnvConfig, proofType circuits.ProofType) (circuits.ClaimWithSigAndMTPProof, circuits.ProofType, error) { switch proofType { - case circuits.MTPProofType: + case circuits.Iden3SparseMerkleTreeProofType: claimWithMtpProof, err := claimWithMtpProofFromObj(ctx, cfg, w3cCred, skipClaimRevocationCheck) if err != nil { return circuits.ClaimWithSigAndMTPProof{}, proofType, err } return v3ProofFromMTP(claimWithMtpProof), proofType, nil - case circuits.SigProotType: + case circuits.BJJSignatureProofType: claimWithSigProof, err := claimWithSigProofFromObj(ctx, cfg, w3cCred, skipClaimRevocationCheck) if err != nil { @@ -1401,12 +1401,14 @@ func claimWithSigAndMtpProofFromObj(ctx context.Context, cfg EnvConfig, if err != nil { return circuits.ClaimWithSigAndMTPProof{}, proofType, err } - return v3ProofFromSig(claimWithSigProof), circuits.SigProotType, nil + return v3ProofFromSig(claimWithSigProof), + circuits.BJJSignatureProofType, nil case err != nil: return circuits.ClaimWithSigAndMTPProof{}, proofType, err } - return v3ProofFromMTP(claimWithMtpProof), circuits.MTPProofType, nil + return v3ProofFromMTP(claimWithMtpProof), + circuits.Iden3SparseMerkleTreeProofType, nil default: return circuits.ClaimWithSigAndMTPProof{}, proofType, fmt.Errorf("unknown proofType: %v", proofType) diff --git a/inputs_sig_test.go b/inputs_sig_test.go index 68dfed9..50a5844 100644 --- a/inputs_sig_test.go +++ b/inputs_sig_test.go @@ -484,6 +484,60 @@ func TestPrepareInputs(t *testing.T) { AtomicQuerySigV2InputsFromJson, wantVerifiablePresentation, EnvConfig{IPFSNodeURL: ipfsURL}, "") }) + + t.Run("AtomicQueryV3InputsFromJson - MTP", func(t *testing.T) { + defer httpmock.MockHTTPClient(t, map[string]string{ + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld": "testdata/httpresp_kyc-v3.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld": "testdata/httpresp_iden3credential_v2.json", + "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481": "testdata/httpresp_rev_status_2376431481.json", + //"http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0": "testdata/httpresp_rev_status_wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU_0.json", + }, httpmock.IgnoreUntouchedURLs())() + + doTest(t, "atomic_query_v3_mtp_inputs.json", + "atomic_query_v3_mtp_output.json", + AtomicQueryV3InputsFromJson, nil, EnvConfig{}, "") + }) + + t.Run("AtomicQueryV3InputsFromJson - Sig", func(t *testing.T) { + defer httpmock.MockHTTPClient(t, map[string]string{ + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld": "testdata/httpresp_kyc-v3.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld": "testdata/httpresp_iden3credential_v2.json", + "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481": "testdata/httpresp_rev_status_2376431481.json", + "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0": "testdata/httpresp_rev_status_wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU_0.json", + }, httpmock.IgnoreUntouchedURLs())() + + doTest(t, "atomic_query_v3_sig_inputs.json", + "atomic_query_v3_sig_output.json", + AtomicQueryV3InputsFromJson, nil, EnvConfig{}, "") + }) + + // Inputs does not include proof type, but the query has both. Choose MTP. + t.Run("AtomicQueryV3InputsFromJson - No proof type, Have both", func(t *testing.T) { + defer httpmock.MockHTTPClient(t, map[string]string{ + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld": "testdata/httpresp_kyc-v3.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld": "testdata/httpresp_iden3credential_v2.json", + "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481": "testdata/httpresp_rev_status_2376431481.json", + //"http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0": "testdata/httpresp_rev_status_wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU_0.json", + }, httpmock.IgnoreUntouchedURLs())() + + doTest(t, "atomic_query_v3_no_proof_type_both_have_inputs.json", + "atomic_query_v3_mtp_output.json", + AtomicQueryV3InputsFromJson, nil, EnvConfig{}, "") + }) + + // Inputs does not include proof type, but the query contains Sig one. + t.Run("AtomicQueryV3InputsFromJson - No proof type, Sig only", func(t *testing.T) { + defer httpmock.MockHTTPClient(t, map[string]string{ + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld": "testdata/httpresp_kyc-v3.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld": "testdata/httpresp_iden3credential_v2.json", + "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481": "testdata/httpresp_rev_status_2376431481.json", + "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0": "testdata/httpresp_rev_status_wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU_0.json", + }, httpmock.IgnoreUntouchedURLs())() + + doTest(t, "atomic_query_v3_no_proof_type_sig_only_inputs.json", + "atomic_query_v3_sig_output.json", + AtomicQueryV3InputsFromJson, nil, EnvConfig{}, "") + }) } func TestEnvConfig_UnmarshalJSON(t *testing.T) { diff --git a/testdata/atomic_query_v3_mtp_inputs.json b/testdata/atomic_query_v3_mtp_inputs.json new file mode 100644 index 0000000..ee8ca48 --- /dev/null +++ b/testdata/atomic_query_v3_mtp_inputs.json @@ -0,0 +1,99 @@ +{ + "id": "x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "profileNonce": "123", + "claimSubjectProfileNonce": "234", + "verifiableCredentials": { + "id": "http://localhost:8001/api/v1/claim/98781b98-73c9-11ed-9818-3a0197678785", + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld" + ], + "type": [ + "VerifiableCredential", + "KYCAgeCredential" + ], + "expirationDate": "2361-03-21T21:14:48+02:00", + "issuanceDate": "2022-12-04T13:48:40.198183+02:00", + "credentialSubject": { + "birthday": 19960424, + "documentType": 2, + "id": "did:iden3:polygon:mumbai:x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "type": "KYCAgeCredential" + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481", + "revocationNonce": 2376431481, + "type": "SparseMerkleTreeProof" + }, + "issuer": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "credentialSchema": { + "id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json", + "type": "JsonSchemaValidator2018" + }, + "proof": [ + { + "type": "BJJSignature2021", + "issuerData": { + "id": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "state": { + "claimsTreeRoot": "11185c59b43208eeb4fb732f20ece73d6d440c64c4b52422bf1a6deeafe68f05", + "value": "3a5ca99f6701addce176e9a9de1980cbc41034e75b24c3a2b04fd4cb4b3d2810" + }, + "authCoreClaim": "013fd3f623559d850fb5b02ff012d0e2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bf3d1641ec4e00d087f2480cc65a6ea9b211aace253182ebb81240d9d368fc2d2fee435fc728f05c6979b226f42958c84aa86b4ba54a77b72fc00e6e9265ff1d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [] + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0", + "revocationNonce": 0, + "type": "SparseMerkleTreeProof" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a000000000000000000000000000000011285d39f7e4e930bf6621fd141407299cf5fba8829960dfe83ce5b23510d00304987e6a4740b263819a852beca7ac47b74ba515b57f873654b6cc2182ac22500000000000000000000000000000000000000000000000000000000000000007977a58d00000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signature": "f0b19b1c5d5317535f5f3647f6c644294c8dfc3c4ef057a323b54e3ce8945d20a6fbd5ba9c8a1e5e87267e4f604818447148af6f51ac6cd10c1a10ca20396e02" + }, + { + "type": "Iden3SparseMerkleProof", + "issuerData": { + "id": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "state": { + "txId": "0x1cb9fed0226d628ed39d8cbdbc71c81246b6032eb3f31d8abcfca8e9c790d2c0", + "blockTimestamp": 1670154663, + "blockNumber": 29484252, + "rootOfRoots": "10d1069175d39632f025e200d441eea466ee9e71e0ad5a3841d5ecea6646f116", + "claimsTreeRoot": "06008861f3bbaf33062ba867480cd9becc14817433369b6edd306f747818fb14", + "revocationTreeRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "value": "29810ec2eccf276d101a8ba9b4fa4c53d00f795413bfe2682c64c627184c1721" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a000000000000000000000000000000011285d39f7e4e930bf6621fd141407299cf5fba8829960dfe83ce5b23510d00304987e6a4740b263819a852beca7ac47b74ba515b57f873654b6cc2182ac22500000000000000000000000000000000000000000000000000000000000000007977a58d00000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "21766464054775500261540970596627132740681360541808718916226684581420553493829", + "0", + "0", + "2515815517939277878486495591852893192186484331807066957639537744648750241809" + ] + } + } + ] + }, + "request": { + "id": 84239, + "circuitId": "credentialAtomicQueryV3", + "query": { + "allowedIssuers": "unused", + "context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld", + "type": "KYCAgeCredential", + "credentialSubject": { + "documentType": { + "$eq": 2 + } + }, + "proofType": "Iden3SparseMerkleTreeProof" + } + } +} diff --git a/testdata/atomic_query_v3_mtp_output.json b/testdata/atomic_query_v3_mtp_output.json new file mode 100644 index 0000000..deac4cb --- /dev/null +++ b/testdata/atomic_query_v3_mtp_output.json @@ -0,0 +1 @@ +{"requestID":"84239","userGenesisID":"23529006562716512365284470649701500265624720888290140936730678617958584833","profileNonce":"123","claimSubjectProfileNonce":"234","issuerID":"24687982279323932130156062863272601148565852640780662148237991047021531649","issuerClaim":["14366836738280263696847396792315741188809","23529006562716512365284470649701500265624720888290140936730678617958584833","17078634269008282508978520614899691176511963995966531315408520179071582685488","0","227737578863135127231973914489","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"14200687038162658423445687080642044812853023721722929563326842955302298883583","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"13682688696715423561569357932088650136406153300979709261864316589023788667102","issuerClaimNonRevState":"3115266220827509894065475154280381877956215721974280577792238675116811787563","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"0","issuerClaimSignatureR8y":"0","issuerClaimSignatureS":"0","issuerAuthClaim":["0","0","0","0","0","0","0","0"],"issuerAuthClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"0","issuerAuthClaimsTreeRoot":"0","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"0","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["12517150030576619527252492821655890410294919107657416409973519542186017163807","11933107200150122400824598729420157563957281318882971696220077028927460055808","13748716966604096441336188506766329119346066422143435538531763565408555859415","0","20486600725567702962288985115041578424966996747359110560639957588130104510049","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"17040667407194471738958340146498954457187839778402591036538781364266841966","claimPathValue":"2","operator":1,"slotIndex":0,"timestamp":1700555491,"value":["2","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["21766464054775500261540970596627132740681360541808718916226684581420553493829","0","0","2515815517939277878486495591852893192186484331807066957639537744648750241809","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"9489904474292592373795528228767129060254792153148571504636433835422869094406","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"10377178708342790262994259866714708615805144336972511218145747355348932940048","issuerClaimIdenState":"14967486669687562573593136047944554523204659672540000842773134919176536621353","proofType":"2","linkNonce":"0","verifierID":"0","verifierSessionID":"0"} diff --git a/testdata/atomic_query_v3_no_proof_type_both_have_inputs.json b/testdata/atomic_query_v3_no_proof_type_both_have_inputs.json new file mode 100644 index 0000000..650520c --- /dev/null +++ b/testdata/atomic_query_v3_no_proof_type_both_have_inputs.json @@ -0,0 +1,98 @@ +{ + "id": "x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "profileNonce": "123", + "claimSubjectProfileNonce": "234", + "verifiableCredentials": { + "id": "http://localhost:8001/api/v1/claim/98781b98-73c9-11ed-9818-3a0197678785", + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld" + ], + "type": [ + "VerifiableCredential", + "KYCAgeCredential" + ], + "expirationDate": "2361-03-21T21:14:48+02:00", + "issuanceDate": "2022-12-04T13:48:40.198183+02:00", + "credentialSubject": { + "birthday": 19960424, + "documentType": 2, + "id": "did:iden3:polygon:mumbai:x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "type": "KYCAgeCredential" + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481", + "revocationNonce": 2376431481, + "type": "SparseMerkleTreeProof" + }, + "issuer": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "credentialSchema": { + "id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json", + "type": "JsonSchemaValidator2018" + }, + "proof": [ + { + "type": "BJJSignature2021", + "issuerData": { + "id": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "state": { + "claimsTreeRoot": "11185c59b43208eeb4fb732f20ece73d6d440c64c4b52422bf1a6deeafe68f05", + "value": "3a5ca99f6701addce176e9a9de1980cbc41034e75b24c3a2b04fd4cb4b3d2810" + }, + "authCoreClaim": "013fd3f623559d850fb5b02ff012d0e2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bf3d1641ec4e00d087f2480cc65a6ea9b211aace253182ebb81240d9d368fc2d2fee435fc728f05c6979b226f42958c84aa86b4ba54a77b72fc00e6e9265ff1d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [] + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0", + "revocationNonce": 0, + "type": "SparseMerkleTreeProof" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a000000000000000000000000000000011285d39f7e4e930bf6621fd141407299cf5fba8829960dfe83ce5b23510d00304987e6a4740b263819a852beca7ac47b74ba515b57f873654b6cc2182ac22500000000000000000000000000000000000000000000000000000000000000007977a58d00000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signature": "f0b19b1c5d5317535f5f3647f6c644294c8dfc3c4ef057a323b54e3ce8945d20a6fbd5ba9c8a1e5e87267e4f604818447148af6f51ac6cd10c1a10ca20396e02" + }, + { + "type": "Iden3SparseMerkleProof", + "issuerData": { + "id": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "state": { + "txId": "0x1cb9fed0226d628ed39d8cbdbc71c81246b6032eb3f31d8abcfca8e9c790d2c0", + "blockTimestamp": 1670154663, + "blockNumber": 29484252, + "rootOfRoots": "10d1069175d39632f025e200d441eea466ee9e71e0ad5a3841d5ecea6646f116", + "claimsTreeRoot": "06008861f3bbaf33062ba867480cd9becc14817433369b6edd306f747818fb14", + "revocationTreeRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "value": "29810ec2eccf276d101a8ba9b4fa4c53d00f795413bfe2682c64c627184c1721" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a000000000000000000000000000000011285d39f7e4e930bf6621fd141407299cf5fba8829960dfe83ce5b23510d00304987e6a4740b263819a852beca7ac47b74ba515b57f873654b6cc2182ac22500000000000000000000000000000000000000000000000000000000000000007977a58d00000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "21766464054775500261540970596627132740681360541808718916226684581420553493829", + "0", + "0", + "2515815517939277878486495591852893192186484331807066957639537744648750241809" + ] + } + } + ] + }, + "request": { + "id": 84239, + "circuitId": "credentialAtomicQueryV3", + "query": { + "allowedIssuers": "unused", + "context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld", + "type": "KYCAgeCredential", + "credentialSubject": { + "documentType": { + "$eq": 2 + } + } + } + } +} diff --git a/testdata/atomic_query_v3_no_proof_type_sig_only_inputs.json b/testdata/atomic_query_v3_no_proof_type_sig_only_inputs.json new file mode 100644 index 0000000..c9c6f09 --- /dev/null +++ b/testdata/atomic_query_v3_no_proof_type_sig_only_inputs.json @@ -0,0 +1,73 @@ +{ + "id": "x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "profileNonce": "123", + "claimSubjectProfileNonce": "234", + "verifiableCredentials": { + "id": "http://localhost:8001/api/v1/claim/98781b98-73c9-11ed-9818-3a0197678785", + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld" + ], + "type": [ + "VerifiableCredential", + "KYCAgeCredential" + ], + "expirationDate": "2361-03-21T21:14:48+02:00", + "issuanceDate": "2022-12-04T13:48:40.198183+02:00", + "credentialSubject": { + "birthday": 19960424, + "documentType": 2, + "id": "did:iden3:polygon:mumbai:x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "type": "KYCAgeCredential" + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481", + "revocationNonce": 2376431481, + "type": "SparseMerkleTreeProof" + }, + "issuer": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "credentialSchema": { + "id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json", + "type": "JsonSchemaValidator2018" + }, + "proof": [ + { + "type": "BJJSignature2021", + "issuerData": { + "id": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "state": { + "claimsTreeRoot": "11185c59b43208eeb4fb732f20ece73d6d440c64c4b52422bf1a6deeafe68f05", + "value": "3a5ca99f6701addce176e9a9de1980cbc41034e75b24c3a2b04fd4cb4b3d2810" + }, + "authCoreClaim": "013fd3f623559d850fb5b02ff012d0e2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bf3d1641ec4e00d087f2480cc65a6ea9b211aace253182ebb81240d9d368fc2d2fee435fc728f05c6979b226f42958c84aa86b4ba54a77b72fc00e6e9265ff1d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [] + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0", + "revocationNonce": 0, + "type": "SparseMerkleTreeProof" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a000000000000000000000000000000011285d39f7e4e930bf6621fd141407299cf5fba8829960dfe83ce5b23510d00304987e6a4740b263819a852beca7ac47b74ba515b57f873654b6cc2182ac22500000000000000000000000000000000000000000000000000000000000000007977a58d00000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signature": "f0b19b1c5d5317535f5f3647f6c644294c8dfc3c4ef057a323b54e3ce8945d20a6fbd5ba9c8a1e5e87267e4f604818447148af6f51ac6cd10c1a10ca20396e02" + } + ] + }, + "request": { + "id": 84239, + "circuitId": "credentialAtomicQueryV3", + "query": { + "allowedIssuers": "unused", + "context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld", + "type": "KYCAgeCredential", + "credentialSubject": { + "documentType": { + "$eq": 2 + } + } + } + } +} diff --git a/testdata/atomic_query_v3_sig_inputs.json b/testdata/atomic_query_v3_sig_inputs.json new file mode 100644 index 0000000..d19fef7 --- /dev/null +++ b/testdata/atomic_query_v3_sig_inputs.json @@ -0,0 +1,99 @@ +{ + "id": "x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "profileNonce": "123", + "claimSubjectProfileNonce": "234", + "verifiableCredentials": { + "id": "http://localhost:8001/api/v1/claim/98781b98-73c9-11ed-9818-3a0197678785", + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld" + ], + "type": [ + "VerifiableCredential", + "KYCAgeCredential" + ], + "expirationDate": "2361-03-21T21:14:48+02:00", + "issuanceDate": "2022-12-04T13:48:40.198183+02:00", + "credentialSubject": { + "birthday": 19960424, + "documentType": 2, + "id": "did:iden3:polygon:mumbai:x1QQ78ktjAmia48pyEZENyurZhpRSdPMWmtv1zbsi", + "type": "KYCAgeCredential" + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481", + "revocationNonce": 2376431481, + "type": "SparseMerkleTreeProof" + }, + "issuer": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "credentialSchema": { + "id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json", + "type": "JsonSchemaValidator2018" + }, + "proof": [ + { + "type": "BJJSignature2021", + "issuerData": { + "id": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "state": { + "claimsTreeRoot": "11185c59b43208eeb4fb732f20ece73d6d440c64c4b52422bf1a6deeafe68f05", + "value": "3a5ca99f6701addce176e9a9de1980cbc41034e75b24c3a2b04fd4cb4b3d2810" + }, + "authCoreClaim": "013fd3f623559d850fb5b02ff012d0e2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bf3d1641ec4e00d087f2480cc65a6ea9b211aace253182ebb81240d9d368fc2d2fee435fc728f05c6979b226f42958c84aa86b4ba54a77b72fc00e6e9265ff1d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [] + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0", + "revocationNonce": 0, + "type": "SparseMerkleTreeProof" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a000000000000000000000000000000011285d39f7e4e930bf6621fd141407299cf5fba8829960dfe83ce5b23510d00304987e6a4740b263819a852beca7ac47b74ba515b57f873654b6cc2182ac22500000000000000000000000000000000000000000000000000000000000000007977a58d00000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signature": "f0b19b1c5d5317535f5f3647f6c644294c8dfc3c4ef057a323b54e3ce8945d20a6fbd5ba9c8a1e5e87267e4f604818447148af6f51ac6cd10c1a10ca20396e02" + }, + { + "type": "Iden3SparseMerkleProof", + "issuerData": { + "id": "did:iden3:polygon:mumbai:wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU", + "state": { + "txId": "0x1cb9fed0226d628ed39d8cbdbc71c81246b6032eb3f31d8abcfca8e9c790d2c0", + "blockTimestamp": 1670154663, + "blockNumber": 29484252, + "rootOfRoots": "10d1069175d39632f025e200d441eea466ee9e71e0ad5a3841d5ecea6646f116", + "claimsTreeRoot": "06008861f3bbaf33062ba867480cd9becc14817433369b6edd306f747818fb14", + "revocationTreeRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "value": "29810ec2eccf276d101a8ba9b4fa4c53d00f795413bfe2682c64c627184c1721" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a000000000000000000000000000000011285d39f7e4e930bf6621fd141407299cf5fba8829960dfe83ce5b23510d00304987e6a4740b263819a852beca7ac47b74ba515b57f873654b6cc2182ac22500000000000000000000000000000000000000000000000000000000000000007977a58d00000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "21766464054775500261540970596627132740681360541808718916226684581420553493829", + "0", + "0", + "2515815517939277878486495591852893192186484331807066957639537744648750241809" + ] + } + } + ] + }, + "request": { + "id": 84239, + "circuitId": "credentialAtomicQueryV3", + "query": { + "allowedIssuers": "unused", + "context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld", + "type": "KYCAgeCredential", + "credentialSubject": { + "documentType": { + "$eq": 2 + } + }, + "proofType": "BJJSignature2021" + } + } +} diff --git a/testdata/atomic_query_v3_sig_output.json b/testdata/atomic_query_v3_sig_output.json new file mode 100644 index 0000000..abd5af8 --- /dev/null +++ b/testdata/atomic_query_v3_sig_output.json @@ -0,0 +1 @@ +{"requestID":"84239","userGenesisID":"23529006562716512365284470649701500265624720888290140936730678617958584833","profileNonce":"123","claimSubjectProfileNonce":"234","issuerID":"24687982279323932130156062863272601148565852640780662148237991047021531649","issuerClaim":["14366836738280263696847396792315741188809","23529006562716512365284470649701500265624720888290140936730678617958584833","17078634269008282508978520614899691176511963995966531315408520179071582685488","0","227737578863135127231973914489","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"14200687038162658423445687080642044812853023721722929563326842955302298883583","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"13682688696715423561569357932088650136406153300979709261864316589023788667102","issuerClaimNonRevState":"3115266220827509894065475154280381877956215721974280577792238675116811787563","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"3401132352748467801186691242723388966501310737760201232781394312478968516811","issuerClaimSignatureR8y":"14639355651206981871457530059828593759963127395406402287301277479863439831536","issuerClaimSignatureS":"1099373157831922260084450256841834204662056134831425771868248575565054213030","issuerAuthClaim":["301485908906857522017021291028488077057","0","20800047139619078765913685999449630237159541056274690213755814945885628284351","13568319634556872698924849294662464891562965489754551735323123867002438151727","0","0","0","0"],"issuerAuthClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"1","issuerAuthClaimsTreeRoot":"2515815517939277878486495591852893192186484331807066957639537744648750241809","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"7308102509912286854966990626249960190664829551279914873017205641496138177594","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["12517150030576619527252492821655890410294919107657416409973519542186017163807","11933107200150122400824598729420157563957281318882971696220077028927460055808","13748716966604096441336188506766329119346066422143435538531763565408555859415","0","20486600725567702962288985115041578424966996747359110560639957588130104510049","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"17040667407194471738958340146498954457187839778402591036538781364266841966","claimPathValue":"2","operator":1,"slotIndex":0,"timestamp":1700555951,"value":["2","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"0","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"0","issuerClaimIdenState":"0","proofType":"1","linkNonce":"0","verifierID":"0","verifierSessionID":"0"} From 784125834784deccc4d3dfd04105cf31f034d902 Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Tue, 21 Nov 2023 04:07:42 -0500 Subject: [PATCH 4/6] Add tests for v3 on-chain circuits --- cmd/polygonid/polygonid.go | 2 +- inputs_sig_test.go | 25 ++++ .../atomic_query_v3_on_chain_mtp_inputs.json | 139 ++++++++++++++++++ .../atomic_query_v3_on_chain_mtp_output.json | 1 + .../atomic_query_v3_on_chain_sig_inputs.json | 139 ++++++++++++++++++ .../atomic_query_v3_on_chain_sig_output.json | 1 + 6 files changed, 306 insertions(+), 1 deletion(-) create mode 100644 testdata/atomic_query_v3_on_chain_mtp_inputs.json create mode 100644 testdata/atomic_query_v3_on_chain_mtp_output.json create mode 100644 testdata/atomic_query_v3_on_chain_sig_inputs.json create mode 100644 testdata/atomic_query_v3_on_chain_sig_output.json diff --git a/cmd/polygonid/polygonid.go b/cmd/polygonid/polygonid.go index aa68957..99e0675 100644 --- a/cmd/polygonid/polygonid.go +++ b/cmd/polygonid/polygonid.go @@ -740,7 +740,7 @@ func PLGNAtomicQueryMtpV2OnChainInputs(jsonResponse **C.char, in *C.char, // PLGNAtomicQueryV3Inputs returns the inputs for the credentialAtomicQueryV3 // circuit with optional selective disclosure. // -//export PLGNAtomicQueryV3OInputs +//export PLGNAtomicQueryV3Inputs func PLGNAtomicQueryV3Inputs(jsonResponse **C.char, in *C.char, cfg *C.char, status **C.PLGNStatus) bool { diff --git a/inputs_sig_test.go b/inputs_sig_test.go index 50a5844..5446bc4 100644 --- a/inputs_sig_test.go +++ b/inputs_sig_test.go @@ -538,6 +538,31 @@ func TestPrepareInputs(t *testing.T) { "atomic_query_v3_sig_output.json", AtomicQueryV3InputsFromJson, nil, EnvConfig{}, "") }) + + t.Run("AtomicQueryV3OnChainInputsFromJson - MTP", func(t *testing.T) { + defer httpmock.MockHTTPClient(t, map[string]string{ + "http://localhost:8001/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/revocation/status/3972757": "testdata/httpresp_rev_status_3972757.json", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld": "testdata/httpresp_kyc-v3.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld": "testdata/httpresp_iden3credential_v2.json", + }, httpmock.IgnoreUntouchedURLs())() + + doTest(t, "atomic_query_v3_on_chain_mtp_inputs.json", + "atomic_query_v3_on_chain_mtp_output.json", + AtomicQueryV3OnChainInputsFromJson, nil, EnvConfig{}, "") + }) + + t.Run("AtomicQueryV3OnChainInputsFromJson - Sig", func(t *testing.T) { + defer httpmock.MockHTTPClient(t, map[string]string{ + "http://localhost:8001/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/revocation/status/0": "testdata/httpresp_rev_status_qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV_0.json", + "http://localhost:8001/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/revocation/status/3972757": "testdata/httpresp_rev_status_3972757.json", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld": "testdata/httpresp_kyc-v3.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld": "testdata/httpresp_iden3credential_v2.json", + }, httpmock.IgnoreUntouchedURLs())() + + doTest(t, "atomic_query_v3_on_chain_sig_inputs.json", + "atomic_query_v3_on_chain_sig_output.json", + AtomicQueryV3OnChainInputsFromJson, nil, EnvConfig{}, "") + }) } func TestEnvConfig_UnmarshalJSON(t *testing.T) { diff --git a/testdata/atomic_query_v3_on_chain_mtp_inputs.json b/testdata/atomic_query_v3_on_chain_mtp_inputs.json new file mode 100644 index 0000000..8fadbf1 --- /dev/null +++ b/testdata/atomic_query_v3_on_chain_mtp_inputs.json @@ -0,0 +1,139 @@ +{ + "id": "2qNcq2LGHFyikZaWfsif1vjrpKFuTowsRV9U1oEhkB", + "profileNonce": "0", + "claimSubjectProfileNonce": "0", + "authClaim":[ + "80551937543569765027552589160822318028", + "0", + "18241173998748741404449730252371072752192413092443487065695081933963692076033", + "1330367256434394070988833218825135639784691088078528177530136343975207856992", + "0","0","0","0" + ], + "authClaimIncMtp":{ + "existence":true, + "siblings":[ + "0", + "16122227591077608214426811451297936630776316583414054146380942393644089006753" + ] + }, + "authClaimNonRevMtp":{"existence":false,"siblings":[]}, + "treeState":{ + "state":"3455793648389793511224972913807237799755511487265044435383221641855224272477", + "claimsRoot":"12863526460000963806360638100765589244767101189459134829137262186265339590400", + "revocationRoot":"0", + "rootOfRoots":"0" + }, + "gistProof": { + "root": "5005919421435686441886912154983595081356506147906956636160716123399604497694", + "proof": { + "existence": false, + "siblings": [ + "9572034982910400342435969278331518000622332242067560582395787734704675688171", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0" + ] + } + }, + + "signature": "a373921f2be69febb33730a0ce85864476364317d51df12a4d051da5180a3c02c1051aa3a5405538d26c998d34ed865065d73685bc7e8cf2546f87de2adbf703", + "challenge": "14274525809225776254148766756521966776753328068184040579440171048150881324976", + + "verifiableCredentials": { + "id": "http://localhost:8001/api/v1/identities/did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/63d05676-b22b-11ed-b489-e24d9cbdb31c", + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld" + ], + "type": [ + "VerifiableCredential", + "KYCAgeCredential" + ], + "expirationDate": "2361-03-21T15:14:48-04:00", + "issuanceDate": "2023-02-21T16:04:54.628883-05:00", + "credentialSubject": { + "birthday": 19960424, + "documentType": 2, + "id": "did:polygonid:polygon:mumbai:2qNcq2LGHFyikZaWfsif1vjrpKFuTowsRV9U1oEhkB", + "type": "KYCAgeCredential" + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/revocation/status/3972757", + "revocationNonce": 3972757, + "type": "SparseMerkleTreeProof" + }, + "issuer": "did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV", + "credentialSchema": { + "id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json", + "type": "JsonSchemaValidator2018" + }, + "proof": [ + { + "type": "BJJSignature2021", + "issuerData": { + "id": "did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV", + "state": { + "claimsTreeRoot": "4c4eb593366ca7ba87c8c39678324cfc50c088d1714cb2bfb1d4198f3fb48b0c", + "value": "e05968ec751d34825931e5faae3b1946af92386f7a41db02cb6acfd8f12e2029" + }, + "authCoreClaim": "cca3371a6cb1b715004407e325bd993c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fe4494aaaef099b11a5cdd64c486d213e389338be963e7858d8ecf6773b8af14ac5981df12305e138b45f3985565852db666e4419ee07487c1a75b447a52ff050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "8492005947035117331601304230085928449440142032894061581492108583460376442873" + ] + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/revocation/status/0", + "revocationNonce": 0, + "type": "SparseMerkleTreeProof" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a0000000000000000000000000000000212df9ac65c2ec1e545f9fa614fccfaba60435189f3d5a68feee8a307e51000e0209be826b8670e7c970d2eca0632123c9cbb6b5f5a5cf1480ad2b3f62b05180000000000000000000000000000000000000000000000000000000000000000959e3c0000000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signature": "d608a6be79730a6bf873438ff23b31b9e1d3caa5d2a30470ec3b2ff3633e4798262e192336b0b4588cc0c80417b4cd6e89182451f20cfddc77d784022f566300" + }, + { + "type": "Iden3SparseMerkleProof", + "issuerData": { + "id": "did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV", + "state": { + "txId": "0x51633300d6d5fb013134d4ea48663b7246a6b333c09bfafe4c440226b79ba903", + "blockTimestamp": 1677013536, + "blockNumber": 208660, + "rootOfRoots": "411df2b18d24592fd0730cbdb2425894cb4a24dac85328188f891333a311b315", + "claimsTreeRoot": "57b358eaacc24c2563f003a748a5b7f45b2b9ae1cd83e70085bfe0dcf9e8b918", + "revocationTreeRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "value": "4646aede7443039a4bfd8f069d8f7f74f5075f6b794fb04663ab02fb76ba0c26" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a0000000000000000000000000000000212df9ac65c2ec1e545f9fa614fccfaba60435189f3d5a68feee8a307e51000e0209be826b8670e7c970d2eca0632123c9cbb6b5f5a5cf1480ad2b3f62b05180000000000000000000000000000000000000000000000000000000000000000959e3c0000000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "3356738306440460467584170579991940197172182577060925476949151659410412574707", + "0", + "8492005947035117331601304230085928449440142032894061581492108583460376442873" + ] + } + } + ] + }, + "request": { + "id": 84239, + "circuitId": "credentialAtomicQueryV3OnChain", + "query": { + "allowedIssuers": "unused", + "context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld", + "type": "KYCAgeCredential", + "credentialSubject": { + "birthday": { + "$gt": 1 + } + }, + "proofType": "Iden3SparseMerkleTreeProof" + } + } +} diff --git a/testdata/atomic_query_v3_on_chain_mtp_output.json b/testdata/atomic_query_v3_on_chain_mtp_output.json new file mode 100644 index 0000000..75b5a5f --- /dev/null +++ b/testdata/atomic_query_v3_on_chain_mtp_output.json @@ -0,0 +1 @@ +{"requestID":"84239","userGenesisID":"29850258931222017705467685171096861881207969140433234245484437588206883330","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"21838234188363965811194222691354401595924521809699081663778070280584106498","issuerClaim":["14366836738280263696847396792315741188809","29850258931222017705467685171096861881207969140433234245484437588206883330","10864646027499383081088961255934500336998198319784699191293859938525393920224","0","227737578863135127229601455765","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"7068285887070269919744619817939427362270424612960356565961095251320521860039","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"6658769487718742664201419516702702972752809392331568580084074484906569715043","issuerClaimNonRevState":"684102056806145688850264533373905046865931700337702524047991423734848000844","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"0","issuerClaimSignatureR8y":"0","issuerClaimSignatureS":"0","issuerAuthClaim":["0","0","0","0","0","0","0","0"],"issuerAuthClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"0","issuerAuthClaimsTreeRoot":"0","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"0","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["20339377203772305341811217028433821450488614130701398378692634277562001985608","11933107200150122400824598729420157563957281318882971696220077028927460055808","7519717914785235098147247580991543123760904594098768992380227396525519134082","0","7234734700882409562051669071537722159277854149198231521046768401160975042526","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":3,"slotIndex":0,"timestamp":1700557095,"value":["1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["3356738306440460467584170579991940197172182577060925476949151659410412574707","0","8492005947035117331601304230085928449440142032894061581492108583460376442873","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"11183983014422730135576411221308508161718614147165981937885222857422656811863","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"9814957174382091206447535304534337089274740570836732274494171347479415627073","issuerClaimIdenState":"17210377343470156509439713038934318940268975754635034654510710013642161407558","proofType":"2","authClaim":["80551937543569765027552589160822318028","0","18241173998748741404449730252371072752192413092443487065695081933963692076033","1330367256434394070988833218825135639784691088078528177530136343975207856992","0","0","0","0"],"authClaimIncMtp":["0","16122227591077608214426811451297936630776316583414054146380942393644089006753","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtpAuxHi":"0","authClaimNonRevMtpAuxHv":"0","authClaimNonRevMtpNoAux":"1","challenge":"14274525809225776254148766756521966776753328068184040579440171048150881324976","challengeSignatureR8x":"7946547749202203153722495838633053001554440836922580938487145942616579191846","challengeSignatureR8y":"1010706202943890306207376437846808611140904467814086285233664632781903393699","challengeSignatureS":"1794862408952810680899390709999774819913937156125801964108882723761943086529","userClaimsTreeRoot":"12863526460000963806360638100765589244767101189459134829137262186265339590400","userRevTreeRoot":"0","userRootsTreeRoot":"0","userState":"3455793648389793511224972913807237799755511487265044435383221641855224272477","gistRoot":"5005919421435686441886912154983595081356506147906956636160716123399604497694","gistMtp":["9572034982910400342435969278331518000622332242067560582395787734704675688171","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"gistMtpAuxHi":"0","gistMtpAuxHv":"0","gistMtpNoAux":"1","linkNonce":"0","verifierID":"0","verifierSessionID":"0","authEnabled":"0"} diff --git a/testdata/atomic_query_v3_on_chain_sig_inputs.json b/testdata/atomic_query_v3_on_chain_sig_inputs.json new file mode 100644 index 0000000..6c2ece2 --- /dev/null +++ b/testdata/atomic_query_v3_on_chain_sig_inputs.json @@ -0,0 +1,139 @@ +{ + "id": "2qNcq2LGHFyikZaWfsif1vjrpKFuTowsRV9U1oEhkB", + "profileNonce": "0", + "claimSubjectProfileNonce": "0", + "authClaim":[ + "80551937543569765027552589160822318028", + "0", + "18241173998748741404449730252371072752192413092443487065695081933963692076033", + "1330367256434394070988833218825135639784691088078528177530136343975207856992", + "0","0","0","0" + ], + "authClaimIncMtp":{ + "existence":true, + "siblings":[ + "0", + "16122227591077608214426811451297936630776316583414054146380942393644089006753" + ] + }, + "authClaimNonRevMtp":{"existence":false,"siblings":[]}, + "treeState":{ + "state":"3455793648389793511224972913807237799755511487265044435383221641855224272477", + "claimsRoot":"12863526460000963806360638100765589244767101189459134829137262186265339590400", + "revocationRoot":"0", + "rootOfRoots":"0" + }, + "gistProof": { + "root": "5005919421435686441886912154983595081356506147906956636160716123399604497694", + "proof": { + "existence": false, + "siblings": [ + "9572034982910400342435969278331518000622332242067560582395787734704675688171", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", + "0", "0", "0", "0", "0", "0", "0" + ] + } + }, + + "signature": "a373921f2be69febb33730a0ce85864476364317d51df12a4d051da5180a3c02c1051aa3a5405538d26c998d34ed865065d73685bc7e8cf2546f87de2adbf703", + "challenge": "14274525809225776254148766756521966776753328068184040579440171048150881324976", + + "verifiableCredentials": { + "id": "http://localhost:8001/api/v1/identities/did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/63d05676-b22b-11ed-b489-e24d9cbdb31c", + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld", + "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld" + ], + "type": [ + "VerifiableCredential", + "KYCAgeCredential" + ], + "expirationDate": "2361-03-21T15:14:48-04:00", + "issuanceDate": "2023-02-21T16:04:54.628883-05:00", + "credentialSubject": { + "birthday": 19960424, + "documentType": 2, + "id": "did:polygonid:polygon:mumbai:2qNcq2LGHFyikZaWfsif1vjrpKFuTowsRV9U1oEhkB", + "type": "KYCAgeCredential" + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/revocation/status/3972757", + "revocationNonce": 3972757, + "type": "SparseMerkleTreeProof" + }, + "issuer": "did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV", + "credentialSchema": { + "id": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json", + "type": "JsonSchemaValidator2018" + }, + "proof": [ + { + "type": "BJJSignature2021", + "issuerData": { + "id": "did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV", + "state": { + "claimsTreeRoot": "4c4eb593366ca7ba87c8c39678324cfc50c088d1714cb2bfb1d4198f3fb48b0c", + "value": "e05968ec751d34825931e5faae3b1946af92386f7a41db02cb6acfd8f12e2029" + }, + "authCoreClaim": "cca3371a6cb1b715004407e325bd993c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fe4494aaaef099b11a5cdd64c486d213e389338be963e7858d8ecf6773b8af14ac5981df12305e138b45f3985565852db666e4419ee07487c1a75b447a52ff050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "8492005947035117331601304230085928449440142032894061581492108583460376442873" + ] + }, + "credentialStatus": { + "id": "http://localhost:8001/api/v1/identities/did%3Apolygonid%3Apolygon%3Amumbai%3A2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV/claims/revocation/status/0", + "revocationNonce": 0, + "type": "SparseMerkleTreeProof" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a0000000000000000000000000000000212df9ac65c2ec1e545f9fa614fccfaba60435189f3d5a68feee8a307e51000e0209be826b8670e7c970d2eca0632123c9cbb6b5f5a5cf1480ad2b3f62b05180000000000000000000000000000000000000000000000000000000000000000959e3c0000000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "signature": "d608a6be79730a6bf873438ff23b31b9e1d3caa5d2a30470ec3b2ff3633e4798262e192336b0b4588cc0c80417b4cd6e89182451f20cfddc77d784022f566300" + }, + { + "type": "Iden3SparseMerkleProof", + "issuerData": { + "id": "did:polygonid:polygon:mumbai:2qDnyCaxj4zdYmj6LbegYMjWSnkbKAyqtq31YeuyZV", + "state": { + "txId": "0x51633300d6d5fb013134d4ea48663b7246a6b333c09bfafe4c440226b79ba903", + "blockTimestamp": 1677013536, + "blockNumber": 208660, + "rootOfRoots": "411df2b18d24592fd0730cbdb2425894cb4a24dac85328188f891333a311b315", + "claimsTreeRoot": "57b358eaacc24c2563f003a748a5b7f45b2b9ae1cd83e70085bfe0dcf9e8b918", + "revocationTreeRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "value": "4646aede7443039a4bfd8f069d8f7f74f5075f6b794fb04663ab02fb76ba0c26" + } + }, + "coreClaim": "c9b2370371b7fa8b3dab2a5ba81b68382a0000000000000000000000000000000212df9ac65c2ec1e545f9fa614fccfaba60435189f3d5a68feee8a307e51000e0209be826b8670e7c970d2eca0632123c9cbb6b5f5a5cf1480ad2b3f62b05180000000000000000000000000000000000000000000000000000000000000000959e3c0000000000281cdcdf0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "mtp": { + "existence": true, + "siblings": [ + "3356738306440460467584170579991940197172182577060925476949151659410412574707", + "0", + "8492005947035117331601304230085928449440142032894061581492108583460376442873" + ] + } + } + ] + }, + "request": { + "id": 84239, + "circuitId": "credentialAtomicQueryV3OnChain", + "query": { + "allowedIssuers": "unused", + "context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld", + "type": "KYCAgeCredential", + "credentialSubject": { + "birthday": { + "$gt": 1 + } + }, + "proofType": "BJJSignature2021" + } + } +} diff --git a/testdata/atomic_query_v3_on_chain_sig_output.json b/testdata/atomic_query_v3_on_chain_sig_output.json new file mode 100644 index 0000000..fc36239 --- /dev/null +++ b/testdata/atomic_query_v3_on_chain_sig_output.json @@ -0,0 +1 @@ +{"requestID":"84239","userGenesisID":"29850258931222017705467685171096861881207969140433234245484437588206883330","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"21838234188363965811194222691354401595924521809699081663778070280584106498","issuerClaim":["14366836738280263696847396792315741188809","29850258931222017705467685171096861881207969140433234245484437588206883330","10864646027499383081088961255934500336998198319784699191293859938525393920224","0","227737578863135127229601455765","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"7068285887070269919744619817939427362270424612960356565961095251320521860039","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"6658769487718742664201419516702702972752809392331568580084074484906569715043","issuerClaimNonRevState":"684102056806145688850264533373905046865931700337702524047991423734848000844","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"11747846712575976789103695537037523332562075145011580583500049175210535569369","issuerClaimSignatureR8y":"10981385110516197518723572390806574597443411774630331809774356611630717339862","issuerClaimSignatureS":"175512676981649870996494291106146284210153217389851634475411077368175472166","issuerAuthClaim":["80551937543569765027552589160822318028","0","9356728240655771187463730053883278527612431391274247153407488694405943280894","2712679483947690800115343577504706960957388135060623045660205089766118611372","0","0","0","0"],"issuerAuthClaimMtp":["8492005947035117331601304230085928449440142032894061581492108583460376442873","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"1","issuerAuthClaimsTreeRoot":"5674589952892738312963722887009387330891967351794392069659222431201563594316","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"18601689898498710842095477465587677824190615945643454000265359503447837661664","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["20339377203772305341811217028433821450488614130701398378692634277562001985608","11933107200150122400824598729420157563957281318882971696220077028927460055808","7519717914785235098147247580991543123760904594098768992380227396525519134082","0","7234734700882409562051669071537722159277854149198231521046768401160975042526","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":3,"slotIndex":0,"timestamp":1700557557,"value":["1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"0","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"0","issuerClaimIdenState":"0","proofType":"1","authClaim":["80551937543569765027552589160822318028","0","18241173998748741404449730252371072752192413092443487065695081933963692076033","1330367256434394070988833218825135639784691088078528177530136343975207856992","0","0","0","0"],"authClaimIncMtp":["0","16122227591077608214426811451297936630776316583414054146380942393644089006753","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtpAuxHi":"0","authClaimNonRevMtpAuxHv":"0","authClaimNonRevMtpNoAux":"1","challenge":"14274525809225776254148766756521966776753328068184040579440171048150881324976","challengeSignatureR8x":"7946547749202203153722495838633053001554440836922580938487145942616579191846","challengeSignatureR8y":"1010706202943890306207376437846808611140904467814086285233664632781903393699","challengeSignatureS":"1794862408952810680899390709999774819913937156125801964108882723761943086529","userClaimsTreeRoot":"12863526460000963806360638100765589244767101189459134829137262186265339590400","userRevTreeRoot":"0","userRootsTreeRoot":"0","userState":"3455793648389793511224972913807237799755511487265044435383221641855224272477","gistRoot":"5005919421435686441886912154983595081356506147906956636160716123399604497694","gistMtp":["9572034982910400342435969278331518000622332242067560582395787734704675688171","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"gistMtpAuxHi":"0","gistMtpAuxHv":"0","gistMtpNoAux":"1","linkNonce":"0","verifierID":"0","verifierSessionID":"0","authEnabled":"0"} From c0e07c581df3667189e97dd14203de0e4d9fb1f3 Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Wed, 22 Nov 2023 07:19:18 -0500 Subject: [PATCH 5/6] up go-circuits --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c115404..d2ce433 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/ethereum/go-ethereum v1.12.0 github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0 github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4 - github.com/iden3/go-circuits/v2 v2.0.1-0.20231121082343-9d0c77664cd9 + github.com/iden3/go-circuits/v2 v2.0.1-0.20231121174851-c7d45cd9baec github.com/iden3/go-iden3-core/v2 v2.0.0 github.com/iden3/go-iden3-crypto v0.0.15 github.com/iden3/go-merkletree-sql/v2 v2.0.6 diff --git a/go.sum b/go.sum index 74ecf06..9889bf8 100644 --- a/go.sum +++ b/go.sum @@ -80,8 +80,8 @@ github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0- github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0/go.mod h1:8fkd2xyUG/V7ovpvZRyD2LyK2zZ4ALbgf5vJGyhzKdg= github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4 h1:iPvYa/AhhGo3juoUFDm/fBE2CZKy4WfQu7JY90tRf9Q= github.com/iden3/contracts-abi/state/go/abi v0.0.0-20230405152923-4a25f6f1f0f4/go.mod h1:TxgIrXCvxms3sbOdsy8kTvffUCIpEEifNy0fSXdkU4w= -github.com/iden3/go-circuits/v2 v2.0.1-0.20231121082343-9d0c77664cd9 h1:AXbL1aF6ZjpKi1DGbgP5hjk1uUbbSnZQ1UtmW1pnLeU= -github.com/iden3/go-circuits/v2 v2.0.1-0.20231121082343-9d0c77664cd9/go.mod h1:VIFIp51+IH0hOzjnKhb84bCeyq7hq76zX/C14ua6zh4= +github.com/iden3/go-circuits/v2 v2.0.1-0.20231121174851-c7d45cd9baec h1:ORXPivdUzGKSOkunZPtv9Gm+O6II7zpb/sRDJJ4C7Yc= +github.com/iden3/go-circuits/v2 v2.0.1-0.20231121174851-c7d45cd9baec/go.mod h1:VIFIp51+IH0hOzjnKhb84bCeyq7hq76zX/C14ua6zh4= github.com/iden3/go-iden3-core/v2 v2.0.0 h1:sQEuuq3RLfyYSY8qPiqxQ6YBpGbiAwepHJD/vjf1adA= github.com/iden3/go-iden3-core/v2 v2.0.0/go.mod h1:L9PxhWPvoS9qTb3inEkZBm1RpjHBt+VTwvxssdzbAdw= github.com/iden3/go-iden3-crypto v0.0.15 h1:4MJYlrot1l31Fzlo2sF56u7EVFeHHJkxGXXZCtESgK4= From a65ecc10f75d450bcde389e8c58986b2b0c4c7c1 Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Wed, 22 Nov 2023 07:23:48 -0500 Subject: [PATCH 6/6] fix tests --- inputs_sig_test.go | 1 - testdata/atomic_query_v3_on_chain_mtp_output.json | 2 +- testdata/atomic_query_v3_on_chain_sig_output.json | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/inputs_sig_test.go b/inputs_sig_test.go index 5446bc4..b14a1ff 100644 --- a/inputs_sig_test.go +++ b/inputs_sig_test.go @@ -517,7 +517,6 @@ func TestPrepareInputs(t *testing.T) { "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld": "testdata/httpresp_kyc-v3.json-ld", "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/iden3credential-v2.json-ld": "testdata/httpresp_iden3credential_v2.json", "http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/2376431481": "testdata/httpresp_rev_status_2376431481.json", - //"http://localhost:8001/api/v1/identities/did%3Aiden3%3Apolygon%3Amumbai%3AwuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU/claims/revocation/status/0": "testdata/httpresp_rev_status_wuQT8NtFq736wsJahUuZpbA8otTzjKGyKj4i4yWtU_0.json", }, httpmock.IgnoreUntouchedURLs())() doTest(t, "atomic_query_v3_no_proof_type_both_have_inputs.json", diff --git a/testdata/atomic_query_v3_on_chain_mtp_output.json b/testdata/atomic_query_v3_on_chain_mtp_output.json index 75b5a5f..330bd0a 100644 --- a/testdata/atomic_query_v3_on_chain_mtp_output.json +++ b/testdata/atomic_query_v3_on_chain_mtp_output.json @@ -1 +1 @@ -{"requestID":"84239","userGenesisID":"29850258931222017705467685171096861881207969140433234245484437588206883330","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"21838234188363965811194222691354401595924521809699081663778070280584106498","issuerClaim":["14366836738280263696847396792315741188809","29850258931222017705467685171096861881207969140433234245484437588206883330","10864646027499383081088961255934500336998198319784699191293859938525393920224","0","227737578863135127229601455765","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"7068285887070269919744619817939427362270424612960356565961095251320521860039","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"6658769487718742664201419516702702972752809392331568580084074484906569715043","issuerClaimNonRevState":"684102056806145688850264533373905046865931700337702524047991423734848000844","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"0","issuerClaimSignatureR8y":"0","issuerClaimSignatureS":"0","issuerAuthClaim":["0","0","0","0","0","0","0","0"],"issuerAuthClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"0","issuerAuthClaimsTreeRoot":"0","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"0","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["20339377203772305341811217028433821450488614130701398378692634277562001985608","11933107200150122400824598729420157563957281318882971696220077028927460055808","7519717914785235098147247580991543123760904594098768992380227396525519134082","0","7234734700882409562051669071537722159277854149198231521046768401160975042526","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":3,"slotIndex":0,"timestamp":1700557095,"value":["1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["3356738306440460467584170579991940197172182577060925476949151659410412574707","0","8492005947035117331601304230085928449440142032894061581492108583460376442873","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"11183983014422730135576411221308508161718614147165981937885222857422656811863","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"9814957174382091206447535304534337089274740570836732274494171347479415627073","issuerClaimIdenState":"17210377343470156509439713038934318940268975754635034654510710013642161407558","proofType":"2","authClaim":["80551937543569765027552589160822318028","0","18241173998748741404449730252371072752192413092443487065695081933963692076033","1330367256434394070988833218825135639784691088078528177530136343975207856992","0","0","0","0"],"authClaimIncMtp":["0","16122227591077608214426811451297936630776316583414054146380942393644089006753","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtpAuxHi":"0","authClaimNonRevMtpAuxHv":"0","authClaimNonRevMtpNoAux":"1","challenge":"14274525809225776254148766756521966776753328068184040579440171048150881324976","challengeSignatureR8x":"7946547749202203153722495838633053001554440836922580938487145942616579191846","challengeSignatureR8y":"1010706202943890306207376437846808611140904467814086285233664632781903393699","challengeSignatureS":"1794862408952810680899390709999774819913937156125801964108882723761943086529","userClaimsTreeRoot":"12863526460000963806360638100765589244767101189459134829137262186265339590400","userRevTreeRoot":"0","userRootsTreeRoot":"0","userState":"3455793648389793511224972913807237799755511487265044435383221641855224272477","gistRoot":"5005919421435686441886912154983595081356506147906956636160716123399604497694","gistMtp":["9572034982910400342435969278331518000622332242067560582395787734704675688171","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"gistMtpAuxHi":"0","gistMtpAuxHv":"0","gistMtpNoAux":"1","linkNonce":"0","verifierID":"0","verifierSessionID":"0","authEnabled":"0"} +{"requestID":"84239","userGenesisID":"29850258931222017705467685171096861881207969140433234245484437588206883330","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"21838234188363965811194222691354401595924521809699081663778070280584106498","issuerClaim":["14366836738280263696847396792315741188809","29850258931222017705467685171096861881207969140433234245484437588206883330","10864646027499383081088961255934500336998198319784699191293859938525393920224","0","227737578863135127229601455765","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"7068285887070269919744619817939427362270424612960356565961095251320521860039","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"6658769487718742664201419516702702972752809392331568580084074484906569715043","issuerClaimNonRevState":"684102056806145688850264533373905046865931700337702524047991423734848000844","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"0","issuerClaimSignatureR8y":"0","issuerClaimSignatureS":"0","issuerAuthClaim":["0","0","0","0","0","0","0","0"],"issuerAuthClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"0","issuerAuthClaimsTreeRoot":"0","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"0","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["20339377203772305341811217028433821450488614130701398378692634277562001985608","11933107200150122400824598729420157563957281318882971696220077028927460055808","7519717914785235098147247580991543123760904594098768992380227396525519134082","0","7234734700882409562051669071537722159277854149198231521046768401160975042526","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":3,"slotIndex":0,"timestamp":1700655718,"value":["1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["3356738306440460467584170579991940197172182577060925476949151659410412574707","0","8492005947035117331601304230085928449440142032894061581492108583460376442873","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"11183983014422730135576411221308508161718614147165981937885222857422656811863","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"9814957174382091206447535304534337089274740570836732274494171347479415627073","issuerClaimIdenState":"17210377343470156509439713038934318940268975754635034654510710013642161407558","proofType":"2","authClaim":["0","0","0","0","0","0","0","0"],"authClaimIncMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtpAuxHi":"0","authClaimNonRevMtpAuxHv":"0","authClaimNonRevMtpNoAux":"0","challenge":"0","challengeSignatureR8x":"0","challengeSignatureR8y":"0","challengeSignatureS":"0","userClaimsTreeRoot":"0","userRevTreeRoot":"0","userRootsTreeRoot":"0","userState":"0","gistRoot":"0","gistMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"gistMtpAuxHi":"0","gistMtpAuxHv":"0","gistMtpNoAux":"0","linkNonce":"0","verifierID":"0","verifierSessionID":"0","authEnabled":"0"} diff --git a/testdata/atomic_query_v3_on_chain_sig_output.json b/testdata/atomic_query_v3_on_chain_sig_output.json index fc36239..067ae05 100644 --- a/testdata/atomic_query_v3_on_chain_sig_output.json +++ b/testdata/atomic_query_v3_on_chain_sig_output.json @@ -1 +1 @@ -{"requestID":"84239","userGenesisID":"29850258931222017705467685171096861881207969140433234245484437588206883330","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"21838234188363965811194222691354401595924521809699081663778070280584106498","issuerClaim":["14366836738280263696847396792315741188809","29850258931222017705467685171096861881207969140433234245484437588206883330","10864646027499383081088961255934500336998198319784699191293859938525393920224","0","227737578863135127229601455765","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"7068285887070269919744619817939427362270424612960356565961095251320521860039","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"6658769487718742664201419516702702972752809392331568580084074484906569715043","issuerClaimNonRevState":"684102056806145688850264533373905046865931700337702524047991423734848000844","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"11747846712575976789103695537037523332562075145011580583500049175210535569369","issuerClaimSignatureR8y":"10981385110516197518723572390806574597443411774630331809774356611630717339862","issuerClaimSignatureS":"175512676981649870996494291106146284210153217389851634475411077368175472166","issuerAuthClaim":["80551937543569765027552589160822318028","0","9356728240655771187463730053883278527612431391274247153407488694405943280894","2712679483947690800115343577504706960957388135060623045660205089766118611372","0","0","0","0"],"issuerAuthClaimMtp":["8492005947035117331601304230085928449440142032894061581492108583460376442873","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"1","issuerAuthClaimsTreeRoot":"5674589952892738312963722887009387330891967351794392069659222431201563594316","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"18601689898498710842095477465587677824190615945643454000265359503447837661664","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["20339377203772305341811217028433821450488614130701398378692634277562001985608","11933107200150122400824598729420157563957281318882971696220077028927460055808","7519717914785235098147247580991543123760904594098768992380227396525519134082","0","7234734700882409562051669071537722159277854149198231521046768401160975042526","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":3,"slotIndex":0,"timestamp":1700557557,"value":["1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"0","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"0","issuerClaimIdenState":"0","proofType":"1","authClaim":["80551937543569765027552589160822318028","0","18241173998748741404449730252371072752192413092443487065695081933963692076033","1330367256434394070988833218825135639784691088078528177530136343975207856992","0","0","0","0"],"authClaimIncMtp":["0","16122227591077608214426811451297936630776316583414054146380942393644089006753","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtpAuxHi":"0","authClaimNonRevMtpAuxHv":"0","authClaimNonRevMtpNoAux":"1","challenge":"14274525809225776254148766756521966776753328068184040579440171048150881324976","challengeSignatureR8x":"7946547749202203153722495838633053001554440836922580938487145942616579191846","challengeSignatureR8y":"1010706202943890306207376437846808611140904467814086285233664632781903393699","challengeSignatureS":"1794862408952810680899390709999774819913937156125801964108882723761943086529","userClaimsTreeRoot":"12863526460000963806360638100765589244767101189459134829137262186265339590400","userRevTreeRoot":"0","userRootsTreeRoot":"0","userState":"3455793648389793511224972913807237799755511487265044435383221641855224272477","gistRoot":"5005919421435686441886912154983595081356506147906956636160716123399604497694","gistMtp":["9572034982910400342435969278331518000622332242067560582395787734704675688171","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"gistMtpAuxHi":"0","gistMtpAuxHv":"0","gistMtpNoAux":"1","linkNonce":"0","verifierID":"0","verifierSessionID":"0","authEnabled":"0"} +{"requestID":"84239","userGenesisID":"29850258931222017705467685171096861881207969140433234245484437588206883330","profileNonce":"0","claimSubjectProfileNonce":"0","issuerID":"21838234188363965811194222691354401595924521809699081663778070280584106498","issuerClaim":["14366836738280263696847396792315741188809","29850258931222017705467685171096861881207969140433234245484437588206883330","10864646027499383081088961255934500336998198319784699191293859938525393920224","0","227737578863135127229601455765","0","0","0"],"issuerClaimNonRevClaimsTreeRoot":"7068285887070269919744619817939427362270424612960356565961095251320521860039","issuerClaimNonRevRevTreeRoot":"0","issuerClaimNonRevRootsTreeRoot":"6658769487718742664201419516702702972752809392331568580084074484906569715043","issuerClaimNonRevState":"684102056806145688850264533373905046865931700337702524047991423734848000844","issuerClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimNonRevMtpAuxHi":"0","issuerClaimNonRevMtpAuxHv":"0","issuerClaimNonRevMtpNoAux":"1","claimSchema":"74977327600848231385663280181476307657","issuerClaimSignatureR8x":"11747846712575976789103695537037523332562075145011580583500049175210535569369","issuerClaimSignatureR8y":"10981385110516197518723572390806574597443411774630331809774356611630717339862","issuerClaimSignatureS":"175512676981649870996494291106146284210153217389851634475411077368175472166","issuerAuthClaim":["80551937543569765027552589160822318028","0","9356728240655771187463730053883278527612431391274247153407488694405943280894","2712679483947690800115343577504706960957388135060623045660205089766118611372","0","0","0","0"],"issuerAuthClaimMtp":["8492005947035117331601304230085928449440142032894061581492108583460376442873","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerAuthClaimNonRevMtpAuxHi":"0","issuerAuthClaimNonRevMtpAuxHv":"0","issuerAuthClaimNonRevMtpNoAux":"1","issuerAuthClaimsTreeRoot":"5674589952892738312963722887009387330891967351794392069659222431201563594316","issuerAuthRevTreeRoot":"0","issuerAuthRootsTreeRoot":"0","issuerAuthState":"18601689898498710842095477465587677824190615945643454000265359503447837661664","isRevocationChecked":1,"claimPathNotExists":0,"claimPathMtp":["20339377203772305341811217028433821450488614130701398378692634277562001985608","11933107200150122400824598729420157563957281318882971696220077028927460055808","7519717914785235098147247580991543123760904594098768992380227396525519134082","0","7234734700882409562051669071537722159277854149198231521046768401160975042526","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"claimPathMtpNoAux":"0","claimPathMtpAuxHi":"0","claimPathMtpAuxHv":"0","claimPathKey":"20376033832371109177683048456014525905119173674985843915445634726167450989630","claimPathValue":"19960424","operator":3,"slotIndex":0,"timestamp":1700655758,"value":["1","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"issuerClaimClaimsTreeRoot":"0","issuerClaimRevTreeRoot":"0","issuerClaimRootsTreeRoot":"0","issuerClaimIdenState":"0","proofType":"1","authClaim":["0","0","0","0","0","0","0","0"],"authClaimIncMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"authClaimNonRevMtpAuxHi":"0","authClaimNonRevMtpAuxHv":"0","authClaimNonRevMtpNoAux":"0","challenge":"0","challengeSignatureR8x":"0","challengeSignatureR8y":"0","challengeSignatureS":"0","userClaimsTreeRoot":"0","userRevTreeRoot":"0","userRootsTreeRoot":"0","userState":"0","gistRoot":"0","gistMtp":["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],"gistMtpAuxHi":"0","gistMtpAuxHv":"0","gistMtpNoAux":"0","linkNonce":"0","verifierID":"0","verifierSessionID":"0","authEnabled":"0"}