Skip to content

Commit

Permalink
docs: updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
andyv09 authored Aug 4, 2022
1 parent 0f738ed commit 53115e2
Showing 1 changed file with 3 additions and 54 deletions.
57 changes: 3 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,9 @@
## SSI Snap
# SSI Snap

The SSI Snap is a MetaMask Snap that enhances MetaMask with functionality to manage DIDs, VCs and VPs. SSI Snap uses DID:ETHR method.

## Snap Architecture
## [Documentation](https://blockchain-lab-um.github.io/ssi-snap-docs/)

Veramo client powers the SSI Snap. It is used to manage DIDs and VCs, using Veramos DIDManager, KeyManager and PrivateKeyManager plugins and our custom <a href="https://github.com/blockchain-lab-um/veramo-vc-manager">VCManager plugin</a>. Currently, all data is stored in the MetaMask state, using custom data store plugins. Due to very extensible nature of these plugins we'll implement various other ways of storing data in the future, starting with cloud storing functionality, which should also make syncing between wallets possible. Users will get to configure how the data is stored.
## [Demo](https://blockchain-lab-um.github.io/course-dapp/)

In order to maintain as much security as possible, the private keys from MetaMask accounts are not exposed. An additional DID (new DID is generated for every MM account that wants to use VCs) is used instead. At the moment, these DIDs are used exclusively for generating VPs and need to be linked with a MetaMask accounts DID (added as a delegate to the DID document of a MetaMask account) for workflow to work properly.

![SSI Snap Architecture](https://i.imgur.com/YiAnoly.png)

#### State Structure

As previously mentioned, SSI Snap utilizes MetaMask's state to store information.

MetaMask state structure:

```
{
...,
SSISnapState:
{
0xBea807A8...e59D:
{
snapKeyStore: Record<string, IKey>,
identifiers: Record<string, IIdentifier>,
vcs: VerifiableCredential[]
},
0x8Db2a08D...caD7:
{
snapKeyStore: Record<string, IKey>,
identifiers: Record<string, IIdentifier>,
vcs: VerifiableCredential[]
},
...,
},
}
```

#### RPC Methods

Some methods require parameters.

Method `getDIDAddress` is used to get the newly generated DID for a MetaMask account. If this DID does not exist yet, it is generated. <i>This address is needed to add the newly generated DID as a delegate to the DID document of the currently selected MetaMask account. </i>

Method `saveVC` is used to save a VC in the state of the currently selected MetaMask account. Additional parameter `VC` is required.

Method `getVCs` is used to get a list of VCs from the state of the currently selected MetaMask account. <i> Currently, the only way to select a VC, for which you want to generate a VP, is through the dApp. This will change once MetaMask allows Snaps to implement custom UI elements and enable VC selection directly in MetaMask </i>

Method `getVP` is used to get a VP for a specific VC. Additional parameter `VC_ID` is needed.


#### Encryption & Decryption

MetaMask state is encrypted

#### Verifiable Presentations

Supports the same types of VPs as Veramo client.

0 comments on commit 53115e2

Please sign in to comment.