ssi icon indicating copy to clipboard operation
ssi copied to clipboard

Refactor

Open timothee-haudebourg opened this issue 1 year ago • 7 comments

This PR aims at refactoring ssi to make better use of Rust traits.

  • Abstract the credential/presentation types (using traits) to accept user defined types.
  • Unify verifiable claim types (JWT, W3C VC). Have a uniform Verifable<Claims> type family for verifiable claims, independent of the underlying implementation.
  • ~TreeLDR integration~ (although it was one of the main motivation for this refactor, integration with TreeLDR will be de facto possible using the new abstractions. ssi will not depend on TreeLDR).

This is a work in early progress.

Status

Most of the work is completed. There are still some DID methods that needs to be reintroduced. Most of the remaining work is testing everything (and that's a lot).

Below are all the parts that needs to be added or changed in ssi:

  • [x] Generate VC datamodel with TreeLDR
  • [x] JWT VC (new dedicated ssi-vc-jwt library)
    • [x] JWT+LD decoding
    • [x] verification
    • [x] JWT+LD signing
    • [x] encoding
  • [x] Add an independent library for Verification Methods (ssi-verification-methods library), with VMs clearly defined.
    • [x] API design
    • [x] Verification methods implementation
      • [x] EcdsaSecp256k1RecoveryMethod2020
      • [x] EcdsaSecp256k1VerificationKey2019
      • [x] EcdsaSecp256r1VerificationKey2019
      • [x] Ed25519VerificationKey2018
      • [x] Ed25519VerificationKey2020
      • [x] JsonWebKey2020
      • [x] Multikey
      • [x] RsaVerificationKey2018
      • [x] Ed25519PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021
      • [x] P256PublicKeyBLAKE2BDigestSize20Base58CheckEncoded2021
      • [x] TezosMethod2021
      • [x] AleoMethod2021
      • [x] BlockchainVerificationMethod2021
      • [x] Eip712Method2021
  • [x] DIDs (ssi-dids library)
    • [x] Improve the DIDResolver trait
    • [x] Use the ssi-verification-methods library
    • [x] Reintroduce DID methods
      • [x] tz (Tezos)
      • [x] jwk
      • [x] pkh (https://github.com/spruceid/ssi/pull/539)
      • [x] key (https://github.com/spruceid/ssi/pull/540)
      • [x] web (https://github.com/spruceid/ssi/pull/541)
      • [x] ethr (https://github.com/spruceid/ssi/pull/542)
      • [x] ion (https://github.com/spruceid/ssi/pull/543)
      • [x] ~sol~ (deprecate)
      • [x] ~onion~ (deprecate)
      • [x] ~webkey~ (deprecate)
      • [ ] test (test suite? not sure if required)
  • [x] Data Integrity (in the ssi-vc-ldp library)
    • [x] VC decoding from JSON-LD
    • [x] VC encoding
    • [x] CryptographicSuite trait design
    • [x] Cryptosuites implementations
      • [x] EcdsaSecp256k1Signature2019
      • [x] EcdsaSecp256r1Signature2019
      • [x] Ed25519Signature2018
      • [x] Ed25519Signature2020
      • [x] eddsa-2022
      • [x] EthereumEip712Signature2021
      • [x] JsonWebSignature2020
      • [x] RsaSignature2018
      • [x] EcdsaSecp256k1RecoverySignature2020
      • [x] AleoSignature2021
      • [x] Eip712Signature2021
      • [x] EthereumPersonalSignature2021
      • [x] SolanaSignature2021
    • [x] Any VC API
  • [x] Testing

timothee-haudebourg avatar Apr 13 '23 13:04 timothee-haudebourg