diff --git a/.changeset/green-news-whisper.md b/.changeset/green-news-whisper.md new file mode 100644 index 000000000..61f7c8f58 --- /dev/null +++ b/.changeset/green-news-whisper.md @@ -0,0 +1,5 @@ +--- +'@blockchain-lab-um/masca-docs': patch +--- + +Reorder and improves some integration sections. diff --git a/.changeset/swift-cherries-push.md b/.changeset/swift-cherries-push.md new file mode 100644 index 000000000..2c93d6897 --- /dev/null +++ b/.changeset/swift-cherries-push.md @@ -0,0 +1,5 @@ +--- +'@blockchain-lab-um/masca-docs': patch +--- + +Add separate Polygon ID and OID4VC sections. diff --git a/packages/docs/docs/apps/_category_.json b/packages/docs/docs/apps/_category_.json index 0db466ddc..7a6376057 100644 --- a/packages/docs/docs/apps/_category_.json +++ b/packages/docs/docs/apps/_category_.json @@ -1,6 +1,6 @@ { "label": "Apps", - "position": 8, + "position": 7, "link": { "type": "generated-index", "description": "List of all applications that integrated Masca." diff --git a/packages/docs/docs/getting-started.md b/packages/docs/docs/getting-started.md deleted file mode 100644 index 41205c0d6..000000000 --- a/packages/docs/docs/getting-started.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -sidebar_position: 2 ---- - -# Getting Started - -Masca is a **MetaMask Snap** (extension) that supports **Decentralized Identity**, enabling the management of **DIDs**, creating and storing **VCs**, and creating **VPs**. It can also be used to **validate** VCs and VPs and **resolve DIDs**. It is designed to be blockchain-agnostic. - -#### With Masca being a MetaMask extension, developers can effortlessly implement its features into any dApp that already supports MetaMask and does not require users to install or use any additional Software! - -You can find more information [here](category/decentralized-or-self-sovereign-identity-ssi) if you're unsure what Decentralized or Self-Sovereign Identity is. - ---- - -## User - -### How to start using Masca? - -Masca currently works only on **MetaMask Flask**. You can find it [here](https://metamask.io/flask/). Snaps are expected to be supported in the production MetaMask sometime in the second half of 2023. With that said, users will be able to connect to any dApp using Masca without any additional steps or software. - -### Configuration dApp - -We implemented an easy-to-use [dApp to configure Masca](https://masca.io) according to your needs and display your data. You can find the source code [here](https://github.com/blockchain-lab-um/masca). - -### Demo Platform - -We have also created a simple [Solidity Course demo dApp](https://blockchain-lab-um.github.io/course-dapp/) where you can receive your first VC and start building your decentralized identity! - ---- - -## Developer - -### Supporting Masca in your dApp - -dApps can access Masca functionalities using the RPC methods like standard MetaMask/Ethereum ones. We have also developed an easy-to-use SDK **[Masca Connector](libraries/masca-connector)** to ease integration. The SDK provides all the functionalities to install Masca in a dApp and exposes an API for interacting with it. - -Installing Masca Connector to your project: - -```shell -pnpm add @blockchain-lab-um/masca-connector -``` - -Masca installs and initializes using the function `enableMasca` . After the installation, `enableMasca` returns the `Masca` object used to retrieve the API. - -A minimal example of initializing Masca and invoking one of the API methods: - -```typescript -import { enableMasca, isError } from '@blockchain-lab-um/masca-connector'; - - -// Connect wallet & get Address -const address = await window.ethereum.request({ - method: 'eth_requestAccounts', -}); - -// Install Masca and retrieve the API interface -const masca = await enableMasca(address[0]); - -if(isError(masca)){ - console.error(masca.error); - return; -} - -const api = masca.data.getMascaApi(); - -// Invoke the API -const vcs = await api.queryCredentials(); - -if(isError(masca)){ - console.error(vcs.error); - return; -} - -console.log('list of VCs:', vcs.data); -``` - -Jump to [**Masca Connector**](libraries/masca-connector) for more detailed documentation. - -### Working with decentralized identity (DIDs, VCs, and VPs) - -**Masca** serves as a snap for a user in the [SSI trust model](ssi/trust-model.md). Components of the SSI trust model are also issuers issuing VCs and verifiers verifying VPs. It is up to you as a dApp developer to define how/if you will issue VCs or how you will verify VPs and check their validity (scheme, subject, controller, content, etc.). We are also actively developing Issuer as a Service (ISSaaS) and Verifier as a Service (VaaS) methodologies, which will ensure seamless integration and easy deployment of these services with minimal technical configuration requirements. We strive to provide a plug-and-play experience, enabling users to leverage these services with minimal effort. - -In the meantime, we recommend using **[Veramo Framework](https://veramo.io/)**. You can also examine our **[issuer's source code](https://github.com/blockchain-lab-um/course-backend)** used in our [Solidity Course demo dApp](https://blockchain-lab-um.github.io/course-dapp/). diff --git a/packages/docs/docs/integrate-masca/_category_.json b/packages/docs/docs/integrate-masca/_category_.json new file mode 100644 index 000000000..d2adb742b --- /dev/null +++ b/packages/docs/docs/integrate-masca/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Integrate Masca", + "position": 3, + "link": { + "type": "generated-index", + "description": "Learn how to integrate Masca into your application." + } +} diff --git a/packages/docs/docs/tutorial/implementation.md b/packages/docs/docs/integrate-masca/masca-connector.md similarity index 61% rename from packages/docs/docs/tutorial/implementation.md rename to packages/docs/docs/integrate-masca/masca-connector.md index 5a980281f..60a693b61 100644 --- a/packages/docs/docs/tutorial/implementation.md +++ b/packages/docs/docs/integrate-masca/masca-connector.md @@ -1,60 +1,12 @@ --- -sidebar_position: 1 +sidebar_position: 4 --- -# How To Implement It? +# Using Masca connector SDK -**Masca** is a MetaMask Snap, that can handle **DIDs**, securely store **VCs**, create **VPs** and is designed to be blockchain-agnostic. +## Account Switching -:::danger BE CAREFUL! - -Ceramic Network support is experimental and still under development! - -::: - -## Integrating Masca into a dApp - -### Using the Masca Connector - -```bash -pnpm add @blockchain-lab-um/masca-connector -``` - -Connector has an exposed function for installing the Masca snap. For ease of use, the connector package also exposes all the functions and types from `@blockchain-lab-um/masca-types` and `@blockchain-lab-um/utils` NPM packages. - -After Masca installation, this function returns a `Masca` object that can be used to retrieve Masca API. -An example of initializing Masca and invoking Masca's API is shown below. - -For Masca to work properly, it needs to know the address of the connected account. Initially this can be done by passing the address as a parameter to `enableMasca` function. Later, the address can be changed using the `setCurrentAccount` RPC method! - -```typescript -import { enableMasca, isError } from '@blockchain-lab-um/masca-connector'; - -// Install snap and fetch the Masca API -const masca = await enableMasca(address, { - snapId: snapId, - version: 'latest', - supportedMethods: ['did:ethr', 'did:key'], -}); - -// Check if the RPC method failed -if(isError(masca)) { - console.error(setAccountRes.error); - return; -} - -const api = await masca.data.getMascaApi(); -``` - -Every RPC call will return an object that can be Success or Error. More on error handling can be found [here](./../masca/architecture). - -Masca Connector will take care of initializing Masca for other DID methods (needed to extract the public key) during the enableMasca function. - -#### Jump [here](../libraries/masca-connector) for a more detailed look at Masca Connector! - -### Account Switching - -Account switching must be handled by the dApp! This is required for Masca to work properly. Without approprietly calling this method, switching Accounts in MetaMask will NOT result in switching accounts in Masca! We recommend using the `window.ethereum.on('accountsChanged', handler: (accounts: Array);` . More on this can be found [here](https://docs.metamask.io/wallet/reference/provider-api/#accountschanged). +Account switching must be handled by the dApp! This is required for Masca to work properly. Without approprietly calling this method, switching Accounts in MetaMask will NOT result in switching accounts in Masca! We recommend using the `window.ethereum.on('accountsChanged', handler: (accounts: Array);`. More on this can be found [here](https://docs.metamask.io/wallet/reference/provider-api/#accountschanged). ```typescript // When account changes in dApp @@ -68,10 +20,9 @@ window.ethereum.on('accountsChanged', (...accounts) => { return; } }); - ``` -### Save VC +## Save VC `saveCredential` is used to save a VC under the currently selected MetaMask account. Parameter `vc` is a `W3CVerifiableCredential` VC. Invalid format might lead to failure when generating VPs. We recommend using Veramo to generate VCs with this [interface](https://veramo.io/docs/api/core.verifiablecredential). Optional parameter `options` defines where the VC will get saved. VC can be stored in one or more places at the same time. @@ -81,9 +32,9 @@ const res = await api.saveCredential(verifiableCredential, { }); ``` -### Query VCs +## Query VCs -`queryCredentials` is used to get a list of VCs stored by the currently selected MetaMask account. Optional parameter `params` is an object with optional properties `filter` and `options` . +`queryCredentials` is used to get a list of VCs stored by the currently selected MetaMask account. Optional parameter `params` is an object with optional properties `filter` and `options`. Filter defines what `queryCredentials` returns and Options defines where to search for data and what format to return it in. @@ -102,11 +53,11 @@ type QueryCredentialsRequestParams = { }; ``` -Currently, 3 different `filter` types are supported; `none` , `id` , and `JSONPath` . Type `none` will work as if no filter property was provided, `id` will search for matching ID of VC and `JSONPath` will use [ `jsonpath` ](https://www.npmjs.com/package/jsonpath) lib to find matching VCs. +Currently, 3 different `filter` types are supported; `none`, `id`, and `JSONPath`. Type `none` will work as if no filter property was provided, `id` will search for matching ID of VC and `JSONPath` will use [ `jsonpath` ](https://www.npmjs.com/package/jsonpath) lib to find matching VCs. -In the case of `id` , `filter.filter` is a string of an id. +In the case of `id`, `filter.filter` is a string of an id. -In the case of `JSONPath` , `filter.filter` is a string containing JSONPath string. +In the case of `JSONPath`, `filter.filter` is a string containing JSONPath string. :::info Note @@ -137,11 +88,11 @@ const vcs = await api.queryCredentials({ console.log('VCs', vcs.data); -// To return every VC +// To get all VCs const vcs = await api.queryCredentials(); ``` -### Create VP +## Create VP `createPresentation` is used to get a VP for one or more specific VCs. Params object is of type: @@ -157,11 +108,11 @@ export type CreatePresentationRequestParams = { }; ``` -`vcs` is a list of VCs of type `W3CVerifiableCredential` . +`vcs` is a list of VCs of type `W3CVerifiableCredential`. -`proofFormat` can be `jwt` , `jsonld` or `EthereumEip712Signature2021` . +`proofFormat` can be `jwt`, `jsonld` or `EthereumEip712Signature2021`. -`options` is optional and is used to define `domain` , `type` and `challenge` if needed. +`options` is optional and is used to define `domain`, `type` and `challenge` if needed. `holder` of the VP will be a DID generated based on currently selected MetaMask account **AND** currently selected DID Method. @@ -176,7 +127,7 @@ const vp = await api.createPresentation({ }); ``` -### Create VC +## Create VC `createCredential` is used to return a VC created from the provided payload. This VC can be optionally stored in Masca. @@ -207,11 +158,11 @@ const res = await api.createCredential({ }); ``` -`minimalUnsignedCredential` is a minimal object which is used to create a VC. It needs to contain at least `credentialSubject` , `type` & `@context` . +`minimalUnsignedCredential` is a minimal object which is used to create a VC. It needs to contain at least `credentialSubject`, `type` & `@context`. `proofFormat` is used to specify which proof format is used to sign the VC. `options` allow dApps to specify whether they want and where they want to store the VC. -### Delete VC +## Delete VC `deleteCredential` is used to delete a VC from one or more stores @@ -223,7 +174,7 @@ const res = await api.createCredential({ const res = await api.deleteCredential('123', { store: 'snap' }); ``` -### DIDs +## DIDs `getDID` and `getSelectedMethod` are used to get current did and currently selected did method. @@ -233,7 +184,7 @@ const res = await api.getDID(); const res = await api.getSelectedMethod(); ``` -### Supported DID Methods and VC Stores +## Supported DID Methods and VC Stores `getAvailableCredentialStores` and `getAvailableMethods` are used to get all supported methods and vcstores @@ -243,7 +194,7 @@ const supportedMethods = await api.getAvailableMethods(); const supportedStores = await api.getAvailableCredentialStores(); ``` -### Switch DID Method +## Switch DID Method `switchMethod` is used to switch the currently selected DID method. @@ -251,7 +202,7 @@ const supportedStores = await api.getAvailableCredentialStores(); await api.switchMethod('did:key'); ``` -### Configure VC Stores +## Configure VC Stores `setCredentialStore` is used to enable/disable a specific VC store. By default both snap & ceramic are enabled! @@ -259,7 +210,7 @@ await api.switchMethod('did:key'); const res = await api.setCredentialStore('ceramic', false); ``` -### Resolve DID +## Resolve DID `resolveDID` is used to resolve a specified DID and returns `DIDResolutionResult` which contains DID Document, if the resolution is successful. @@ -267,7 +218,7 @@ const res = await api.setCredentialStore('ceramic', false); const didRes = await api.resolveDID('did:ethr:0x01:0x123...4567'); ``` -### Verify Data +## Verify Data `verifyData` is used to verify a VC or a VP in Masca. @@ -279,7 +230,7 @@ const vcRes = await api.verifyData({ credential: VC, verbose: true }); const vpRes = await api.verifyData({ presentation: VP, verbose: true }); ``` -### Snap Settings +## Snap Settings `togglePopups` is used to enable/disable the `"Are you sure?"` alerts on any dApp. Pop-ups are enabled by default for user to approve every action. @@ -301,47 +252,8 @@ const res = await api.removeFriendlyDapp("https://www.masca.io"); const res = await api.getSnapSettings(); const res = await api.getAccountSettings(); - -``` - -### Handle Credential Offer - -`handleCredentialOffer` is used to handle either Polygon ID or OIDC credentials offers - -Successful response includes `VerifiableCredential[]` - -**Important:** The credential offer must be handled by the user on the correct network and with the correct did method selected. - -```typescript -const res = await api.handleCredentialOffer({ - credentialOffer: data, // request in string format -}); - -if (isSuccess(res)) { - // Here you can loop through the received credentials and save them - const recievedCredentials = res.data; - - // Loop credentials - for (const credential of recievedCredentials) { - const saveCredentialResult = await api.saveCredential(credential, { - store: 'snap', - }); - } -} -``` - -### Handle Authorization Request - -`handleAuthorizationRequest` is used to handle either Polygon ID or OIDC authorization requests - -**Important:** The authorization request must be handled by the user on the correct network and with the correct did method selected. - -```typescript -const res = await api.handleAuthorizationRequest({ - authorizationRequest: data, // request in string format -}); ``` -### Working with VCs +## Working with VCs It is up to the dApp to issue VCs and/or request VPs/VCs and verify their validity (scheme, subject, controller, content, etc.). We recommend using the [Veramo Framework](https://veramo.io/). diff --git a/packages/docs/docs/integrate-masca/oid4vc.md b/packages/docs/docs/integrate-masca/oid4vc.md new file mode 100644 index 000000000..10777fe23 --- /dev/null +++ b/packages/docs/docs/integrate-masca/oid4vc.md @@ -0,0 +1,60 @@ +--- +sidebar_position: 3 +--- + +# OpenID for Verifiable Credentials + +## Introduction + +Masca offers comprehensive support for OpenID for Verifiable Credentials [specifications](https://openid.net/sg/openid4vc/specifications/). Masca streamlines the process of receiving credentials from compliant issuers and seamlessly sharing presentations with compliant verifiers. The specifications include a concept called Profiles, which are predefined ways to adapt to different Credential formats using specific extension points. Masca supports the EBSI profile, which was rigorously tested using their [conformance testing service](https://api-conformance.ebsi.eu/docs/wallet-conformance/holder-wallet). Looking ahead, our roadmap involves expanding our capabilities to encompass emerging profiles as we closely monitor the [OpenID Connect Working group](https://openid.net/wg/digital-credentials-protocols/). We're eagerly anticipating the delivery of a comprehensive conformance test suite from this group to further validate and enhance our software's compatibility and interoperability. + +Additionally, it's important to note that the OID4VC specifications heavily rely on redirects, which Masca cannot accommodate. This might cause certain flows to not function as expected. We're currently exploring solutions to address this challenge. One such solution already in place involves using a proxy to redirect some requests, instead of calling the issuers and verifiers directly. + +## Integration + +### Handling of credential offers + +This part handles credential offers, which are recieved from issuers. + +```typescript +// The credential offer recieved from an issuer +// The credential offer is a URI string +// Here is an example credential offer from the EBSI conformance testing service +const credentialOffer: string = + 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fapi-conformance.ebsi.eu%2Fconformance%2Fv3%2Fissuer-mock%2Foffers%2F6b9afdfe-69d1-4efd-aad0-da7249c07c8b'; + +const handleCredentialOfferResponse = api.handleCredentialOffer({ + credentialOffer, +}); + +// Check if there was an error and handle it accordingly +if (isError(handleCredentialOfferResponse)) {...} + +// Recieved credentials +const recievedCredentials: VerifiableCredential[] = handleCredentialOfferResponse.data; + +// Loop credentials and save them in Masca storage +for (const credential of recievedCredentials) { + const saveCredentialResult = await api.saveCredential(credential, { + store: 'snap', + }); +} +``` + +### Handling of authorization requests + +This part handles authorization requests, which are recieved from Polygon ID verifiers. + +```typescript +// The authorization request recieved from a verifier +// The authorization request is a URI string +const authorizationRequest: string = + 'openid://?state=b17f79e3-8192-4fc5-a0a8-5e4c00adbab2&client_id=https%3A%2F%2Fapi-conformance.ebsi.eu%2Fconformance%2Fv3%2Fauth-mock&redirect_uri=https%3A%2F%2Fapi-conformance.ebsi.eu%2Fconformance%2Fv3%2Fauth-mock%2Fdirect_post&response_type=vp_token&response_mode=direct_post&scope=openid&nonce=24138beb-28e2-4096-b51c-bd2eaf27b034&presentation_definition=...'; + +const handleAuthorizationRequestResponse = api.handleAuthorizationRequest({ + authorizationRequest, +}); + +// Check if there was an error and handle it accordingly +if (isError(handleAuthorizationRequestResponse)) {...} +``` diff --git a/packages/docs/docs/integrate-masca/polygonid.md b/packages/docs/docs/integrate-masca/polygonid.md new file mode 100644 index 000000000..c88e93be4 --- /dev/null +++ b/packages/docs/docs/integrate-masca/polygonid.md @@ -0,0 +1,59 @@ +--- +sidebar_position: 2 +--- + +# Polygon ID + +## Introduction + +Masca supports Polygon ID protocol - receiving Verifiable Credentials from issuer nodes and presenting proofs to verifiers. + +## Integration + +For successfull management of requests involving receiving credentials and generating zkProofs, users must ensure they are operating on the same network as the issuer or verifier node from which they received the request. + +### Handling of credential offers + +This part handles credential offers, which are recieved from Polygon ID issuers. + +```typescript +// The credential offer recieved from a Polygon ID issuer +// The credential offer is a JSON string +const credentialOffer: string = + '{"body":{"credentials":[{"description":"KYCAgeCredential","id":"348a8620-40fd-11ee-beda-0242ac1d0006"}],"url":"https://dev.polygonid.me/api/v1/agent"},"from":"did:polygonid:polygon:mumbai:2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy","id":"3a0fbba4-601c-4773-baca-0b8f0cfc7f43","thid":"3a0fbba4-601c-4773-baca-0b8f0cfc7f43","to":"did:polygonid:polygon:main:2q6KWUhghmPGRuh8GFMzDX3EYp1WVspWN9ZdQEk4D2","typ":"application/iden3comm-plain-json","type":"https://iden3-communication.io/credentials/1.0/offer"}'; + +const handleCredentialOfferResponse = api.handleCredentialOffer({ + credentialOffer, +}); + +// Check if there was an error and handle it accordingly +if (isError(handleCredentialOfferResponse)) {...} + +// Recieved credentials +const recievedCredentials: VerifiableCredential[] = handleCredentialOfferResponse.data; + +// Loop credentials and save them in Masca storage +for (const credential of recievedCredentials) { + const saveCredentialResult = await api.saveCredential(credential, { + store: 'snap', + }); +} +``` + +### Handling of authorization requests + +This part handles authorization requests, which are recieved from Polygon ID verifiers. + +```typescript +// The authorization request recieved from a Polygon ID verifier +// The authorization request is a JSON string +const authorizationRequest: string = + '{"body":{"callbackUrl":"https://issuer-v2.polygonid.me/api/callback?sessionId=334944","reason":"test flow","scope":[]},"from":"did:polygonid:polygon:mumbai:2qLPqvayNQz9TA2r5VPxUugoF18teGU583zJ859wfy","id":"ea786170-f45f-4f13-b631-c4a7bbc03905","thid":"ea786170-f45f-4f13-b631-c4a7bbc03905","typ":"application/iden3comm-plain-json","type":"https://iden3-communication.io/authorization/1.0/request"}'; + +const handleAuthorizationRequestResponse = api.handleAuthorizationRequest({ + authorizationRequest, +}); + +// Check if there was an error and handle it accordingly +if (isError(handleAuthorizationRequestResponse)) {...} +``` diff --git a/packages/docs/docs/tutorial/rpc-methods.md b/packages/docs/docs/integrate-masca/rpc-methods.md similarity index 83% rename from packages/docs/docs/tutorial/rpc-methods.md rename to packages/docs/docs/integrate-masca/rpc-methods.md index c72825c93..0b913e7ec 100644 --- a/packages/docs/docs/tutorial/rpc-methods.md +++ b/packages/docs/docs/integrate-masca/rpc-methods.md @@ -1,10 +1,11 @@ --- -sidebar_position: 2 +sidebar_position: 5 --- -# JSON-RPC API +# Using the JSON-RPC API -You can find all of the types mentioned below in the library `@blockchain-lab-um/masca-types` . +This section describes how to call Masca RPC methods, without the usage of the [Masca Connector SDK](/docs/libraries/masca-connector.md). +You can find all of the types mentioned below in the `@blockchain-lab-um/masca-types` library. ## VC Methods @@ -12,13 +13,13 @@ You can find all of the types mentioned below in the library `@blockchain-lab-um #### Description -`saveCredential` stores a VC in Masca. VC can be saved in one or more supported stores. +`saveCredential` stores a VC in Masca. The VC can be saved in one or more supported stores. #### Parameters 1. `verifiableCredential` - type `W3CVerifiableCredential` from `@veramo/core` 2. `options?` - `SaveCredentialRequestParams`. - 1. `store?` - `string` or `string[]` . Defines where to store the VC. + 1. `store?` - `string` or `string[]`. Defines where to store the VC. ```typescript const response = await ethereum.request({ @@ -28,7 +29,7 @@ const response = await ethereum.request({ request: { method: 'saveCredential', params: { - verifiableCredential: vc, + verifiableCredential, }, }, }, @@ -43,17 +44,17 @@ const response = await ethereum.request({ #### Description -`queryCredentials` gets a list of VCs stored by the currently selected MetaMask account. Optional parameter `params` is an `object` with optional properties `filter` , and `options` . +`queryCredentials` gets a list of VCs stored by the currently selected MetaMask account. Optional parameter `params` is an `object` with optional properties `filter`, and `options`. `filter` defines what `queryCredentials` returns, and `options` defines where to search for data and what format to return it in. `QueryCredentialsRequestParams` : -Currently, three different `filter` types are supported; `none` , `id` , and `JSONPath` . Type `none` will work as if no filter property was provided, `id` will search for matching ID of VC and `JSONPath` will use [ `jsonpath` ](https://www.npmjs.com/package/jsonpath) to find matching VCs. +Currently, three different `filter` types are supported; `none`, `id`, and `JSONPath`. Type `none` will work as if no filter property was provided, `id` will search for matching ID of VC and `JSONPath` will use [ `jsonpath` ](https://www.npmjs.com/package/jsonpath) to find matching VCs. -In the case of `id` , `filter.filter` is an id `string` . +In the case of `id`, `filter.filter` is an id `string`. -In the case of `JSONPath` , `filter.filter` is a `string` containing JSONPath `string` . +In the case of `JSONPath`, `filter.filter` is a `string` containing JSONPath `string`. :::info NOTE @@ -132,7 +133,7 @@ const response = await ethereum.request({ #### Returns -`boolean[]` - `true` , if VC deleted from store X, `false` if there was an error, or a VC was not found. +`boolean[]` - `true`, if VC deleted from store X, `false` if there was an error, or a VC was not found. ### createCredential @@ -151,7 +152,7 @@ const response = await ethereum.request({ ```typescript const payload: MinimalUnsignedCredential = { - type: ['VerifiableCredential', 'Test Certificate'], + type: ['VerifiableCredential', 'TestCertificate'], credentialSubject: { accomplishmentType: 'Test Certificate', id: 'did:ethr:goerli:0x123...321', @@ -214,11 +215,11 @@ export type VCRequest = { }; ``` -`vcs` is of type `W3CVerifiableCredential[]` . +`vcs` is of type `W3CVerifiableCredential[]`. -`proofFormat` can be `jwt` , `jsonld` or `EthereumEip712Signature2021` . +`proofFormat` can be `jwt`, `jsonld` or `EthereumEip712Signature2021`. -`options?` defines `domain` , `type` , and `challenge` if needed. +`options?` defines `domain`, `type`, and `challenge` if needed. `holder` of the VP will be a DID generated based on the currently selected MetaMask account **AND** the currently set DID Method. @@ -253,6 +254,41 @@ const response = await ethereum.request({ `VerifiablePresentation` +### verifyData + +#### Description + +`verifyData` verify a VC or a VP validity. + +#### Parameters + +1. `presentation` - `W3CVerifiablePresentation` object + OR +2. `credential` - `W3CVerifiableCredential` object +3. `verbose?` - `boolean` that changes the return value of this method + +```typescript +const response = await ethereum.request({ + method: 'wallet_invokeSnap', + params: { + snapId: snapId, + request: { + method: 'verifyData', + params: { + credential: VC, + verbose: true, + }, + }, + }, +}); +``` + +#### Returns + +`boolean` - `true` if VC/VP is valid, `false` otherwise. + +If `verbose` is set to `true`, it returns `IVerifyResult` instead, which also contains an Error message. + ## DID Methods ### getDID @@ -338,6 +374,35 @@ const response = await ethereum.request({ }); ``` +### resolveDID + +#### Description + +`resolveDID` resolves a DID. + +#### Parameters + +1. `did` - DID `string`. + +```typescript +const response = await ethereum.request({ + method: 'wallet_invokeSnap', + params: { + snapId: snapId, + request: { + method: 'resolveDID', + params: { + did: 'did:ethr:0x01:0x123...321', + }, + }, + }, +}); +``` + +#### Returns + +`DIDResolutionResult`, containing DID Document if successful. + ## VC Store Methods ### getCredentialStore @@ -373,12 +438,6 @@ A `Record` of `CredentialStores[]` and whether or not they're enabled. By defaul 1. `store` - name of the VC Store plugin (`"snap"` or `"ceramic"`). Must be one of methods returned by `getAvailableCredentialStores`. 2. `value` - `boolean`. Enable/disable specific store plugins. -:::danger BE CAREFUL! - -Ceramic Network support is experimental and still under active development! - -::: - ```typescript const response = await ethereum.request({ method: 'wallet_invokeSnap', @@ -423,11 +482,11 @@ const response = await ethereum.request({ ## Snap Methods -### togglePopups +### setCurrentAccount #### Description -`togglePopups` toggles pop-ups that show up whenever the user tries to save a VC, generate a VP, etc. Pop-ups are enabled by default to keep user in total control of their actions. With pop-ups disabled, a dApp can query user's credentials, etc. without them knowing. We recommend using `addFriendlyDapp` instead to only trust specific dApps. +`setCurrentAccount` sets the account in Masca. This is required for Masca to work properly. Without appropriately calling this method, switching accounts in MetaMask will **NOT** result in switching accounts in Masca! ```typescript const response = await ethereum.request({ @@ -435,35 +494,34 @@ const response = await ethereum.request({ params: { snapId: snapId, request: { - method: 'togglePopups', + method: 'setCurrentAccount', + params: { + currentAccount: '0x123...321', + }, }, }, }); ``` -### addFriendlyDapp +#### Parameters -#### Description +1. `currentAccount` - `string` of address of the account to set as current. -`addFriendlyDapp` adds the current dApp (origin of the current dApp) to the list of friendly dApps. Friendly dApps do not show pop-ups. +#### Returns -```typescript -const response = await ethereum.request({ - method: 'wallet_invokeSnap', - params: { - snapId: snapId, - request: { - method: 'addFriendlyDapp', - }, - }, -}); -``` +`boolean` + +:::info NOTE + +We recommend calling this method in `window.ethereum.on('accountsChanged', handler: (accounts: Array);`. See [Account Switching](/docs/integrate-masca/masca-connector.md#account-switching). + +::: ### togglePopups #### Description -`removeFriendlyDapp` removes a dApp from friendly dApps. +`togglePopups` toggles pop-ups that show up whenever the user tries to save a VC, generate a VP, etc. Pop-ups are enabled by default to keep user in total control of their actions. With pop-ups disabled, a dApp can query user's credentials, etc. without them knowing. We recommend using `addFriendlyDapp` instead to only trust specific dApps. ```typescript const response = await ethereum.request({ @@ -471,24 +529,17 @@ const response = await ethereum.request({ params: { snapId: snapId, request: { - method: 'removeFriendlyDapp', - params: { - dApp: 'https://www.masca.io', - }, + method: 'togglePopups', }, }, }); ``` -### resolveDID +### addFriendlyDapp #### Description -`resolveDID` resolves a DID. - -#### Parameters - -1. `did` - DID `string`. +`addFriendlyDapp` adds the current dApp (origin of the current dApp) to the list of friendly dApps. Friendly dApps do not show pop-ups. ```typescript const response = await ethereum.request({ @@ -496,31 +547,17 @@ const response = await ethereum.request({ params: { snapId: snapId, request: { - method: 'resolveDID', - params: { - did: 'did:ethr:0x01:0x123...321', - }, + method: 'addFriendlyDapp', }, }, }); ``` -#### Returns - -`DIDResolutionResult` , containing DID Document if successful. - -### verifyData +### removeFriendlyDapp #### Description -`verifyData` verify a VC or a VP validity. - -#### Parameters - -1. `presentation` - `W3CVerifiablePresentation` object - OR -2. `credential` - `W3CVerifiableCredential` object -3. `verbose?` - `boolean` that changes the return value of this method +`removeFriendlyDapp` removes a dApp from friendly dApps. ```typescript const response = await ethereum.request({ @@ -528,22 +565,15 @@ const response = await ethereum.request({ params: { snapId: snapId, request: { - method: 'verifyData', + method: 'removeFriendlyDapp', params: { - credential: VC, - verbose: true, + dApp: 'https://www.masca.io', }, }, }, }); ``` -#### Returns - -`boolean` - `true` if VC/VP is valid, `false` otherwise. - -If `verbose` is set to `true` , it returns `IVerifyResult` instead, which also contains an Error message. - ### getAccountSettings #### Description @@ -610,11 +640,11 @@ export type MascaConfig = { }; ``` -### setCurrentAccount +### setCeramicSession #### Description -`setCurrentAccount` sets the account in Masca. This is required for Masca to work properly. Without appropriately calling this method, switching accounts in MetaMask will **NOT** result in switching accounts in Masca! +`setCeramicSession` sets the Ceramic session. As an Ethereum account handles storing and retrieving items from Ceramic, generating a session has to be done manually by a dApp. This is already handled in our Masca Connector. You can follow our [implementation in the connector](https://github.com/blockchain-lab-um/masca/blob/744b2e651dda15e7b44af894294692925c9a4964/packages/connector/src/utils.ts#L14) to implement this yourself. ```typescript const response = await ethereum.request({ @@ -622,34 +652,50 @@ const response = await ethereum.request({ params: { snapId: snapId, request: { - method: 'setCurrentAccount', + method: 'setCeramicSession', params: { - currentAccount: '0x123...321', + serializedSession: '...', }, }, }, }); ``` -#### Parameters - -1. `currentAccount` - `string` of address of the account to set as current. - #### Returns `boolean` -:::info NOTE +### validateStoredCeramicSession -We recommend calling this method in `window.ethereum.on('accountsChanged', handler: (accounts: Array);` . See [Account Switching](./implementation.md#account-switching). +#### Description -::: +`validateStoredCeramicSession` checks if there is an existing ceramic session set in Masca and if it's still valid. If this method returns `false`, the session must be set to use Ceramic! -### setCeramicSession +```typescript +const response = await ethereum.request({ + method: 'wallet_invokeSnap', + params: { + snapId: snapId, + request: { + method: 'validateStoredCeramicSession', + }, + }, +}); +``` + +#### Returns + +`boolean` + +### handleCredentialOffer #### Description -`setCeramicSession` sets the Ceramic session. As an Ethereum account handles storing and retrieving items from Ceramic, generating a session has to be done manually by a dApp. This is already handled in our Masca Connector. You can follow our [implementation in the connector](https://github.com/blockchain-lab-um/masca/blob/744b2e651dda15e7b44af894294692925c9a4964/packages/connector/src/utils.ts#L14) to implement this yourself. +`handleCredentialOffer` handles credential offers recieved from Polygon ID or OIDC issuers. + +#### Parameters + +1. `credentialOffer` - `string` (JSON string recieved from the issuer) ```typescript const response = await ethereum.request({ @@ -657,9 +703,9 @@ const response = await ethereum.request({ params: { snapId: snapId, request: { - method: 'setCeramicSession', + method: 'handleCredentialOffer', params: { - serializedSession: '...', + credentialOffer: '...', }, }, }, @@ -668,13 +714,17 @@ const response = await ethereum.request({ #### Returns -`boolean` +`VerifiableCredential[]>` -### validateStoredCeramicSession +### handleAuthorizationRequest #### Description -`validateStoredCeramicSession` checks if there is an existing ceramic session set in Masca and if it's still valid. If this method returns `false` , the session must be set to use Ceramic! +`handleAuthorizationRequest` handles authorization requests recieved from Polygon ID or OIDC verifiers. + +#### Parameters + +1. `authorizationRequest` - `string` (JSON string recieved from the verifier) ```typescript const response = await ethereum.request({ @@ -682,12 +732,11 @@ const response = await ethereum.request({ params: { snapId: snapId, request: { - method: 'validateStoredCeramicSession', + method: 'handleAuthorizationRequest', + params: { + authorizationRequest: '...', + }, }, }, }); ``` - -#### Returns - -`boolean` diff --git a/packages/docs/docs/integrate-masca/start-here.md b/packages/docs/docs/integrate-masca/start-here.md new file mode 100644 index 000000000..5779eec16 --- /dev/null +++ b/packages/docs/docs/integrate-masca/start-here.md @@ -0,0 +1,67 @@ +--- +sidebar_position: 1 +--- + +# Start here + +## Supporting Masca in your dApp + +dApps can access Masca functionalities using RPC methods like standard MetaMask/Ethereum ones. We have also developed an easy-to-use SDK **[Masca Connector](/docs/libraries/masca-connector)** to ease integration. The SDK provides all the functionalities to install Masca in a dApp and exposes an API for interacting with it. + +Installing Masca Connector to your project: + +```shell +pnpm add @blockchain-lab-um/masca-connector +``` + +Masca installs and initializes using the function `enableMasca`. After the successful installation, `enableMasca` returns the `Masca` object used to retrieve the API. + +The following is a minimal example of initializing Masca and invoking one of the API methods. + +```typescript +import { enableMasca, isError } from '@blockchain-lab-um/masca-connector'; + +// Connect the user and get the address of his current account +const accounts = await window.ethereum.request({ + method: 'eth_requestAccounts', +}); +const address = accounts[0]; + +// Enable Masca +const enableResult = await enableMasca(address, { + snapId: 'npm:@blockchain-lab-um/masca', // Defaults to `npm:@blockchain-lab-um/masca` + version: '1.0.0', // Defaults to the latest released version + supportedMethods: ['did:polygonid', 'did:pkh'], // Defaults to all available methods +}); + +// Check if there was an error and handle it accordingly +if (isError(enableResult)) { + // Error message is available under error + console.error(eneableResult.error) + ... +} + +// Now get the Masca API object +const api = await enableResult.data.getMascaApi(); + +// Example of invoking a RPC method call +// In this case, switching of the current did method +const switchMethodResult = await api.switchDIDMethod('did:polygonid'); + +// Check if there was an error and handle it accordingly +if (isError(enableResult)) {...} +``` + +Jump to [**Masca Connector**](/docs/libraries/masca-connector) for more detailed documentation. + +## Polygon ID + +Learn more on this [page](/docs/integrate-masca/polygonid.md). + +## OpenID for Verifiable Credentials (OID4VC) + +Learn more on this [page](/docs/integrate-masca/oid4vc.md). + +## Working with decentralized identity (DIDs, VCs, and VPs) + +**Masca** serves as a snap for a user in the [SSI trust model](ssi/trust-model.md). Components of the SSI trust model are also issuers issuing VCs and verifiers verifying VPs. It is up to you as a dApp developer to define how/if you will issue VCs or how you will verify VPs and check their validity (scheme, subject, controller, content, etc.). We are also actively developing Issuer as a Service (ISSaaS) and Verifier as a Service (VaaS) methodologies, which will ensure seamless integration and easy deployment of these services with minimal technical configuration requirements. We strive to provide a plug-and-play experience, enabling users to leverage these services with minimal effort. diff --git a/packages/docs/docs/introduction.md b/packages/docs/docs/introduction.md index 31b76c615..695ce8f55 100644 --- a/packages/docs/docs/introduction.md +++ b/packages/docs/docs/introduction.md @@ -14,7 +14,7 @@ Why use Masca? - Let MetaMask handle the security of cryptographic keys. You can also easily back them up with a seed phrase. - Users can (and should) decide which DID method to use and where they want their VCs to be stored. - Each user can create as many DIDs as they want! It is as simple as creating a new account in MetaMask. -- You can easily integrate DIDs and VCs into your dApp using **[Masca Connector](./libraries/masca-connector)** library. No need to implement the logic for multiple DID methods and places to store VCs. +- You can easily integrate DIDs and VCs into your dApp using **[Masca Connector](/docs/libraries/masca-connector)** library. No need to implement the logic for multiple DID methods and places to store VCs. - dApps can quickly request VC (or create VP) with a single RPC call — no need to develop extra logic and care about where the VC is stored. - Supports additional Decentralized Identity-related features such as creating VCs, validating existing VCs and VPs, and resolving DIDs. diff --git a/packages/docs/docs/libraries/_category_.json b/packages/docs/docs/libraries/_category_.json index f427fc2be..0fff3e6ba 100644 --- a/packages/docs/docs/libraries/_category_.json +++ b/packages/docs/docs/libraries/_category_.json @@ -1,6 +1,6 @@ { "label": "Libraries & Plugins", - "position": 7, + "position": 6, "link": { "type": "generated-index", "description": "Libraries and Plugins" diff --git a/packages/docs/docs/libraries/data-manager.md b/packages/docs/docs/libraries/data-manager.md index 816f160dd..a97e49fdc 100644 --- a/packages/docs/docs/libraries/data-manager.md +++ b/packages/docs/docs/libraries/data-manager.md @@ -12,7 +12,7 @@ Veramo does not provide similar support for managing VCs as it does for DIDs and Learn more about [DataManager](https://github.com/uport-project/veramo/issues/1058). -DataManager has an `AbstractDataStore` , a template for plugins that manage the data! Below is the code of ` AbstractDataStore` . +DataManager has an `AbstractDataStore`, a template for plugins that manage the data! Below is the code of ` AbstractDataStore`. ```typescript export interface ISaveArgs { @@ -46,7 +46,7 @@ export abstract class AbstractDataStore { } ``` -This abstract class enables the [ `SnapCredentialStore` ](../masca/architecture.md) plugin, which stores the array of VCs in MetaMask State, and `CeramicCredentialStore` , which stores VCs on Ceramic Network. +This abstract class enables the [ `SnapCredentialStore` ](../masca/architecture.md) plugin, which stores the array of VCs in MetaMask State, and `CeramicCredentialStore`, which stores VCs on Ceramic Network. ### How to use @@ -165,5 +165,5 @@ export interface IDataManagerSaveResult { } ``` -**[GitHub](https://github.com/blockchain-lab-um/ssi-snap/tree/master/packages/vcmanager) | -[npm](https://www.npmjs.com/package/@blockchain-lab-um/veramo-vc-manager)** +**[GitHub](https://github.com/blockchain-lab-um/masca/tree/master/packages/datamanager) | +[npm](https://www.npmjs.com/package/@blockchain-lab-um/veramo-datamanager)** diff --git a/packages/docs/docs/libraries/masca-connector.md b/packages/docs/docs/libraries/masca-connector.md index 107f67532..7137f2fdf 100644 --- a/packages/docs/docs/libraries/masca-connector.md +++ b/packages/docs/docs/libraries/masca-connector.md @@ -40,34 +40,33 @@ For Masca to work correctly, it needs to know the address of the connected accou :::tip -A more detailed description of methods & parameters is provided in the chapter [JSON-RPC API](../tutorial/rpc-methods.md) +A more detailed description of methods & parameters is provided in the chapter [Using the JSON-RPC API](/docs/integrate-masca/rpc-methods.md) ::: ```typescript import { enableMasca, isError } from '@blockchain-lab-um/masca-connector'; -// Install Masca and retrieve the API interface -const masca = await enableMasca(address); +// Connect the user and get the address of his current account +const accounts = await window.ethereum.request({ + method: 'eth_requestAccounts', +}); +const address = accounts[0]; -if(isError(masca)){ - console.error(enableResult.error); - return; -} - -const api = masca.data.getMascaApi(); - -// Invoke the API -const vcs = await api.queryCredentials(); +// Enable Masca +const enableResult = await enableMasca(address); -if(isError(masca)){ - console.error(vcs.error); - return; +// Check if there was an error and handle it accordingly +if (isError(enableResult)) { + // Error message is available under error + console.error(eneableResult.error) + ... } -console.log('list of VCs:', vcs.data); +// Now get the Masca API object +const api = await enableResult.data.getMascaApi(); ``` ## Connector methods -**A more detailed list of methods can be found [here](./../tutorial/implementation.md)!** +**A more detailed list of methods can be found [here](/docs/integrate-masca/masca-connector.md)!** diff --git a/packages/docs/docs/masca/_category_.json b/packages/docs/docs/masca/_category_.json index 18b24a451..c81ea5b3a 100644 --- a/packages/docs/docs/masca/_category_.json +++ b/packages/docs/docs/masca/_category_.json @@ -1,6 +1,6 @@ { "label": "Masca", - "position": 4, + "position": 5, "link": { "type": "generated-index", "description": "Learn about Masca" diff --git a/packages/docs/docs/masca/design.md b/packages/docs/docs/masca/design.md index 2003dc7fd..02a8701cf 100644 --- a/packages/docs/docs/masca/design.md +++ b/packages/docs/docs/masca/design.md @@ -44,7 +44,7 @@ Methods that do not require private keys ( `did:ethr` & `did:pkh` ) use `sign_ty ### Handling and deriving private keys used in Masca -Securely handling private keys in Masca is our topmost priority. Therefore, we never get/derive/use the user's Ethereum private keys. For methods requiring Ethereum keys, we use [ `eth_signTypedData_v4` ](https://docs.metamask.io/wallet/how-to/sign-data/#use-eth_signtypeddata_v4) for signatures, handled inside [Masca Connector](/libraries/masca-connector.md). +Securely handling private keys in Masca is our topmost priority. Therefore, we never get/derive/use the user's Ethereum private keys. For methods requiring Ethereum keys, we use [ `eth_signTypedData_v4` ](https://docs.metamask.io/wallet/how-to/sign-data/#use-eth_signtypeddata_v4) for signatures, handled inside [Masca Connector](/docs/libraries/masca-connector.md). For other methods, we derive private keys from a different `coin_type` 1236. How is this done in detail? The steps are as follows: @@ -112,7 +112,7 @@ On the other hand, VPs are signed by holders using their wallets (which is Masca ### Signing Credentials -During the runtime of each RPC method, private keys are retrieved (and derived) from MetaMask using the Snap RPC method `snap_getBip44Entropy` . +During the runtime of each RPC method, private keys are retrieved (and derived) from MetaMask using the Snap RPC method `snap_getBip44Entropy`. :::tip Don't worry, your private keys are safe! @@ -130,19 +130,19 @@ Ethereum relies on the elliptic curve `secp256k1` ; thus, this is the only key t But because of the limitation of the specific key type, we currently support all DID methods that work with `secp256k1` keys. There is a way to create key pair of any type (e.g., `Ed25519` ) in the Snap (since you can write any custom JavaScript), but storing and securely handling these keys gets complicated. Fortunately, the elliptic curve `secp256k1` is widely used and popular with most DID methods. -We are also looking into pairing-friendly elliptic curves, which enable advanced ways to perform selective disclosure and zero-knowledge proofs, e.g., `BLS12-381` and `BabyJubJub` , where it would make sense to implement custom and complex security storage for keys generated inside Snap. +We are also looking into pairing-friendly elliptic curves, which enable advanced ways to perform selective disclosure and zero-knowledge proofs, e.g., `BLS12-381` and `BabyJubJub`, where it would make sense to implement custom and complex security storage for keys generated inside Snap. ### Proof formats Different ways exist to digitally sign and represent digital signatures alongside the data or payload (VC or VP). In the SSI and web3 world, currently, three approaches are most adopted: **JWT**, **Linked Data Proofs**, and **EIP712**. Masca supports all three types. -For the complete list of supported proof formats, check [What is Supported?](./supported). +For the complete list of supported proof formats, check [What is Supported?](/docs/masca/supported.md). ## Data Storage As stated above, DIDs and VCs need to be stored somewhere. We plan to support many data storage providers to fulfill all users' needs. While keeping data locally in the MetaMask state is the most private way to store the data (it is also encrypted), other solutions bring many benefits, such as the ability to sync between different devices and easier ways to make external backups. -For the complete list of supported data storage providers, check [this page](./supported). +For the complete list of supported data storage providers, check [this page](/docs/masca/supported.md). ## Decentralized Identity Framework diff --git a/packages/docs/docs/masca/supported.md b/packages/docs/docs/masca/supported.md index bdb253e3e..fca16af7b 100644 --- a/packages/docs/docs/masca/supported.md +++ b/packages/docs/docs/masca/supported.md @@ -10,20 +10,17 @@ DID methods: - [`did:key`](https://w3c-ccg.github.io/did-method-key/) - including `did:key` method used for creation and management of [EBSI Natural Person identifiers](https://api-pilot.ebsi.eu/docs/specs/did-methods/did-method-for-natural-person) - [`did:pkh`](https://github.com/w3c-ccg/did-pkh/blob/main/did-pkh-method-draft.md) - [`did:jwk`](https://github.com/quartzjer/did-jwk/blob/main/spec.md) +- [`did:polygonid`](https://github.com/0xPolygonID/did-polygonid/blob/main/did-polygonid-method-draft.md) +- [`did:iden3`](https://docs.iden3.io/getting-started/identity/identifier/) Data Storage: - Local [MetaMask Snap](https://docs.metamask.io/guide/snaps.html) state (fully off-chain) - [Ceramic Network](https://ceramic.network/) -:::danger BE CAREFUL! - -Ceramic Network support is experimental and still under active development! - -::: - Proof Formats: - [JWT](https://www.rfc-editor.org/rfc/rfc7519) - [EIP712](https://w3c-ccg.github.io/ethereum-eip712-signature-2021-spec/) -- [JSON-LD (Currently buggy)](https://w3c.github.io/vc-data-integrity/#proofs) +- [JSON-LD (some edge cases may not work properly)](https://w3c.github.io/vc-data-integrity/#proofs) +- [zkProofs (Polygon ID)](https://0xpolygonid.github.io/tutorials/) diff --git a/packages/docs/docs/roadmap.md b/packages/docs/docs/roadmap.md index 34439a7d5..029a3a5af 100644 --- a/packages/docs/docs/roadmap.md +++ b/packages/docs/docs/roadmap.md @@ -16,7 +16,8 @@ DID methods: - [ ] `did:cheqd` - [ ] `did:ebsi` - [ ] `did:ens` -- [ ] `did:polygon` +- [x] `did:polygonid` +- [x] `did:iden3` - [ ] ... Verifiable Credentials (VCs): @@ -51,7 +52,7 @@ Cryptography: - [x] Signing with MetaMask keys - [ ] Selective Disclosure - SD-JWT - [ ] Selective Disclosure - BBS+ -- [ ] Zero-Knowledge Proofs (ZKPs) +- [x] Zero-Knowledge Proofs (ZKPs) - [ ] ... Proof formats: @@ -64,8 +65,8 @@ Proof formats: Digital identity standards: -- [ ] PEX (Presentation Exchange) -- [ ] OpenID Connect (SIOP, OIDC4VC, and OIDC4VP) +- [x] PEX (Presentation Exchange) +- [x] OpenID Connect (SIOP, OIDC4VC, and OIDC4VP) - [ ] Credential Manifest - [ ] CHAPI - [ ] DIDComm @@ -80,6 +81,7 @@ Masca dApp: - [x] Move VC to another storage - [x] Import VCs - [ ] Export VCs +- [x] Export state (encrypted) - [ ] Public profiles - [ ] ... diff --git a/packages/docs/docs/ssi/_category_.json b/packages/docs/docs/ssi/_category_.json index c7ed61071..6275db157 100644 --- a/packages/docs/docs/ssi/_category_.json +++ b/packages/docs/docs/ssi/_category_.json @@ -1,6 +1,6 @@ { "label": "Decentralized or Self-Sovereign Identity (SSI)", - "position": 3, + "position": 4, "link": { "type": "generated-index", "description": "Learn about the fantastic world of Decentralized Identity and SSI." diff --git a/packages/docs/docs/ssi/did.md b/packages/docs/docs/ssi/decentralized-identifiers.md similarity index 100% rename from packages/docs/docs/ssi/did.md rename to packages/docs/docs/ssi/decentralized-identifiers.md diff --git a/packages/docs/docs/ssi/vc.md b/packages/docs/docs/ssi/verifiable-credentials.md similarity index 99% rename from packages/docs/docs/ssi/vc.md rename to packages/docs/docs/ssi/verifiable-credentials.md index 9f76de7a4..d28378c67 100644 --- a/packages/docs/docs/ssi/vc.md +++ b/packages/docs/docs/ssi/verifiable-credentials.md @@ -125,7 +125,7 @@ When expressing statements about a specific thing, such as a person, product, or } ``` -The entity (e.g. a person, object or company) the credential data is about. This object contains one or more properties that are related to the subject of VC. The subject identifier ( `credentialSubject.id` ) is usually a DID of the entity. In our example, `credentialSubject` contanis relevant data (type of degre, year of graduation, score, etc.) for the University Degree of `John Dough` . +The entity (e.g. a person, object or company) the credential data is about. This object contains one or more properties that are related to the subject of VC. The subject identifier ( `credentialSubject.id` ) is usually a DID of the entity. In our example, `credentialSubject` contanis relevant data (type of degre, year of graduation, score, etc.) for the University Degree of `John Dough`. #### [Cryptographic Proofs](https://www.w3.org/TR/vc-data-model/#proofs-signatures) diff --git a/packages/docs/docs/ssi/vp.md b/packages/docs/docs/ssi/verifialbe-presentations.md similarity index 100% rename from packages/docs/docs/ssi/vp.md rename to packages/docs/docs/ssi/verifialbe-presentations.md diff --git a/packages/docs/docs/team/team.mdx b/packages/docs/docs/team/team.mdx index 3e7b8bb65..004878e36 100644 --- a/packages/docs/docs/team/team.mdx +++ b/packages/docs/docs/team/team.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 9 --- # Members diff --git a/packages/docs/docs/tutorial/_category_.json b/packages/docs/docs/tutorial/_category_.json deleted file mode 100644 index 0f5a24aa1..000000000 --- a/packages/docs/docs/tutorial/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Use Masca", - "position": 5, - "link": { - "type": "generated-index", - "description": "Learn how to use Masca." - } -} diff --git a/packages/docs/docs/using-masca.md b/packages/docs/docs/using-masca.md new file mode 100644 index 000000000..e5ef559e8 --- /dev/null +++ b/packages/docs/docs/using-masca.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 2 +--- + +# Using Masca + +## How to start using Masca? + +Masca currently works only on **MetaMask Flask**. You can find it [here](https://metamask.io/flask/). Snaps are expected to be supported in the production MetaMask sometime in the second half of 2023. With that said, users will be able to connect to any dApp using Masca without any additional steps or software. + +## Masca dApp + +We implemented an easy-to-use [dApp to configure Masca](https://masca.io) according to your needs and display your data. You can find the source code [here](https://github.com/blockchain-lab-um/masca). diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js index 75ae33493..105089730 100644 --- a/packages/docs/docusaurus.config.js +++ b/packages/docs/docusaurus.config.js @@ -65,7 +65,7 @@ const config = { }, items: [ { to: '/docs/introduction', label: 'Docs', position: 'left' }, - { to: '/docs/getting-started', label: 'Quickstart', position: 'left' }, + { to: '/docs/using-masca', label: 'Quickstart', position: 'left' }, { href: 'https://masca.io', label: 'App', diff --git a/packages/docs/src/pages/index.tsx b/packages/docs/src/pages/index.tsx index 1bf8acae9..5d4a721c5 100644 --- a/packages/docs/src/pages/index.tsx +++ b/packages/docs/src/pages/index.tsx @@ -19,7 +19,7 @@ function HomepageHeader() {
GET STARTED