Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linked multi query #67

Merged
merged 14 commits into from
Feb 22, 2024
142 changes: 130 additions & 12 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,83 @@ func CreateContractInvokeRequestWithMessage(
}
}

// ValidateAuthRequest verifies auth request message
func ValidateAuthRequest(request protocol.AuthorizationRequestMessage) error {
groupIDValidationMap := make(map[int][]pubsignals.Query)

for _, proofRequest := range request.Body.Scope {
proofRequestQuery, err := unmarshalQuery(proofRequest.Query)
if err != nil {
return err
}
groupID := proofRequestQuery.GroupID
if groupID != 0 {
existingQueries := groupIDValidationMap[groupID]

// Validate that all requests in the group have the same schema, issuer, and circuit
for _, existingQuery := range existingQueries {
if existingQuery.Type != proofRequestQuery.Type {
return errors.New("all requests in the group should have the same type")
}

if existingQuery.Context != proofRequestQuery.Context {
return errors.New("all requests in the group should have the same context")
}

allowedIssuers := proofRequestQuery.AllowedIssuers
existingRequestAllowedIssuers := existingQuery.AllowedIssuers
if !checkIssuersEquality(allowedIssuers, existingRequestAllowedIssuers) {
return errors.New("all requests in the group should have the same issuer")
}
}

groupIDValidationMap[groupID] = append(existingQueries, proofRequestQuery)
}
}

return nil
}

func unmarshalQuery(queryMap map[string]interface{}) (out pubsignals.Query, err error) {
// prepare query from request
queryBytes, err := json.Marshal(queryMap)
if err != nil {
return out, err
}
err = json.Unmarshal(queryBytes, &out)
if err != nil {
return out, err
}
return out, nil
}

func checkIssuersEquality(issuers1, issuers2 []string) bool {
if len(issuers1) != len(issuers2) {
return false
}

for _, issuer := range issuers1 {
found := false
for _, existingIssuer := range issuers2 {
if issuer == existingIssuer || existingIssuer == "*" {
found = true
break
}
}

if !found {
return false
}
}

return true
}

type linkIDRequestID struct {
linkID *big.Int
requestID uint32
}

// VerifyAuthResponse performs verification of auth response based on auth request
func (v *Verifier) VerifyAuthResponse(
ctx context.Context,
Expand All @@ -326,7 +403,23 @@ func (v *Verifier) VerifyAuthResponse(
return errors.Errorf("sender of the request is not a target of response - expected %s, given %s", request.From, response.To)
}

if response.From == "" {
return errors.Errorf("proof response doesn't contain from field")
}

err := ValidateAuthRequest(request)
if err != nil {
return err
}

groupIDToLinkIDMap := make(map[int][]linkIDRequestID)
for _, proofRequest := range request.Body.Scope {
// prepare query from request
query, err := unmarshalQuery(proofRequest.Query)
if err != nil {
return err
}

proofResponse := findProofByRequestID(response.Body.Scope, proofRequest.ID)
if proofResponse == nil {
return errors.Errorf("proof for zk request id %v is presented not found", proofRequest.ID)
Expand All @@ -349,17 +442,6 @@ func (v *Verifier) VerifyAuthResponse(
return errors.Wrap(err, fmt.Sprintf("circuit with id %s is not supported by library", proofRequest.CircuitID))
}

// prepare query from request
queryBytes, err := json.Marshal(proofRequest.Query)
if err != nil {
return err
}
var query pubsignals.Query
err = json.Unmarshal(queryBytes, &query)
if err != nil {
return err
}

// verify proof author

err = cv.VerifyIDOwnership(response.From, big.NewInt(int64(proofResponse.ID)))
Expand All @@ -384,7 +466,7 @@ func (v *Verifier) VerifyAuthResponse(
}
proofRequest.Params[pubsignals.ParamNameVerifierDID] = verifierDID

err = cv.VerifyQuery(ctx, query, v.documentLoader, rawMessage, proofRequest.Params, opts...)
verifyResult, err := cv.VerifyQuery(ctx, query, v.documentLoader, rawMessage, proofRequest.Params, opts...)
if err != nil {
return err
}
Expand All @@ -394,8 +476,44 @@ func (v *Verifier) VerifyAuthResponse(
return err
}

err = verifyGroupIDMathch(verifyResult.LinkID, query.GroupID, proofResponse.ID, groupIDToLinkIDMap)
if err != nil {
return err
}

}

return nil
}

func verifyGroupIDMathch(linkID *big.Int, groupID int, requestID uint32, groupIDToLinkIDMap map[int][]linkIDRequestID) error {
if groupID == 0 {
return nil
}

if linkID == nil {
return errors.Errorf("Link id is not found for groupID %d", groupID)
}

if existingLinks, exists := groupIDToLinkIDMap[groupID]; exists {
linkIDMap := linkIDRequestID{linkID: linkID, requestID: requestID}
groupIDToLinkIDMap[groupID] = append(existingLinks, linkIDMap)
} else {
linkIDMap := linkIDRequestID{linkID: linkID, requestID: requestID}
groupIDToLinkIDMap[groupID] = []linkIDRequestID{linkIDMap}
}
// verify grouping links
for groupIDfromMap, metas := range groupIDToLinkIDMap {
// Check that all linkIDs are the same
if len(metas) > 1 {
firstLinkID := metas[0].linkID
for _, meta := range metas[1:] {
if meta.linkID.Cmp(firstLinkID) != 0 {
return errors.Errorf("Link id validation failed for group %d, request linkID to requestIds info: %v", groupIDfromMap, metas)
}
}
}
}
return nil
}

Expand Down
80 changes: 80 additions & 0 deletions auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1140,3 +1140,83 @@ func TestVerifyV3MessageWithMtpProof_Merkalized(t *testing.T) {
require.Nil(t, err)
schemaLoader.assert(t)
}

func TestFullVerifyLinkedProofsVerification(t *testing.T) {
verifierID := "did:iden3:polygon:mumbai:wzokvZ6kMoocKJuSbftdZxTD6qvayGpJb3m4FVXth"
callbackURL := "https://test.com/callback"
reason := "test"

request := CreateAuthorizationRequestWithMessage(reason, "mesage", verifierID, callbackURL)

var mtpProofRequest1 protocol.ZeroKnowledgeProofRequest
mtpProofRequest1.ID = 1
mtpProofRequest1.CircuitID = string(circuits.AtomicQueryV3CircuitID)
opt := false
mtpProofRequest1.Optional = &opt
mtpProofRequest1.Query = map[string]interface{}{
"allowedIssuers": []string{"*"},
"credentialSubject": map[string]interface{}{
"documentType": map[string]interface{}{
"$eq": 99,
},
},
"context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-nonmerklized.jsonld",
"type": "KYCAgeCredential",
"proofType": "BJJSignature2021",
}

var mtpProofRequest2 protocol.ZeroKnowledgeProofRequest
mtpProofRequest2.ID = 2
mtpProofRequest2.CircuitID = string(circuits.LinkedMultiQuery10CircuitID)
mtpProofRequest2.Optional = &opt
mtpProofRequest2.Query = map[string]interface{}{
"groupId": 1,
"allowedIssuers": []string{"*"},
"credentialSubject": map[string]interface{}{
"documentType": map[string]interface{}{
"$eq": 1,
},
"position": map[string]interface{}{
"$eq": "boss",
"$ne": "employee",
},
},
"context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v101.json-ld",
"type": "KYCEmployee",
"proofType": "Iden3SparseMerkleTreeProof",
}

var mtpProofRequest3 protocol.ZeroKnowledgeProofRequest
mtpProofRequest3.ID = 3
mtpProofRequest3.CircuitID = string(circuits.AtomicQueryV3CircuitID)
mtpProofRequest3.Optional = &opt
mtpProofRequest3.Query = map[string]interface{}{
"groupId": 1,
"allowedIssuers": []string{"*"},
"credentialSubject": map[string]interface{}{
"hireDate": map[string]interface{}{
"$eq": "2023-12-11",
},
},
"context": "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v101.json-ld",
"type": "KYCEmployee",
"proofType": "BJJSignature2021",
}
request.Body.Scope = append(append(append(request.Body.Scope, mtpProofRequest1), mtpProofRequest2), mtpProofRequest3)

schemaLoader := &mockJSONLDSchemaLoader{
schemas: map[string]string{
"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v101.json-ld": loadSchema("kyc-v101.json-ld"),
"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-nonmerklized.jsonld": loadSchema("kyc-nonmerklized.jsonld"),
},
}
authInstance, err := NewVerifier(verificationKeyloader, stateResolvers,
WithDocumentLoader(schemaLoader))
require.NoError(t, err)

tokenString := "eyJhbGciOiJncm90aDE2IiwiY2lyY3VpdElkIjoiYXV0aFYyIiwiY3JpdCI6WyJjaXJjdWl0SWQiXSwidHlwIjoiYXBwbGljYXRpb24vaWRlbjMtemtwLWpzb24ifQ.eyJpZCI6IjUxMmRhMWVlLWQwODctNGEwMC1hMGYzLTZjNmZmYjI0Zjc5NyIsInR5cCI6ImFwcGxpY2F0aW9uL2lkZW4zL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2lnbmFscyI6WyIyMTU2ODIyNTQ2OTg4OTQ1ODMwNTkxNDg0MTQ5MDE3NTI4MDA5MzU1NTAxNTA3MTMyOTc4NzM3NTY0MTQzMTI2MjUwOTIwODA2NSIsIjM1Mzk1NDg1NTE2OTc5MzEyNzQzMzU0OTg0NTU3NDYyMTcyMTczMDI0OTc3NTUyNjM4OTMzNjY2Mzk1NDU0NTk0ODQzODUxMzA1MDciLCIwIl19"
returnMsg, err := authInstance.FullVerify(context.Background(), tokenString, request, pubsignals.WithAcceptedProofGenerationDelay(proofGenerationDelay))
require.Nil(t, err)
require.NotNil(t, returnMsg)
schemaLoader.assert(t)
}
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ require (
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
github.com/iden3/contracts-abi/state/go/abi v1.0.0-beta.3
github.com/iden3/go-circuits/v2 v2.0.1
github.com/iden3/go-circuits/v2 v2.0.2-0.20240131165639-deb061a1b3e6
github.com/iden3/go-iden3-core/v2 v2.0.3
github.com/iden3/go-iden3-crypto v0.0.15
github.com/iden3/go-jwz/v2 v2.0.1
github.com/iden3/go-rapidsnark/types v0.0.3
github.com/iden3/go-rapidsnark/verifier v0.0.5
github.com/iden3/go-schema-processor/v2 v2.1.1
github.com/iden3/go-schema-processor/v2 v2.3.1
github.com/iden3/iden3comm/v2 v2.1.0
github.com/ipfs/go-ipfs-api v0.7.0
github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f
Expand All @@ -39,7 +40,6 @@ require (
github.com/goccy/go-json v0.10.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect
github.com/iden3/go-iden3-crypto v0.0.15 // indirect
github.com/iden3/go-merkletree-sql/v2 v2.0.4 // indirect
github.com/iden3/go-rapidsnark/prover v0.0.10 // indirect
github.com/iden3/go-rapidsnark/witness/v2 v2.0.0 // indirect
Expand Down Expand Up @@ -78,7 +78,7 @@ require (
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/sys v0.15.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand Down
Loading
Loading