Introduction
Users can have multiple identities or DIDs on Polymesh, and multiple keys associated with each DID (although keys can only be associated with one DID). However, not all keys are of the same kind.
Users can optionally configure secondary keys to permit access to specific things on-chain. Like primary keys, a secondary key can sign transactions on behalf of an identity, but its permissions are limited to only certain actions, portfolios, or assets. Secondary keys can be added or removed by the primary key of its identity at any time. Learn more about secondary keys here.
How to assign a Secondary key with the Polymesh App
Step 1 - Primary key owner to create an authorization
First of all, the primary key owner creates an authorization targeting the secondary key.
Open the Polymesh App then fill in the data:
- using the selected account: Select the account you want to sign the transaction. It should be the primary key.
-
submit the following extrinsic: Select
identity
thenaddAuthorization(target, data, expiry)
Click here to see this image at full resolution.
-
target: Select
Account
-
Account: Paste the target secondary key into this field.
Click here to see this image at full resolution.
-
data: Select
JoinIdentity
-
JoinIdentity: here you can select permissions for the secondary key
-
asset: You can keep the default value
Whole
-
extrinsic: You can keep the default value
Whole
-
portfolio: You can keep the default value
Whole
Click here to see this image at full resolution.
-
asset: You can keep the default value
-
expiry: This is an optional expiry time for this specific attestation. Enter the expiry date and time in Unix timestamp format. You can use a converter like this one.
Click here to see this image at full resolution.
Submit Transaction
then confirm and sign the transaction with your wallet. Step 2 - Secondary key owner to retrieve authorization ID
The next step is that the owner of the secondary key queries the blockchain for its authorization ID.
Go to the Polymesh App then fill in the data as per below:
- Selected state query: select
Identity
thenAuthorizations
- Paste the secondary Polymesh from your wallet (which begins with 2) to the field Identity: PolymeshPrimitivesIdentityId
- Click off the “include option” toggle
-
Click the
+
button at the top right to see the AuthID
Click here to see this image at full resolution. -
This will get you the authorization ID for the JoinIdentity call. Copy it as you will need it at the next step (54603 in this example):
Step 3 - Secondary key owner to accept incoming authorization
The final step is that the owner of the secondary key accepts the authorization to join the primary key's identity.
- using the selected account: Select the secondary key.
-
submit the following extrinsic: Select
identity
thenjoinIdentityAsKey
-
authId: Enter the AuthID you've gathered in the previous step (54603 in this example).
Click here to see this image at full resolution.
Submit Transaction
then confirm and sign the transaction with your wallet. How to remove a Secondary key with the Polymesh App
Either the primary key owner can remove a secondary key or the secondary key owner can leave its identity from the primary key.
Primary key owner to remove secondary key
- using the selected account: Select the account you want to sign the transaction. It should be the primary key.
-
submit the following extrinsic: Select
identity
thenremoveSecondaryKey(keysToRemove)
-
keysToRemove: Select the secondary key you want to remove.
Click here to see this image at full resolution.
Submit Transaction
then confirm and sign the transaction with your wallet. Secondary key owner to leave identity
- using the selected account: Select the account you want to sign the transaction. It should be the secondary key.
-
submit the following extrinsic: Select
identity
thenleaveIdentityAsKey()
Click here to see this image at full resolution.
Submit Transaction
at the bottom, then confirm and sign the transaction with your wallet. Learn more
How to assign a secondary key on the Polymesh Dashboard
How to assign or remove a Secondary key on the Polymesh Portal
Explaining uID, Accounts, and Keys
Identity - Polymesh Developer Portal
The Polymesh Pillar Series: Identity on Polymesh
The Polymesh Wallet Extension, Addresses, and Keys - Polymesh Website
Comments
0 comments
Please sign in to leave a comment.