Repository navigation
feat(platform)!: dashpay contract v3 declares the checks of its data triggers #4933
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
QuantumExplorer
merged 24 commits into
v5.1-dev
from
claude/dpns-dashpay-4-2-upgrade-f971de
Nov 6, 2026
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
970b63a
feat(platform)!: DashPay contact requests declare their checks (PV14)
QuantumExplorer 64fb59c
test(drive-abci): re-pin the not-mutable replace fees for the fixed-s…
QuantumExplorer 11c7ebc
Merge v5.1-dev, superseding this branch's protocol version 14 edits
QuantumExplorer fdcd160
feat(platform)!: dashpay v3 declares the checks of its data triggers …
QuantumExplorer 8b16360
fix(platform): drop the needless struct update in the protocol versio…
QuantumExplorer ecf47d0
docs(platform): name the table that keeps DashPay v2 for protocol ver…
QuantumExplorer 3489faf
feat(platform)!: keep the DashPay v3 profile address descriptions in …
QuantumExplorer 9a20088
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 29e2ad6
test(platform): re-pin the latest-version fees and roots after the me…
QuantumExplorer 0252872
docs(platform): say the DashPay v3 ciphertext shape check is new, and…
QuantumExplorer 7abd036
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 3f03611
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 4a18fe5
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer b34cadd
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer b9c02b9
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 19daebd
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 8565a56
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 30a1839
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 2dd2027
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer 9c44544
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer e8f90ec
test(drive-abci): check DashPay v3's declarations on the upgraded con…
QuantumExplorer 2ad7f26
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer dd279c5
Merge v5.1-dev into the DashPay v3 branch
QuantumExplorer f974f3f
test(drive-abci): accept a DashPay profile without payment addresses
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
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
301 changes: 301 additions & 0 deletions
301
packages/dashpay-contract/schema/v3/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,301 @@ | ||
| { | ||
| "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 corePaymentAddressType rule holds the type byte; 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 platformPaymentAddressType rule holds the type byte.", | ||
| "position": 6 | ||
| }, | ||
| "shieldedAddress": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 43, | ||
| "maxItems": 43, | ||
| "description": "Raw Orchard receiving address: 11-byte diversifier followed by 32-byte diversified transmission key. Clients validate before payment; wallets should use a dedicated tip account.", | ||
| "position": 7 | ||
| } | ||
| }, | ||
| "minProperties": 1, | ||
| "dependentRequired": { | ||
| "avatarUrl": ["avatarHash", "avatarFingerprint"], | ||
| "avatarHash": ["avatarUrl", "avatarFingerprint"], | ||
| "avatarFingerprint": ["avatarUrl", "avatarHash"] | ||
| }, | ||
| "propertyConstraints": { | ||
| "corePaymentAddressType": { "in": [{ "byteAt": ["corePaymentAddress", 0] }, [0, 1]] }, | ||
| "platformPaymentAddressType": { "in": [{ "byteAt": ["platformPaymentAddress", 0] }, [0, 1]] } | ||
| }, | ||
| "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", | ||
| "refersTo": { | ||
| "type": "identity" | ||
| }, | ||
| "distinctFrom": "$ownerId" | ||
| }, | ||
| "encryptedPublicKey": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 96, | ||
| "maxItems": 96, | ||
| "encryptedFor": { | ||
| "recipient": "toUserId", | ||
| "recipientKey": "recipientKeyIndex", | ||
| "senderKey": "senderKeyIndex", | ||
| "scheme": "ecdh-secp256k1-aes256-cbc" | ||
| }, | ||
| "position": 1 | ||
| }, | ||
| "senderKeyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "maximum": 4294967295, | ||
| "position": 2 | ||
| }, | ||
| "recipientKeyIndex": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "maximum": 4294967295, | ||
| "position": 3 | ||
| }, | ||
| "accountReference": { | ||
| "type": "integer", | ||
| "minimum": 0, | ||
| "position": 4 | ||
| }, | ||
| "encryptedAccountLabel": { | ||
| "type": "array", | ||
| "byteArray": true, | ||
| "minItems": 48, | ||
| "maxItems": 80, | ||
| "encryptedFor": { | ||
| "recipient": "toUserId", | ||
| "recipientKey": "recipientKeyIndex", | ||
| "senderKey": "senderKeyIndex", | ||
| "scheme": "ecdh-secp256k1-aes256-cbc" | ||
| }, | ||
| "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,25 @@ | ||
| use crate::error::Error; | ||
| use serde_json::Value; | ||
|
|
||
| // Document-type name and property constants live in `crate::v1::document_types`; | ||
| // v3 keeps every name and property v2 declares, stored as v2 stores it, and adds | ||
| // declarations only: | ||
| // | ||
| // - `contactRequest.toUserId` refers to an identity and must differ from the | ||
| // writer (`refersTo` identity, `distinctFrom` `$ownerId`), the two checks the | ||
| // contact request data trigger made up to protocol version 14. | ||
| // - `contactRequest.encryptedPublicKey` and `encryptedAccountLabel` name their | ||
| // encryption (`encryptedFor`, ECDH between the sender's `senderKeyIndex` key and | ||
| // the recipient's `recipientKeyIndex` key, then AES-256-CBC with the IV first), | ||
| // so each must be an IV plus whole AES blocks. Both key indexes gain the u32 | ||
| // `maximum` that `encryptedFor` requires of a key id; DashPay keeps sized integer | ||
| // types off, so they are still stored as i64. | ||
| // - `profile`'s `corePaymentAddressType` and `platformPaymentAddressType` rules | ||
| // hold the first byte of each DIP-33 payment address to the address type, the | ||
| // check the profile data trigger made up to protocol version 14. Their descriptions say | ||
| // so in place of v2's mention of the data trigger. | ||
|
|
||
| pub fn load_documents_schemas() -> Result<Value, Error> { | ||
| serde_json::from_str(include_str!("../../schema/v3/dashpay.schema.json")) | ||
| .map_err(Error::InvalidSchemaJson) | ||
| } |
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.