Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Identify Snap utilizes the Veramo framework to efficiently manage tasks related to Decentralized Identifiers (DIDs), Verifiable Credentials (VCs), and Verifiable Presentations (VPs). Veramo is a high-performance, modular API designed for verifiable data and self-sovereign identity (SSI). It serves as a user-friendly client for creating, managing, verifying, and storing DIDs, VCs, and VPs, thereby simplifying the development process.
With Veramo's plugin development capabilities, we have created custom plugins such as the Snap Data Store plugin, which handles private key management, DID operations, and VC storage within the secure MetaMask environment. Additionally, we have developed the Google Drive Data Store plugin, enabling remote storage of VCs on a user's personal Google Drive. This feature allows for seamless syncing of Identify Snap data across multiple browsers and devices.
In essence, by incorporating the Veramo framework into the Identify Snap, developers can easily manage various aspects of DIDs, VCs, and VPs, while also benefiting from custom plugins tailored to specific needs and use cases.
Veramo is a simple-to-use JavaScript tool that allows developers to integrate secure, verifiable data into their apps. It's designed for those who want to incorporate advanced features like Decentralized Identifiers (DIDs) and Verifiable Credentials.
The verifiable data field has rapidly expanded, resulting in numerous competing standards, which can cause compatibility issues. Veramo solves this problem by being adaptable, modular, and scalable, allowing developers to easily combine various standards without worrying about compatibility or frequently changing specifications.
Developers and product owners often face challenges when dealing with competing standards and may hesitate to commit to a specific vendor or standard. Veramo aims to create an ecosystem of compatible functionality through specialized community plugins that follow open standards.
Veramo works closely with the W3C and DIF to ensure compatibility across different projects. With Veramo, developers can customize their agents by using core plugins for various functions, including DID methods, messaging protocols, storage, key management, and authentication.
To learn more about Veramo, refer to the Veramo Guide.
Identify Snap is a sophisticated plugin that developers can incorporate into a variety of applications to enhance MetaMask's functionality beyond its native capabilities. Specifically, Identify Snap extends MetaMask's features by adding support for Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs). This plugin can be seamlessly installed as a JavaScript npm package on web applications, thereby offering a range of advanced features to users.
With Identify Snap, users can create Verifiable Credentials using either their MetaMask account or a non-MetaMask account (e.g., by directly importing their private key). Additionally, this plugin enables DID resolution and VC verification, among other functionalities.
Examples of use cases for Identify Snap include:
Secure access control: Identify Snap can be employed for authentication and authorization purposes, granting users secure access to various online services and resources based on their verifiable credentials.
Credential management: Users can create, manage, and verify their credentials, such as educational qualifications or professional certifications, with the added convenience and security provided by the MetaMask extension.
Decentralized identity management: Identify Snap empowers users to establish and maintain control over their digital identities through the use of DIDs and VCs, thus ensuring privacy, security, and reduced reliance on centralized authorities.
In summary, Identify Snap is a valuable addition to the MetaMask ecosystem, offering users an array of enhanced features and enabling developers to incorporate advanced identity management functionalities into their applications.
Snaps is a plugin system introduced by MetaMask, a popular Ethereum wallet and browser extension. Snaps, short for "Snapshots," are designed to extend the functionality of MetaMask by allowing developers to create custom plugins that can be integrated into the wallet. A snap is basically a program that runs in an isolated environment that can customize the wallet experience.
These plugins enable users to interact with new blockchains, protocols, and decentralized applications (dApps) beyond what is natively supported by MetaMask. The goal of the MetaMask Snaps plugin system is to create a more open, customizable, and extensible wallet experience for users, while fostering innovation and collaboration within the blockchain and decentralized application ecosystem.
Developers can write MetaMask Snaps using JavaScript, making it accessible and convenient for a broad range of developers to create custom solutions. Users can then opt to install these plugins to enhance their MetaMask experience, provided they trust the source of the plugin.
To learn more about Snaps, visit Metamask Snap Guide.
Get the Decentralized Identifier(DID) associated with the currently connected metamask account or a non-metamask account(i.e. imported via private key)
Control non-EVM accounts(eg. Hedera Accounts that deal with Account Ids) and assets in MetaMask
Store and manage Verifiable Credentials(VC) data on your device and remotely(eg. storing VCs on personal google drive to allow sync feature)
Generate Verifiable Presentation(VP) from one or more VCs
Verify VC and VP
Display a custom confirmation screen in MetaMask before performing important actions via the snap
Populate MetaMask's pre-transaction window with custom transaction insights
Schedule actions with cron jobs
Install from Metamask Snap Store: https://snaps.metamask.io/snap/npm/tuum-tech/identify/
Stable Version: v1.5.0: https://github.com/tuum-tech/identify/tree/v1.5.0
Snap Npm Package: https://www.npmjs.com/package/@tuum-tech/identify
Snap Audit Report by Core53: Identify Snap Audit Report for v1.4.2
Demo Video showcasing Identify Snap integration on an example website: https://www.youtube.com/watch?t=998&v=fh_FvFm7V9U
To get started, make sure you have MetaMask first and then install the Identity snap from the Metamask Snaps store or npm registry. Note that as of now, v1.5.0 is the most stable version so we recommend you use this in your application
Connect with Metamask and accept the connection in MetaMask(Note that you cannot install snaps directly. You would need to enable this in your app. To learn more about how you can do this in your own app, look at an example site code that has the Identify Snap installation functionality or go through the live demos within the Snap RPC APIs section where you can check out the working html/js code to do this.
Approve and install the Identify snap
Check out this demo video that showcases how a website can integrate with Identify Snap and expose various functionalities such as creating DID, resolving DID, creating Verifiable Credentials and creating Verifiable Presentations and much more.
MetaMask Snaps allows users to add features and functionality to their MetaMask wallet. Individual snaps are features created by third-party developers that MetaMask users can install directly into their wallet. Learn more about Metamask snaps.
A Snap is an application built by a third-party developer that adds features and functionality to MetaMask. Snaps can connect to blockchain protocols beyond Ethereum, show insights about transactions, display notifications, add new privacy and identity features, and much more.
Snaps run in a sandboxed environment and use a permissions model to protect your data and respect your consent. Snaps do not have access to your MetaMask account data. When installing a Snap, make sure you understand what permissions you are granting to stay secure.
DID is not directly compatible with MetaMask. The Identify snap allows you to manage your DID by creating a DID based on your ECDSA private key.
No, the Identify Snap does not modify any UI within MetaMask. To interact with the snap and perform actions you need to go through a dapp. We have built a dedicated dapp that you can access here to view your Verifiable Credentials here.
Snaps are currently only available on MetaMask. MetaMask is a browser-based extension. This means the Identify snap, or any other snap, is currently not available on MetaMask Mobile however, there are plans from the Metamask team to release the Snap feature on Metamask mobile in the near future.
Reinstalling the snap will automatically recover your account provided you use the same private key to configure the account again via your DApp. Verifiable Credentials will need to be added again. Deleting the snap does not delete your DID or transaction history.
Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs) are important components of decentralized identity systems. They provide a way for individuals and organizations to establish and prove their identity without relying on centralized authorities or intermediaries.
DIDs are a new type of identifier that enables verifiable, decentralized digital identity. They are globally unique, persistent, and cryptographically verifiable. DIDs are typically associated with a DID Document, which contains the public keys, authentication methods, and service endpoints needed to interact securely with the entity the DID represents.
VCs are digital attestations of identity attributes that can be cryptographically signed by an issuer, such as a government or an organization, and securely shared with other entities. They enable the holder of the credential to prove their identity or qualifications without exposing sensitive information. VCs are based on the World Wide Web Consortium's (W3C) Verifiable Credentials Data Model standard.
Digital Identity: DIDs and VCs can be used to establish a digital identity for individuals, organizations, or IoT devices, allowing them to interact securely and privately online.
Access Control: DIDs and VCs can be used for authentication and authorization, enabling secure access to online services and resources.
Credential Verification: VCs can be used to verify qualifications, professional certifications, or memberships in various organizations, reducing fraud and improving trust.
KYC/AML Compliance: Financial institutions and other regulated entities can use VCs to streamline customer onboarding and compliance with anti-money laundering (AML) and know-your-customer (KYC) regulations.
Healthcare: Patients can use VCs to securely share their medical records with healthcare providers, ensuring data privacy and improving the quality of care.
Supply Chain Management: DIDs and VCs can be used to track and verify the provenance of goods, ensuring authenticity and reducing counterfeiting.
Sovrin Network: The Sovrin Network is a decentralized, global public utility for self-sovereign identity based on the Hyperledger Indy platform. It allows individuals and organizations to create and manage DIDs and VCs.
Microsoft's ION: Microsoft's Identity Overlay Network (ION) is a decentralized identity system built on top of the Bitcoin blockchain. It uses the Sidetree protocol to enable scalable DID management and interaction.
Veres One: Veres One is a decentralized ledger for DIDs that is based on the W3C DID standard. It aims to provide a simple, secure, and privacy-preserving way to create and manage digital identifiers.
Decentralized Identifiers and Verifiable Credentials are essential components of a decentralized digital identity ecosystem, providing increased security, privacy, and control for users. As the technology matures and more platforms integrate DIDs and VCs, we can expect to see a growing number of use cases and applications across various industries.
One of the primary benefits of developing and using a snap in an application is that it leverages the security of MetaMask itself. Snaps, like Identify Snap, operate in an isolated environment inaccessible to other snaps, ensuring that data can only be accessed through the APIs exposed by the snap.
Identify Snap's security is of utmost importance, as it stores private keys for both MetaMask and non-MetaMask accounts that have been previously imported. By exposing only the essential APIs for handling DIDs and VCs, the snap ensures that applications cannot access its internal state.
The private keys stored within Identify Snap's state are used to generate Verifiable Credentials, DID documents, and interact with the snap's APIs. This security measure prevents applications from impersonating another user's digital identifier, as all actions are tied to the connected account's private key.
In summary, Identify Snap takes advantage of MetaMask's inherent security to protect user data within an isolated environment, ensuring the integrity of actions related to Decentralized Identifiers and Verifiable Credentials.
Users can connect to both metamask accounts and non-metamask accounts with Identify Snap. For connecting to metamask accounts, everything is handled automatically as snap has direct access to Metamask APIs however for connecting to non-metamask accounts, some additional flags must be passed so the snap recognizes that the user is trying to connect to an external account.
The flag for an external flag is as follows:
In addition to evm accounts, Identify Snap also lets users connect to non-evm accounts which may have additional fields. For example, in the case of Hedera Hashgraph, each account has an account id(in the format 0.0.xxxxx) that must also be set and as such, when connecting to a non-metamask hedera account, the following external flag would be passed instead:
Note: While there are plans to support more blockchain networks in the future, Identify Snap currently supports only two types of networks:
evm: All EVM compatible blockchain networks. This includes any kind of network that is EVM compatible(Layer1s, Layer2s, etc). The params value for network must be "evm" and the params value for "address" must be an EVM address.
hedera: Hedera Hashgraph network. The params value for network must be "hedera" and the params value for "accountId" must be a valid hedera account id.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Displays an alert dialog blox on Metamask with some content.
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Retrieves the available DID methods that Identify Snap supports. We currently only support did:pkh
but there are plans to support more DID methods in the future. If you would like us to add a support for a DID method that you would like, feel free to let us know at contact@tuum.tech
Some example responses:
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Returns the result.
Some example responses:
For an evm account 0xc8ae244a1665f7f6cf8aa886123b82791c7224fd
on Ethereum network:
For a hedera account id 0.0.15215
on Hedera Hashgraph network:
If you're getting any errors with the live demo, make sure you go through the section to learn about what you may be missing. You need to install in your browser for the live demo to work
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at .
You can also check out the to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this .
If you're getting any errors with the live demo, make sure you go through the section to learn about what you may be missing. You need to install in your browser for the live demo to work
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at .
You can also check out the to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Note: Both the newAccountEvmAddress
and newAccountPublickey
parameters are optional however, when calling this API, you must set at least one of these. If you pass in newAccountPublickey
, the Identify Snap will send the appropriate HBARs to a public key at which point a new account id will be generated in the hedera ledger. Depending on your use case, you can either generate an account id for an EVM address or for a public key. Also, if an account id already exists for an account, the snap doesn't send the HBARs and simply returns the account id for that account.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Queries the Hedera Mirror Node to check whether an account id already exists for a given EVM address or the public key.
If an account id already exists on the ledger, the snap returns it along with other information such as the current balance of the hedera account.
If an account id doesn't exist on the ledger, the snap uses hedera sdk to send the appropriate amount of tinybars(smallest unit of HBARs on the hedera network) to the given EVM address or a public key.
The account id is retrieved from the transaction receipt and returned as the result.
Some example responses:
Creating a new hedera account id for an EVM address: 0x5Ce55759b0D4049ED015a657726C1aaFC77F7bEC
Calling the API to create a hedera account id for an EVM address whereby accountId already exists on the hedera ledger:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Returns the DID document based on the did method that's currently selected.
Some example responses:
For an evm account 0x30F08B41491E9620d9Ba0f8F8a09a807752bBF3A
on Ethereum network:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Notes:
There is no need to pass in options
if you want to store the VC in the Metamask snap state as this is the default behavior however, for storing it in googleDrive
, you will need to specify via this parameter. In order to use googleDrive
, you first need to first configure your google account.
If you want to remove the same VC from multiple stores, you can pass in an array for options.store
.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Removes all the Verifiable Credentials(VCs).
Returns the result.
Some example responses:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Since Identify Snap lives within Metamask itself, users won't be able to directly interact with the Snap so it has to be integrated on a website first and users interact with the snap through the website UI. As such, the first step is to integrate the Identify Snap and this section talks about how developers can do that along with integrating a simple "Hello World" feature of the Snap.
It's optional but recommended to automate the MetaMask installation for users, as this enhances their experience. The choice is up to developers on how they want to handle this aspect of the integration.
Check out Snap RPC APIs to learn about how to interact with the Identify Snap from your website.
Note that before users can interact with the Identify Snap, it needs to first be installed on the Metamask itself so you can have a button on your website that lets users do exactly this.
Identify Snap provides developers with a range of APIs, starting with the simple "hello" snap API. This API connects to the current account and displays content to the user via a MetaMask dialog box. By learning to integrate the "hello" API, developers can then seamlessly integrate more complex APIs related to DIDs and VCs. To explore available APIs, refer to the Snap RPC APIs section in the documentation.
Since snaps cannot retrieve the account info on their own, it is the responsibility of the DApp to request the user for their currently connected Metamask account address and pass that in as a parameter to each and every single Identify Snap API.
Let's see how we can interact with the "hello" API of the Identify Snap.
where snapId
can be one of the following:
npm:@tuum-tech/identify
: This is what you'll have most of the time if you are going to be integrating with the Identify Snap version from the npm registry.
local:http://localhost:8080
: If you're running the Identify Snap locally on your development environment via Identify Snap Local Environment, the snap APIs are exposed on localhost:8080. Note that you would only use this if you're actively making some changes to the Identify Snap code locally otherwise, you'll be interacting with the Identify Snap npm package directly.
On the above handleHelloAPIRequest
method, we can see that it's invoking the wallet_snap_* method of Metamask. What this does is invoke the hello
API of Identify Snap. Identify Snap has implemented how to handle this API including what arguments to take(if any). Refer to hello snap API for more info on how this API works.
Then, all we need to do now is to handle the hello
snap API request on our application:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
To learn about how accounts works within Identify Snap, refer to the Snap Account documentation.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
In this tutorial, we are going to retrieve DID info when we want to connect to our non-metamask(external) account.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Returns the did of the non-metamask account.
Some example responses:
For an evm account 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
on Ethereum network:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
DIDs and Verifiable Credentials (VCs) offer various uses, with DID authentication being a common use case. One example of implementing a decentralized login mechanism is by allowing users to have full control over their DIDs for Sign Up and Login features on an application. Keep in mind that this is just one approach, and multiple DID authentication methods can be utilized.
The user clicks on Sign Up button on the example website
The website interacts with the backend API server to generate a Verifiable Credential with some data within it(such as the user's name, username, etc. This can be any arbitrary data the Company A wants to put in the Verifiable Credential they issue using their DID private key)
The backend API server sends back the generated VC back to the example website
The website calls the "saveVC" API of Identify Snap to save this newly generated VC in the snap storage within Metamask
The user clicks on Login button on the example website
The website calls the "getVCs" API of Identify Snap to retrieve all the VCs that are in the user's snap storage within Metamask
The website displays the list of user VCs from which the user needs to select which VC to use to login to the website
After the user chooses the VC to login with, the website calls the "createVP" API of Identify Snap to generate a Verifiable Presentation out of the VC the user chose. Developers may choose to add a "challenge" when calling this snap API for additional security.
The website sends the VP to the backend API server where a method to verify VP will be called to ensure the VP and VC are legitimate and signed by Company A's DID and that the VP does belong to the user
The backend API server sends a message to the website saying everything was verified successfully and log the user into the website
If you would like to see an example project implementing this exact DID auth mechanism, check out the following repos:
Example Site that integrates with Identify Snap:
In this tutorial, we are going to store our Verifiable Credentials(VCs) on our google drive. There are multiple ways of doing that and we're going to explore both of these options here.
Each and every single API of Identify Snap can be called with an additional options
parameter which lets you define the type of store to use. It doesn't make sense to pass this parameter for the APIs that don't deal with any storage however, for the APIs such as createVC
, saveVC
, getVCs
, removeVC
, deleteAllVCs
, you can pass this parameter. For example:
Create and save VC on google drive:
Note: The above code will create a VC based on the values passed and then save it to the user's google drive. Note that if store is explicitly passed like this, because snap
is not mentioned, Identify Snap will not store the VC locally within the Metamask snap state.
Save VC on google drive:
Note: The above code will save the VC data to both local Metamask snap state and the user's google drive because we have included both snap
and googleDrive
for the store
parameter.
If you don't want to immediately use the google drive as the storage option as part of the snap API call, you can also use the syncGoogleVCs
snap API at a later time to sync the VCs between the local Metamask snap state and google drive. This API will do the following:
Retrieves the VCs from google drive
Retrieves the VCs from the local Metamask snap state
Compare the VCs from both stores and figure out what VCs are missing in snap state that are present in google drive and what VCs are missing in google drive that are present in snap state
Import the missing VCs from google drive onto Metamask snap state
Export the missing VCs from Metamask snap state onto google drive
Main repo:
Login Page:
Available on
Example Backend API server that uses Veramo agent to issue verifiable credentials automatically:
To learn about how accounts works within Identify Snap, refer to the .
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this .
By default, Identify Snap saves the Verifiable Credentials(VCs) within Metamask snap state which is entirely local however, there are times when you want to store these VCs remotely such as the in the case of when you want to use an application from another browser or device. Because all the data is stored locally, whenever you switch a browser or device, the VCs are not transferred. You would need to reimport all the VCs using . But that becomes very time consuming if you have a large amount of VCs.
As such, Identify Snap offers a way for the user to store their VCs in their personal google drive and at a later time, they can use the to import/export their VCs to and from snap and google drive.
One thing to note is that there is no need to pass in options
if you want to store the VC in the local Metamask snap state as this is the default behavior however, for storing it in googleDrive
, you will need to specify via this parameter. In order to use googleDrive
, you first need to first .
Note: In order to use googleDrive
, you first need to first .
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at .
You can also check out the to learn how each API works.
To learn about how accounts works within Identify Snap, refer to the Snap Account documentation.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
In this tutorial, we are going to retrieve DID info when we want to connect to our Metamask account on the Hedera network.
Make sure that you have added Hedera Network to your Metamask settings.
Hedera Testnet
RPC URL: https://testnet.hashio.io/api
Chain ID: 296
Currency Symbol: HBAR
Hedera Mainnet
RPC URL: https://mainnet.hashio.io/api
Chain ID: 295
Currency Symbol: HBAR
Fore more info on JSON-RPC Relay for Hedera Hashgraph, go to HashIo website.
Note: Identify Snap will ensure that you're first connected to Hedera network before you can call any hedera specific APIs.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Returns the did of the metamask account on the Hedera network.
Some example responses:
For a hedera account id 0.0.3891553
with evm address 0x2e5ff0267b678a0faf9a9f5b0fbf7ac9638b5b57
on Hedera Hashgraph network:
Make sure you're connected to the Hedera network before trying out the following demo.
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
To learn about how accounts works within Identify Snap, refer to the Snap Account documentation.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
By default, accounts on the Hedera ledger do not have account ids. Whenever a hedera account first interacts with the Hedera ledger, an account id is automatically generated. As the Identify Snap requires each hedera account to have an account id in addition to an EVM address, we have provided the createNewHederaAccount snap API that will let a user help generate a new account id for a new hedera account based on its EVM address. If you want to generate an account id for a new hedera account based on its public key, refer to the tutorial for that here.
In this tutorial, we are going to create a new hedera account id on the Hedera ledger by sending some HBAR to an EVM address.
Make sure that you have added Hedera Network to your Metamask settings.
Hedera Testnet
RPC URL: https://testnet.hashio.io/api
Chain ID: 296
Currency Symbol: HBAR
Hedera Mainnet
RPC URL: https://mainnet.hashio.io/api
Chain ID: 295
Currency Symbol: HBAR
Fore more info on JSON-RPC Relay for Hedera Hashgraph, go to HashIo website.
Notes: Identify Snap will ensure that you're first connected to Hedera network before you can call any hedera specific APIs.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Queries the Hedera Mirror Node to check whether an account id already exists for a given EVM address.
If an account id already exists on the ledger, the snap returns it along with other information such as the current balance of the hedera account.
If an account id doesn't exist on the ledger, the snap uses hedera sdk to send the appropriate amount of tinybars(smallest unit of HBARs on the hedera network) to the given EVM address.
The account id is retrieved from the transaction receipt and returned as the result.
Some example responses:
Creating a new hedera account id for an EVM address: 0x5Ce55759b0D4049ED015a657726C1aaFC77F7bEC
Calling the API to create a hedera account id for an EVM address whereby accountId already exists on the hedera ledger:
Make sure you're connected to the Hedera network before trying out the following demo.
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Currently, MetaMask Snaps can only connect to accounts generated via mnemonics and not to imported accounts. However, Identify Snap enables developers and users to access both MetaMask and non-MetaMask accounts (imported using private keys directly), extending the same DID and VC features to any type of account.
It is important to note that Snaps cannot interact directly with MetaMask accounts imported using private keys. Users should either utilize a regular MetaMask account (generated via mnemonics) or import the account using the private key by interacting with Identify Snap directly.
Moreover, Identify Snap supports both EVM-based blockchains/sidechains and non-EVM-based blockchains. As of version 1.5.0, it supports Hedera Hashgraph, with plans to add support for other blockchains, such as Bitcoin, XRPL, Dogecoin, and Litecoin in the near future. This is significant because not all blockchains use EVM-based addresses. For instance, Hedera Hashgraph employs an "AccountId" in the format of "0.0.xxxxx". By supporting the import of various account types, Identify Snap demonstrates its versatility, offering features not directly available through MetaMask.
Identify Snap natively supports EVM blockchains and sidechains, just like MetaMask. This means that no additional steps are required when interacting with EVM blockchains. For example, when a user connects to an account on MetaMask, Identify Snap automatically retrieves the private key for that account and stores it in its state for later use with DIDs and VCs. Subsequent connections to the same account bypass the import process since the account state already exists within Identify Snap.
For non-MetaMask accounts, users need to provide an extra flag in the Snap API request. If the external account hasn't been added to Identify Snap's state, the user will be prompted to enter the private key for that account via a MetaMask dialog. Once the account state is stored in Identify Snap, future connections bypass the import dialog.
Thus, Identify Snap enables seamless connections to both MetaMask and non-MetaMask accounts, offering users a versatile and convenient experience when dealing with different types of accounts.
Although MetaMask does not natively support non-EVM blockchains, Identify Snap provides a way to connect to them, such as Hedera Hashgraph. Each Hedera account has an associated AccountId, which is generated upon the account's first transaction with the Hedera ledger. Identify Snap supports both EVM addresses and Hedera AccountIds.
When a user connects to a MetaMask account associated with Hedera, Identify Snap retrieves the private key and stores it in its state for use with DIDs and VCs. The user must also enter their Hedera AccountId if it's their first time interacting with the account on the Hedera network. Once the account state is stored in Identify Snap, future connections bypass the import process.
For non-MetaMask Hedera accounts, users need to pass two additional flags in the Snap API request - one to indicate it's a non-MetaMask account and another for the desired Hedera AccountId. If the external account isn't in Identify Snap's state, the user will be prompted to enter the private key via a MetaMask dialog. Subsequent connections to the account bypass the import dialog since the account state is stored within Identify Snap.
In summary, Identify Snap enables connections to both MetaMask and non-MetaMask accounts for Hedera Hashgraph, offering users a versatile experience when interacting with various types of accounts.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Retrieves the currently selected DID method. We currently only support did:pkh
method but there are plans to support more DID methods in the future at which point this API will make more sense. If you would like us to add a support for a DID method that you would like, feel free to let us know at contact@tuum.tech
Some example responses:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Switch to using a different did method. Note that this value is saved within Metamask Snap state for each account so you can use different did methods for different accounts. We currently only support did:pkh
method but there are plans to support more DID methods in the future at which point this API will make more sense. If you would like us to add a support for a DID method that you would like, feel free to let us know at contact@tuum.tech
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Checks the current behavior for handling Metamask popups in snap state.
Enable/disable the Metamask popups.
Returns a value of type "boolean" for success/failure.
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Notes:
Identify Snap currently supports generating VC using jwt
proof format however, it still supports the verification of other types of VCs with other proof formats such as lds
and EthereumEip712Signature2021
.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Checks to see whether the passed Verifiable Credential(VC) is a valid VC such as checking for the valid signature and whether or not the did in the VC is resolvable and whether or not it has the correct proofformat.
Returns a boolean value depending on the result.
Some example responses:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Notes:
There is no need to pass in options
if you want to store the VC in the Metamask snap state as this is the default behavior however, for storing it in googleDrive
, you will need to specify via this parameter. In order to use googleDrive
, you first need to first configure your google account.
If you want to remove the same VC from multiple stores, you can pass in an array for options.store
.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Removes the Verifiable Credentials(VCs) for the specified VC Ids.
Returns the result that includes which VC Ids were removed along with the store from which they were removed from.
Some example responses:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Notes:
There is no need to pass in options
if you want to store the VC in the Metamask snap state as this is the default behavior however, for storing it in googleDrive
, you will need to specify via this parameter. In order to use googleDrive
, you first need to first configure your google account.
Identify Snap currently supports generating VC using jwt
proof format however, it still supports the saving of other types of VCs with other proof formats such as lds
and EthereumEip712Signature2021
.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Saves the passed in signed Verifiable Credential(VC) to the appropriate storage(eg. snap/googleDrive).
Returns the metadata for the saved VC that contains the unique vc Id and the store at which the VC was saved in.
Some example responses:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Notes:
There is no need to pass in options
if you want to store the VC in the Metamask snap state as this is the default behavior however, for storing it in googleDrive
, you will need to specify via this parameter. In order to use googleDrive
, you first need to first configure your google account.
Each VC will automatically be of type VerifiableCredential
by default but if you want to add additional credential types, you can define that with the credTypes
parameter.
The key for the credentialSubject
of the VC will be called vcData
by default but if you want to define your own value for this key, you can pass it in the vcKey
parameter.
Identify Snap currently supports generating VC using jwt
proof format however, there are plans to support additional proof formats such as lds
and EthereumEip712Signature2021
in the future.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Generates a Verifiable Credential(VC) for the specified value based on the parameters defined. The expiration date is always set to 1 year in the future from the time of its issuance date. The proofformat for the VC will be jwt
by default.
Returns the newly generated VC back to the application.
Some example responses:
Creating a new VC for an EVM address: 0x2e5ff0267b678a0faf9a9f5b0fbf7ac9638b5b57
Creating a new VC for a hedera account id: 0x7d871f006d97498ea338268a956af94ab2e65cdd
Note: Even if the DID for this hedera account is based on its EVM address 0x7d871f006d97498ea338268a956af94ab2e65cdd
, it has an additional field called hederaAccountId
as part of the issuer
and credentialSubject
in the VC which is set to 0.0.15215.
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Notes:
There is no need to pass in options
if you want to retrieve the VCs that are in the Metamask snap state as this is the default behavior however, for retrieving VCs from googleDrive
, you will need to specify via this parameter. In order to use googleDrive
, you first need to first configure your google account.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Retrieves the Verifiable Credentials(VCs) from the appropriate storage(eg. snap/googleDrive).
Some example responses:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Retrieves the VCs from google drive
Retrieves the VCs from the local Metamask snap state
Compare the VCs from both stores and figure out what VCs are missing in snap state that are present in google drive and what VCs are missing in google drive that are present in snap state
Import the missing VCs from google drive onto Metamask snap state
Export the missing VCs from Metamask snap state onto google drive
Some example responses:
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Retrieves the supported proof formats for Verifiable Credentials(VCs) that Identify Snap supports.
Some example responses:
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Note: If you want to look at an example code where you can implement a google sign in functionality to automatically retrieve the accessToken
from the user, look at the github link below:
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Retrieves the VCs from google drive
Retrieves the VCs from the local Metamask snap state
Compare the VCs from both stores and figure out what VCs are missing in snap state that are present in google drive and what VCs are missing in google drive that are present in snap state
Import the missing VCs from google drive onto Metamask snap state
Export the missing VCs from Metamask snap state onto google drive
Some example responses:
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Notes:
You will need to pass options
parameter only if you're passing vcIds
parameter as Identify Snap needs to know which store to use for VC lookup.
You can either pass in just the vcIds
or just the vcs
or you can mix-match by passing both of them simultaneously.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Retrieves the Verifiable Credentials(VCs) according to the vcIds
parameter passed.
Combines all the VCs passed with vcIds
and vcs
parameter and generates a Verifiable Presentation(VP) using the proofformat passed through proofInfo
parameter. Note that proofInfo
is optional and the default prooformat of jwt
is used.
Returns the VP generated from multiple VCs back to the application.
Some example responses:
Before you can call this API, you will need to first .
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this .
If you're getting any errors with the live demo, make sure you go through the section to learn about what you may be missing. You need to install in your browser for the live demo to work
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at .
You can also check out the to learn how each API works.
If you're getting any errors with the live demo, make sure you go through the section to learn about what you may be missing. You need to install in your browser for the live demo to work
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at .
You can also check out the to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this .
If you're getting any errors with the live demo, make sure you go through the section to learn about what you may be missing. You need to install in your browser for the live demo to work
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at .
You can also check out the to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this .
There is no need to pass in options
if you want to store the VC in the Metamask snap state as this is the default behavior however, for storing it in googleDrive
, you will need to specify via this parameter. In order to use googleDrive
, you first need to first .
Identify Snap currently supports using jwt
proof format however, it still supports the generation of VP of other types of VCs with other proof formats such as lds
and EthereumEip712Signature2021
.
If you're getting any errors with the live demo, make sure you go through the section to learn about what you may be missing. You need to install in your browser for the live demo to work
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at .
You can also check out the to learn how each API works.
To promote modularity and support the MetaMask Snap ecosystem, we've created plugins like the Snap Data Store plugin for private key management, DID operations, and VC storage within MetaMask's secure environment. Additionally, the Google Drive Data Store plugin enables remote VC storage on a user's personal Google Drive, allowing seamless syncing of Identify Snap data across browsers and devices. By making these plugins modular and independent, other snaps can also utilize them in their projects, encouraging code reuse for similar tasks.
You can check out the plugins that we have developed at our plugins repository.
Snaps run in an isolated environment within MetaMask and don't have default access to certain JavaScript globals or Metamask JSON-RPC methods. Identify Snap seeks user permissions in compliance with the EIP-2255 wallet permissions specification to access specific features, ensuring a secure and controlled experience. Refer to Metamask Snap Permissions documentation to learn more about snap permissions.
To learn about how accounts works within Identify Snap, refer to the Snap Account documentation.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
In this tutorial, we are going to retrieve DID info when we want to connect to our Metamask account.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Returns the did of the metamask account.
Some example responses:
For an evm account 0x2e5ff0267b678a0faf9a9f5b0fbf7ac9638b5b57
on Ethereum network:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
To learn about how accounts works within Identify Snap, refer to the Snap Account documentation.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
In this tutorial, we are going to retrieve DID info when we want to connect to our non-metamask(external) account on the Hedera network.
Make sure that you have added Hedera Network to your Metamask settings.
Hedera Testnet
RPC URL: https://testnet.hashio.io/api
Chain ID: 296
Currency Symbol: HBAR
Hedera Mainnet
RPC URL: https://mainnet.hashio.io/api
Chain ID: 295
Currency Symbol: HBAR
Fore more info on JSON-RPC Relay for Hedera Hashgraph, go to HashIo website.
Note: Identify Snap will ensure that you're first connected to Hedera network before you can call any hedera specific APIs.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Returns the did of the non-metamask account on the Hedera network.
Some example responses:
For a hedera account id 0.0.15215
with evm address 0x7d871f006d97498ea338268a956af94ab2e65cdd
on Hedera network:
Make sure you're connected to the Hedera network before trying out the following demo.
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
To learn about how accounts works within Identify Snap, refer to the Snap Account documentation.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
By default, accounts on the Hedera ledger do not have account ids. Whenever a hedera account first interacts with the Hedera ledger, an account id is automatically generated. As the Identify Snap requires each hedera account to have an account id in addition to an EVM address, we have provided the createNewHederaAccount snap API that will let a user help generate a new account id for a new hedera account based on its public key. If you want to generate an account id for a new hedera account based on its EVM address, refer to the tutorial for that here.
In this tutorial, we are going to create a new hedera account id on the Hedera ledger by sending some HBAR to a public key.
Make sure that you have added Hedera Network to your Metamask settings.
Hedera Testnet
RPC URL: https://testnet.hashio.io/api
Chain ID: 296
Currency Symbol: HBAR
Hedera Mainnet
RPC URL: https://mainnet.hashio.io/api
Chain ID: 295
Currency Symbol: HBAR
Fore more info on JSON-RPC Relay for Hedera Hashgraph, go to HashIo website.
Notes: Identify Snap will ensure that you're first connected to Hedera network before you can call any hedera specific APIs.
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Queries the Hedera Mirror Node to check whether an account id already exists for a given public key.
If an account id already exists on the ledger, the snap returns it along with other information such as the current balance of the hedera account.
If an account id doesn't exist on the ledger, the snap uses hedera sdk to send the appropriate amount of tinybars(smallest unit of HBARs on the hedera network) to the given public key address.
The account id is retrieved from the transaction receipt and returned as the result.
Some example responses:
Creating a new hedera account id for a public key: 032edfa618284f77c5e2092862964c1d233c74cc309c893c53a06ad71b8a8ccac0
Calling the API to create a hedera account id for a public key address whereby accountId already exists on the hedera ledger:
Make sure you're connected to the Hedera network before trying out the following demo.
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.
Identify Snap connects to your currently connected Metamask account by default. To learn how apps can connect to Identify Snap using a non-metamask(external) account, refer to this documentation.
Then, depending on whether you're trying to connect to a metamask account or a non-metamask account, you can call the snap API in the following way:
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Checks to see whether the passed Verifiable Presentation(VP) is a valid VP such as checking for the valid signature and whether or not the did in the VC is resolvable and whether or not it has the correct proofformat.
Returns a boolean value depending on the result.
Some example responses:
To ease the integration of Identify Snap on an application, we have created a template web application that you can run locally and check out the code in its entirety to learn how you can integrate and interact with various APIs exposed by Identify Snap. Check out the full source code at template application github repository.
You can also check out the API reference to learn how each API works.