Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/js-dpp/lib/identity/IdentityPublicKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ IdentityPublicKey.PURPOSES = {
AUTHENTICATION: 0,
ENCRYPTION: 1,
DECRYPTION: 2,
WITHDRAW: 3,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation here doesn't align with the Identity DIP: https://github.com/dashpay/dips/blob/master/dip-0011.md#identity-public-key which uses purpose 3 for something else and doesn't include withdraw. That difference will need to be reconciled with the DIP at some point.

};

IdentityPublicKey.SECURITY_LEVELS = {
Expand All @@ -262,5 +263,8 @@ IdentityPublicKey.ALLOWED_SECURITY_LEVELS[IdentityPublicKey.PURPOSES.ENCRYPTION]
IdentityPublicKey.ALLOWED_SECURITY_LEVELS[IdentityPublicKey.PURPOSES.DECRYPTION] = [
IdentityPublicKey.SECURITY_LEVELS.MEDIUM,
];
IdentityPublicKey.ALLOWED_SECURITY_LEVELS[IdentityPublicKey.PURPOSES.WITHDRAW] = [
IdentityPublicKey.SECURITY_LEVELS.MEDIUM,
];

module.exports = IdentityPublicKey;
5 changes: 3 additions & 2 deletions packages/js-dpp/schema/identity/publicKey.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
"enum": [
0,
1,
2
2,
3
],
"description": "Public key purpose. 0 - Authentication, 1 - Encryption, 2 - Decryption",
"description": "Public key purpose. 0 - Authentication, 1 - Encryption, 2 - Decryption, 3 - Withdraw",
"$comment": "It can't be changed after adding a key"
},
"securityLevel": {
Expand Down