Decentralized ID and Polygon ID

Victor Yeo
3 min readSep 16, 2023

Definition
In simple terms, decentralized identifier (DID) means that you prove your identities, such as who you are; without relying on any central authority (or centralized service provider).

A DID can refer to a person, an organisation, or an object, etc. Each identity in DID is represented by DID document. Each DID document can express the cryptographic info, verification method that provides mechanism on proving of DID.

An example of DID document is shown below.

Besides the DID document, identity information is represented by Verifiable Credentials (VC). The information in VC can be the age of a person, or membership certificate held by an organisation.

Polygon ID

Developed by Polygon Labs, Polygon ID is a way to build an DID application and provide DID proof without revealing any private information. No private information is revealed because zero knowledge proof (ZKP) is used in the proof verification.

Polygon ID is compliant with W3C standards. The Polygon DID specification can be found here.

Polygon ID architecture

In the above picture, it shows the architecture of Polygon ID framework. The three components are:
1. Credential Issuer: an entity that issues VC to the credential holder. There is an example issuer.

There are two methods of issuance of VC:
Signature type method which is off-chain issuance.
Merkle tree type method which is on-chain issuance. In this second method, issuer hashes the verifiable credentials and creates a merkle tree and publishes the root hash of the merkle tree on blockchain. This root hash does not comprise of actual data in the VC but it contains three different roots of a tree (claims root, revocation root, roots tree root). For details, please see iden3 documentation.

2. Credential Holder: an entity that holds VC in its wallet.

3. Credential Verifier: an entity that verifies the proof presented by the holder.
Credential verification can be performed off-chain or on-chain via smart contracts.

The identity info is stored in VC. Polygon ID provides an example schema builder to build VC.

Development
To develop an end to end application using Polygon ID, we can use the tools provided by Polygon.

For Credential Issuer, see: https://0xpolygonid.github.io/tutorials/issuer/issuer-overview/
There are two ways the Credential Issuer can be implemented:

  • Issuer Node Core API
  • Issuer Node UI
Issuer Node UI screenshot

The above image shows Issuer Node UI creating an identity.

For DID mobile app of Credential Holder, use the Polygon ID JS SDK:
https://github.com/0xPolygonID/js-sdk

For Credential Verifier, see the sample app:
https://github.com/oceans404/fullstack-polygon-id-vc-gated-dapp
The sample app has React frontend and nodeJS backend. The nodeJS backend interacts with the Polygon ID smart contract.

For Polygon ID to work on any EVM compatible chain, there are some smart contracts required.

The state contracts (transparent upgradeable proxy and main contract) are a mandatory part of Polygon ID. The state contracts contains data information of identity. The state contracts can be found at: https://github.com/iden3/contracts/tree/master/contracts/state

If we want to do on-chain ZKP verification of the identity, the verification smart contracts are at: https://github.com/0xPolygonID/contracts/tree/main/contracts

Conclusion

Polygon ID offers a solution to help with identity use cases by using zero-knowledge proof technology, which enables users to prove their identity without necessarily disclosing personal information to third parties.

References
https://www.w3.org/TR/did-core/

https://0xpolygonid.github.io/tutorials/

--

--