DIP verification testing
Explanation and Configuration on Substrate side
The Decentralized Identity Provider (DIP) pallet enables a Substrate-based chain provider (i.e. KILT Peregrine) to bridge the identities of its users to other connected chain consumers (i.e. Xcavate chain) trustlessly. A consumer chain can connect to a provider chain if there is a way for the consumer chain to verify proofs about parts of the state of the provider chain.
DIP verification is achieved through a Substrate pallet structure, which has been added to the runtime of the consumer chain. This pallet code then performs an origin check in the pallet’s config, enabling access to the DID identifier of the submitter, so its origin can be accessed from the extrinsic (example below).
The origin is created after the identity proof has been successfully verified by the proof verifier.
Testing
Follow the below steps in order to call the list_object function with a verified DID. This function can only be called if the origin has a verified DID.
1. Clone DIP SDK
An SDK to help integrate the KILT Decentralized Identity Provider (DIP) protocol using KILT as an Identity provider.
git clone https://github.com/XcavateBlockchain/dip-sdk-xcav
Since we are using the KILT Peregrine Provider, we have configured the Relay, Provider and Consumer rpc as shown below.
A pre-funded account has been set up, so that it can fund new test accounts.
To execute the testing script and call the list_object function you have to follow these steps:
1. cd dip-sdk-xcav
2. yarn install
3. yarn test:e2e:peregrine-provider
Once you execute the third command in the terminal, you can see the balance has been transferred from the prefunded account to a newly created account, which you can see in xcavate explorer in polkadotjs.
Before a DID can be verified it must be created. This can be done using the new account in the KILT Peregrine chain, which you can see in KILT Peregrine explorer in polkadotjs .
Once created the DID verification test can be executed. This extrinsic execution can be viewed in the polkadot js explorer.
If the transaction is going through it means that the DID is verified. If the DID were not verified, there would be an InvalidProof error.
Last updated