Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pull outid fromcredentialSubject. ChangecredentialSubject toclaims. #1130

Closed
Labels
@decentralgabe

Description

@decentralgabe

The currentcredentialSubject property is confusing for implementers and anyone inspecting a verifiable credential. It would be more meaningfully namedclaims, which makes it abundantly clear that the section is for theclaims being made in the credential.

This issue is compounded with the current usage of theid property, which is anoptional property within the currentcredentialSubject. There are two sources confusion here:

  1. Needing to check for an optional property within a confusingly namedcredentialSubject property to learnwhom the subject values are about (if they're about no one why are they there?)
  2. Needing to understand that theid property is a special property withspecial processing rules which is identifying the party who the credential subject is about <--- this should be confusing enough for you to agree to rename the property.

So, I propose two changes:

Before

{"@context": ["https://www.w3.org/ns/credentials/v2","https://www.w3.org/ns/credentials/examples/v2"  ],"id":"http://example.edu/credentials/3732","type": ["VerifiableCredential","UniversityDegreeCredential"],"issuer":"https://example.edu/issuers/565049","validFrom":"2010-01-01T00:00:00Z","credentialSubject": {"id":"did:example:ebfeb1f712ebc6f1c276e12ec21","degree": {"type":"BachelorDegree","name":"Bachelor of Science and Arts"    }  }}

After

{"@context": ["https://www.w3.org/ns/credentials/v2","https://www.w3.org/ns/credentials/examples/v2"  ],"id":"http://example.edu/credentials/3732","type": ["VerifiableCredential","UniversityDegreeCredential"],"issuer":"https://example.edu/issuers/565049","validFrom":"2010-01-01T00:00:00Z","subject":"did:example:ebfeb1f712ebc6f1c276e12ec21","claims": {"degree": {"type":"BachelorDegree","name":"Bachelor of Science and Arts"    }  }}

By elevatingsubject to a top-level property we follow the existing pattern used byissuer. We remove ambiguity about whom the credential is about. By renamingcredentialSubject toclaims we give a meaningful name to the property and remove confusion about its usage, including removing the need to parse its value for any special-case properties. Implementers will rejoice.

Caveats

The only thing that this breaks, as far as I am aware, is multiple subjects. I believe this can be handled like so...

{"@context": ["https://www.w3.org/ns/credentials/v2","https://www.w3.org/ns/credentials/examples/v2"  ],"id":"http://example.edu/credentials/3732","type": ["VerifiableCredential","NameCredential"],"issuer":"https://example.edu/issuers/565049","validFrom":"2010-01-01T00:00:00Z","subject": ["did:example:ebfeb1f712ebc6f1c276e12ec21","did:example:6f1c276e12ec21ebfeb1f712ebc"]"claims": [    {"name":"Alice" },    {"name":"Bob" }  ]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp