Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
75eb8b4
fix(drive): reject stale lower-version inserts into the data contract…
QuantumExplorer Jul 26, 2026
af9f38b
feat(dpp)!: DashPay payment addresses and payment key purposes (DIP-33)
QuantumExplorer Aug 3, 2026
4e33a05
fix(dpp): allow non-camel-case on wasm KeyPurpose enums for new variants
QuantumExplorer Aug 3, 2026
df679f2
test(platform-wallet): fix stealth test hash extraction from Core add…
QuantumExplorer Aug 3, 2026
6693d75
fix(dpp): drop Base58 pattern on corePaymentAddress, rebaseline PV14 …
QuantumExplorer Aug 3, 2026
b2b51fb
fix(dpp): address review — wire-safe error variants, compressed payme…
QuantumExplorer Aug 12, 2026
07c5630
feat(dpp)!: store corePaymentAddress as 21-byte storage form
QuantumExplorer Aug 12, 2026
2e0d766
feat(dpp)!: dashpay profile payment addresses for core and platform
QuantumExplorer Aug 12, 2026
7fedd37
Merge branch 'feat/dashpay-tips-jar' into feat/dashpay-payment-addresses
QuantumExplorer Aug 12, 2026
f1ef4cc
fix(drive-abci): enforce payment-address type bytes with a data trigg…
QuantumExplorer Aug 12, 2026
ea6bf15
Merge remote-tracking branch 'origin/feat/dashpay-tips-jar' into feat…
QuantumExplorer Aug 12, 2026
506be16
test(drive-abci): shared payment-address fixture helper, should-prefi…
QuantumExplorer Aug 12, 2026
b55566e
Merge remote-tracking branch 'origin/feat/dashpay-tips-jar' into feat…
QuantumExplorer Aug 12, 2026
cbd7e9c
docs(platform-version): describe bindings v2 at its v10 use site
QuantumExplorer Aug 12, 2026
79154a2
Merge remote-tracking branch 'origin/feat/dashpay-tips-jar' into feat…
QuantumExplorer Aug 12, 2026
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

271 changes: 271 additions & 0 deletions packages/dashpay-contract/schema/v2/dashpay.schema.json
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. Clients render it as Base58Check for the network they are on and MUST validate the type byte before paying. 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",
"position": 6
}
},
"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
}
}
8 changes: 5 additions & 3 deletions packages/dashpay-contract/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod error;
pub mod v1;
pub mod v2;

pub use crate::error::Error;
use platform_value::{Identifier, IdentifierBytes32};
Expand All @@ -18,20 +19,21 @@ pub const OWNER_ID: Identifier = Identifier(IdentifierBytes32(OWNER_ID_BYTES));

pub fn load_definitions(platform_version: &PlatformVersion) -> Result<Option<Value>, Error> {
match platform_version.system_data_contracts.dashpay {
1 => Ok(None),
1 | 2 => Ok(None),
version => Err(Error::UnknownVersionMismatch {
method: "dashpay_contract::load_definitions".to_string(),
known_versions: vec![1],
known_versions: vec![1, 2],
received: version,
}),
}
}
pub fn load_documents_schemas(platform_version: &PlatformVersion) -> Result<Value, Error> {
match platform_version.system_data_contracts.dashpay {
1 => v1::load_documents_schemas(),
2 => v2::load_documents_schemas(),
version => Err(Error::UnknownVersionMismatch {
method: "dashpay_contract::load_documents_schemas".to_string(),
known_versions: vec![1],
known_versions: vec![1, 2],
received: version,
}),
}
Expand Down
11 changes: 11 additions & 0 deletions packages/dashpay-contract/src/v2/mod.rs
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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ private fun KeyPurpose.displayName(): String = when (this) {
KeyPurpose.SYSTEM -> "System"
KeyPurpose.VOTING -> "Voting"
KeyPurpose.OWNER -> "Owner"
KeyPurpose.PAYMENT_SCAN -> "Payment Scan"
KeyPurpose.PAYMENT_SPEND -> "Payment Spend"
}

private fun SecurityLevel.displayName(): String = when (this) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ enum class KeyPurpose(val ffiValue: Int) {
SYSTEM(4),
VOTING(5),
OWNER(6),
PAYMENT_SCAN(7),
PAYMENT_SPEND(8),
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub struct AddressWitnessVerificationOperations {
/// Hash160 = RIPEMD160(SHA256(pubkey))
pub pubkey_hash_verifications: u16,

/// Number of script hash (SHA256) verifications performed.
/// Used to verify P2SH redeem scripts.
/// Number of script hash (Hash160) verifications performed.
/// Hash160 = RIPEMD160(SHA256(redeem_script)); used to verify P2SH redeem scripts.
pub script_hash_verifications: u16,

/// Size of the signable bytes in bytes.
Expand Down
Loading
Loading