-
Notifications
You must be signed in to change notification settings - Fork 56
feat(dpp)!: dashpay profile payment addresses for core and platform #4380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2e0d766
feat(dpp)!: dashpay profile payment addresses for core and platform
QuantumExplorer f1ef4cc
fix(drive-abci): enforce payment-address type bytes with a data trigg…
QuantumExplorer 506be16
test(drive-abci): shared payment-address fixture helper, should-prefi…
QuantumExplorer cbd7e9c
docs(platform-version): describe bindings v2 at its v10 use site
QuantumExplorer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
271 changes: 271 additions & 0 deletions
271
packages/dashpay-contract/schema/v2/dashpay.schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,271 @@ | ||
| { | ||
| "profile": { | ||
| "type": "object", | ||
| "indices": [ | ||
| { | ||
| "name": "ownerId", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| } | ||
| ], | ||
| "unique": true | ||
| }, | ||
| { | ||
| "name": "ownerIdAndUpdatedAt", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| }, | ||
| { | ||
| "$updatedAt": "asc" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "properties": { | ||
| "avatarUrl": { | ||
| "type": "string", | ||
| "format": "uri", | ||
| "minLength": 1, | ||
| "maxLength": 2048, | ||
| "position": 0 | ||
| }, | ||
| "avatarHash": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 32, | ||
| "maxItems": 32, | ||
| "description": "SHA256 hash of the bytes of the image specified by avatarUrl", | ||
| "position": 1 | ||
| }, | ||
| "avatarFingerprint": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 8, | ||
| "maxItems": 8, | ||
| "description": "dHash the image specified by avatarUrl", | ||
| "position": 2 | ||
| }, | ||
| "publicMessage": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "maxLength": 140, | ||
| "position": 3 | ||
| }, | ||
| "displayName": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "maxLength": 25, | ||
| "position": 4 | ||
| }, | ||
| "corePaymentAddress": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 21, | ||
| "maxItems": 21, | ||
| "description": "Core chain address in storage form (type byte 0x00 P2PKH / 0x01 P2SH followed by the 20-byte HASH160, i.e. RIPEMD160 of SHA256, of the public key or redeem script) for public payments. The type byte is consensus-enforced by a data trigger; clients render the address as Base58Check for the network they are on. Payments to it are publicly linkable to this profile.", | ||
| "position": 5 | ||
| }, | ||
| "platformPaymentAddress": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 21, | ||
| "maxItems": 21, | ||
| "description": "Platform address in storage form (type byte 0x00 P2PKH / 0x01 P2SH followed by the 20-byte HASH160, i.e. RIPEMD160 of SHA256, of the public key or redeem script) for public payments. The type byte is consensus-enforced by a data trigger.", | ||
| "position": 6 | ||
|
QuantumExplorer marked this conversation as resolved.
|
||
| } | ||
| }, | ||
| "minProperties": 1, | ||
| "dependentRequired": { | ||
| "avatarUrl": ["avatarHash", "avatarFingerprint"], | ||
| "avatarHash": ["avatarUrl", "avatarFingerprint"], | ||
| "avatarFingerprint": ["avatarUrl", "avatarHash"] | ||
| }, | ||
| "required": [ | ||
| "$createdAt", | ||
| "$updatedAt" | ||
| ], | ||
| "additionalProperties": false | ||
| }, | ||
| "contactInfo": { | ||
| "type": "object", | ||
| "indices": [ | ||
| { | ||
| "name": "ownerIdAndKeys", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| }, | ||
| { | ||
| "rootEncryptionKeyIndex": "asc" | ||
| }, | ||
| { | ||
| "derivationEncryptionKeyIndex": "asc" | ||
| } | ||
| ], | ||
| "unique": true | ||
| }, | ||
| { | ||
| "name": "ownerIdAndUpdatedAt", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| }, | ||
| { | ||
| "$updatedAt": "asc" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "properties": { | ||
| "encToUserId": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 32, | ||
| "maxItems": 32, | ||
| "position": 0 | ||
| }, | ||
| "rootEncryptionKeyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "position": 1 | ||
| }, | ||
| "derivationEncryptionKeyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "position": 2 | ||
| }, | ||
| "privateData": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 48, | ||
| "maxItems": 2048, | ||
| "position": 3, | ||
| "description": "This is the encrypted values of aliasName + note + displayHidden encoded as an array in cbor" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "$createdAt", | ||
| "$updatedAt", | ||
| "encToUserId", | ||
| "privateData", | ||
| "rootEncryptionKeyIndex", | ||
| "derivationEncryptionKeyIndex" | ||
| ], | ||
| "additionalProperties": false | ||
| }, | ||
| "contactRequest": { | ||
| "documentsMutable": false, | ||
| "canBeDeleted": false, | ||
| "requiresIdentityEncryptionBoundedKey": 2, | ||
| "requiresIdentityDecryptionBoundedKey": 2, | ||
| "type": "object", | ||
| "indices": [ | ||
| { | ||
| "name": "ownerIdUserIdAndAccountRef", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| }, | ||
| { | ||
| "toUserId": "asc" | ||
| }, | ||
| { | ||
| "accountReference": "asc" | ||
| } | ||
| ], | ||
| "unique": true | ||
| }, | ||
| { | ||
| "name": "ownerIdUserId", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| }, | ||
| { | ||
| "toUserId": "asc" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "userIdCreatedAt", | ||
| "properties": [ | ||
| { | ||
| "toUserId": "asc" | ||
| }, | ||
| { | ||
| "$createdAt": "asc" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "ownerIdCreatedAt", | ||
| "properties": [ | ||
| { | ||
| "$ownerId": "asc" | ||
| }, | ||
| { | ||
| "$createdAt": "asc" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "properties": { | ||
| "toUserId": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 32, | ||
| "maxItems": 32, | ||
| "position": 0, | ||
| "contentMediaType": "application/x.dash.dpp.identifier" | ||
| }, | ||
| "encryptedPublicKey": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 96, | ||
| "maxItems": 96, | ||
| "position": 1 | ||
| }, | ||
| "senderKeyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "position": 2 | ||
| }, | ||
| "recipientKeyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "position": 3 | ||
| }, | ||
| "accountReference": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "position": 4 | ||
| }, | ||
| "encryptedAccountLabel": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 48, | ||
| "maxItems": 80, | ||
| "position": 5 | ||
| }, | ||
| "autoAcceptProof": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 38, | ||
| "maxItems": 102, | ||
| "position": 6 | ||
| } | ||
| }, | ||
| "required": [ | ||
| "$createdAt", | ||
| "$createdAtCoreBlockHeight", | ||
| "toUserId", | ||
| "encryptedPublicKey", | ||
| "senderKeyIndex", | ||
| "recipientKeyIndex", | ||
| "accountReference" | ||
| ], | ||
| "additionalProperties": false | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| use crate::error::Error; | ||
| use serde_json::Value; | ||
|
|
||
| // Document-type name and property constants live in `crate::v1::document_types`; | ||
| // v2 does not change any names v1 defined, it only adds the optional | ||
| // `corePaymentAddress` / `platformPaymentAddress` properties to `profile`. | ||
|
|
||
| pub fn load_documents_schemas() -> Result<Value, Error> { | ||
| serde_json::from_str(include_str!("../../schema/v2/dashpay.schema.json")) | ||
| .map_err(Error::InvalidSchemaJson) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.