This specification describes an Ed25519 Signature Suite created in 2020 for the Linked Data Proof specification. The Signature Suite utilizes Ed25519 EdDSA signatures and multibase.

This is an experimental specification and is undergoing regular revisions. It is not fit for production deployment.

Introduction

This specification defines a cryptographic suite for the purpose of creating, verifying proofs for Ed25519 EdDSA signatures in conformance with the Linked Data Proofs [[LD-PROOFS]] specification.

In general the suites uses the RDF Dataset Normalization Algorithm [[RDF-DATASET-NORMALIZATION]] to transform an input document into its canonical form. The cannonical representation is then hashed and signed with a detached signature algorithm.

Terminology

The following terms are used to describe concepts involved in the generation and verification of the Linked Data Proof signature suite.

signature suite
A specified set of cryptographic primitives typically consisting of a canonicalization algorithm, a message digest algorithm, and a signature algorithm that are bundled together by cryptographers for developers for the purposes of safety and convenience.
canonicalization algorithm
An algorithm that takes an input document that has more than one possible representation and always transforms it into a canonical form. This process is sometimes also called normalization.
message digest algorithm
An algorithm that takes a message, prefferably in some canonical form and produces a cryptographic output called a digest that is often many orders of magnitude smaller than the input message. These algorithms are often 1) very fast, 2) non-reversible, 3) cause the output to change significantly when even one bit of the input message changes, and 4) make it infeasible to find two different inputs for the same output.
canonical form
The output of applying a canonicalization algorithm to an input document.
signature algorithm
An algorithm that takes an input message and produces an output value where the receiver of the message can mathematically verify that the message has not been modified in transit and came from someone possessing a particular secret.
linked data document
A document comprised of linked data.
linked data proof
A linked data proof which is a set of attributes that represent a linked data digital proof and the parameters required to verify it as defined by [[RDF-N-Quads]].
linked data proof document
A linked data document featuring one or more linked data proofs.
Ed25519VerificationKey2020
The type of the verification method for the signature suite Ed25519Signature2020.
Ed25519Signature2020
The type of the linked data proof for the signature suite Ed25519Signature2020.

Suite Definition

The Ed25519 signature suite 2020 MUST be used in conjunction with the signing and verification algorithms in the Linked Data Proofs [[LD-PROOFS]] specification. The suite consists of the following algorithms:

Parameter Value Specification
canonicalization algorithm https://w3id.org/security#URDNA2015 [[RDF-DATASET-NORMALIZATION]]
message digest algorithm SHA-256 [[RFC4634]]
signature algorithm Edwards-Curve Digital Signature Algorithm (EdDSA) [[RFC8032]]

Verification Method

The cryptographic material used to verify a linked data proof is called the verification method.

This suite relies on public key material represented using [[MULTIBASE]].

This suite supports public key use for both digital signature verification, according to [[RFC8032]].

This suite MAY be used to verify linked data proofs produced by key material in any representation that can be converted to publicKeyMultibase>, however it is RECOMMENDED that this suite be used with verification method's of type Ed25519VerificationKey2020.

Ed25519VerificationKey2020

The id of the verification method SHOULD be the JWK thumbprint calculated from the publicKeyMultibase property value according to [[MULTIBASE]].

The type of the verification method SHOULD be Ed25519VerificationKey2020.

The controller of the verification method SHOULD be a URI.

The publicKeyMultibase property of the verification method SHOULD be a public key formatted according to [[MULTIBASE]].

Be careful not to accidentally publish a representation of a private key.

            {
              "id": "https://example.com/issuer/123#key-0",
              "type": "Ed25519VerificationKey2020",
              "controller": "https://example.com/issuer/123",
              "publicKeyMultibase": "zgo4sNiXwJTbeJDWZLXVn9uTnRwgFHFxcgDePvEC9TiTYgRpG7q1p5s7yRAic"
            }
          
            {
              "@context": [
                "https://www.w3.org/ns/did/v1",
                {
                  "@base": "did:example:123"
                }
              ],
              "id": "did:example:123",
              "publicKey": [
                {
                  "id": "#key-0",
                  "type": "Ed25519VerificationKey2020",
                  "controller": "did:example:123",
                  "publicKeyMultibase": "zgo4sNiXwJTbeJDWZLXVn9uTnRwgFHFxcgDePvEC9TiTYgRpG7q1p5s7yRAic"
                }
              ],
              "authentication": [
                "#key-0"
              ],
              "assertionMethod": [
                "#key-0"
              ],
              "capabilityDelegation": [
                "#key-0"
              ],
              "capabilityInvocation": [
                "#key-0"
              ]
            }
          

Proof Representation

The cryptographic material used to represent a linked data proof is called the proof type.

This suite relies on detached digital signatures represented using [[MULTIBASE]].

Ed25519 Signature 2020

The verificationMethod property of the proof SHOULD be a URI. Dereferencing the verificationMethod SHOULD result in an object of type Ed25519VerificationKey2020.

The type property of the proof MUST be Ed25519Signature2020.

The created property of the proof MUST be an [[ISO_8601]] formated date string.

The proofPurpose property of the proof MUST be a string, and SHOULD match the verification relationship expressed by the verification method controller.

The signature property of the proof MUST be a detached EdDSA produced according to [[RFC8032]], encoded according to [[MULTIBASE]].

Test Vectors

The following test vectors are provided to assist with implementers.

        {
          "seed_0": "9b937b81322d816cfab9d5a3baacc9b2a5febe4b149f126b3630f93a29527017"
        }        
      
        {
          "keypair_0": {
            "id": "https://example.com/issuer/123#key-0",
            "type": "Ed25519VerificationKey2018",
            "controller": "https://example.com/issuer/123",
            "publicKeyBase58": "dbDmZLTWuEYYZNHFLKLoRkEX4sZykkSLNQLXvMUyMB1",
            "privateKeyBase58": "47QbyJEDqmHTzsdg8xzqXD8gqKuLufYRrKWTmB7eAaWHG2EAsQ2GUyqRqWWYT15dGuag52Sf3j4hs2mu7w52mgps"
          },
          "keypair_1": {
            "id": "https://example.com/issuer/123#key-0",
            "type": "Ed25519KeyPair2020",
            "controller": "https://example.com/issuer/123",
            "publicKeyMultibase": "zgo4sNiXwJTbeJDWZLXVn9uTnRwgFHFxcgDePvEC9TiTYgRpG7q1p5s7yRAic",
            "privateKeyMultibase": "z5LgFTdoZ3hjXbijBYC8qBEEZ1oibq1AKVeSeuw84zgYzUNY2rXKT8xLU41XpMN124wVr26axAPBPiNnR9dvyY7KA9QCmTrxT6yCCJxfS6U5iEBhzfbWqPSazGJ"
          }
        }              
      
        {
          "issuer_0": {
            "@context": [
              "https://www.w3.org/ns/did/v1",
              "https://example.com/credentials/latest",
              {
                "@base": "https://example.com/issuer/123"
              }
            ],
            "id": "https://example.com/issuer/123",
            "publicKey": [
              {
                "id": "#key-0",
                "type": "Ed25519VerificationKey2020",
                "controller": "https://example.com/issuer/123",
                "publicKeyMultibase": "zgo4sNiXwJTbeJDWZLXVn9uTnRwgFHFxcgDePvEC9TiTYgRpG7q1p5s7yRAic"
              }
            ],
            "assertionMethod": ["#key-0"],
            "authentication": ["#key-0"]
          }
        }
        
      
        {
          "vc_template_0": {
            "@context": [
              "https://www.w3.org/2018/credentials/v1",
              "https://www.w3.org/2018/credentials/examples/v1",
              "https://example.com/credentials/latest"
            ],
            "id": "http://example.gov/credentials/3732",
            "type": ["VerifiableCredential", "UniversityDegreeCredential"],
            "issuer": "https://example.com/issuer/123",
            "issuanceDate": "2020-03-10T04:24:12.164Z",
            "credentialSubject": {
              "id": "did:example:456",
              "degree": {
                "type": "BachelorDegree",
                "name": "Bachelor of Science and Arts"
              }
            }
          },
          "vc_0": {
            "@context": [
              "https://www.w3.org/2018/credentials/v1",
              "https://www.w3.org/2018/credentials/examples/v1",
              "https://example.com/credentials/latest"
            ],
            "id": "http://example.gov/credentials/3732",
            "type": ["VerifiableCredential", "UniversityDegreeCredential"],
            "issuer": "https://example.com/issuer/123",
            "issuanceDate": "2020-03-10T04:24:12.164Z",
            "credentialSubject": {
              "id": "did:example:456",
              "degree": {
                "type": "BachelorDegree",
                "name": "Bachelor of Science and Arts"
              }
            },
            "proof": {
              "type": "Ed25519Signature2020",
              "created": "2019-12-11T03:50:55Z",
              "signature": "z5LgmVhjjPTEzGL31k2eEde8bdr4MAzxQv87AmdHt5Usd1uGK1Ae88NoZ5jgTLKS6sJCZnQNthR3qAbyRMxvkqSkss2WtyKLa9rqhJmR6YEBkiuUtxawhrscWXm",
              "proofPurpose": "assertionMethod",
              "verificationMethod": "https://example.com/issuer/123#key-0"
            }
          },
          "vp_0": {
            "@context": [
              "https://www.w3.org/2018/credentials/v1",
              "https://example.com/credentials/latest"
            ],
            "type": ["VerifiablePresentation"],
            "verifiableCredential": [
              {
                "@context": [
                  "https://www.w3.org/2018/credentials/v1",
                  "https://www.w3.org/2018/credentials/examples/v1",
                  "https://example.com/credentials/latest"
                ],
                "id": "http://example.gov/credentials/3732",
                "type": ["VerifiableCredential", "UniversityDegreeCredential"],
                "issuer": "https://example.com/issuer/123",
                "issuanceDate": "2020-03-10T04:24:12.164Z",
                "credentialSubject": {
                  "id": "did:example:456",
                  "degree": {
                    "type": "BachelorDegree",
                    "name": "Bachelor of Science and Arts"
                  }
                },
                "proof": {
                  "type": "Ed25519Signature2020",
                  "created": "2019-12-11T03:50:55Z",
                  "signature": "z5LgmVhjjPTEzGL31k2eEde8bdr4MAzxQv87AmdHt5Usd1uGK1Ae88NoZ5jgTLKS6sJCZnQNthR3qAbyRMxvkqSkss2WtyKLa9rqhJmR6YEBkiuUtxawhrscWXm",
                  "proofPurpose": "assertionMethod",
                  "verificationMethod": "https://example.com/issuer/123#key-0"
                }
              }
            ],
            "id": "ebc6f1c2",
            "holder": "did:ex:12345",
            "proof": {
              "type": "Ed25519Signature2020",
              "created": "2019-12-11T03:50:55Z",
              "verificationMethod": "https://example.com/issuer/123#key-0",
              "proofPurpose": "authentication",
              "challenge": "123",
              "signature": "z5LgJQhEvrLoNqXSbBzFR6mqmBnUefxX6dBjn2A4FYmmtB3EcWC41RmvHARgHwZyuMkR9xMbMCY7Ch4iRr9R8o1JffWY63FRfX3em8f3avb1CU6FaxiMjZdNegc"
            }
          }
        }
        
      

A conforming document is any concrete expression of the data model that complies with the normative statements in this specification. Specifically, all relevant normative statements in Sections and of this document MUST be enforced.

A conforming processor is any algorithm realized as software and/or hardware that generates or consumes a conforming document. Conforming processors MUST produce errors when non-conforming documents are consumed.

This document also contains examples that contain JSON and JSON-LD content. Some of these examples contain characters that are invalid JSON, such as inline comments (//) and the use of ellipsis (...) to denote information that adds little value to the example. Implementers are cautioned to remove this content if they desire to use the information as valid JSON or JSON-LD.

Security Considerations

The following section describes security considerations that developers implementing this specification should be aware of in order to create secure software.

This specification relies on URDNA2015, please review [[RDF-DATASET-NORMALIZATION]].

This specification relies on [[MULTIBASE]] and [[RFC8032]].

TODO: We need to add a complete list of security considerations.