Skip to content
Draft
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
101 changes: 101 additions & 0 deletions docs/sdk/sdk-parity-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Executable current Kotlin/Swift parity truth for the correctness, persistence, recovery, shared-policy, and immediate example-app capabilities audited from the PR #3999 baseline.",
"declared_persistence_capabilities": [
"asset_lock_funding_indices",
"asset_lock_identity_recipients",
"asset_lock_operation_ids",
"atomic_changesets",
"invitations",
Expand Down Expand Up @@ -46,6 +47,7 @@
"on_persist_private_contact_scan_state_fn": "packages/rs-platform-wallet-ffi/src/persistence.rs",
"on_persist_shielded_viewing_keys_fn": "packages/rs-platform-wallet-ffi/src/persistence.rs",
"platform_address_wallet_addresses_with_balances": "packages/rs-platform-wallet-ffi/src/platform_addresses/wallet.rs",
"platform_wallet_assign_identity_top_up_recipient": "packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs",
"platform_wallet_claim_invitation": "packages/rs-platform-wallet-ffi/src/invitation.rs",
"platform_wallet_create_document_with_signer": "packages/rs-platform-wallet-ffi/src/document.rs",
"platform_wallet_create_invitation": "packages/rs-platform-wallet-ffi/src/invitation.rs",
Expand All @@ -65,12 +67,14 @@
"platform_wallet_manager_shielded_wallet_drain_status": "packages/rs-platform-wallet-ffi/src/shielded_wallet_drain.rs",
"platform_wallet_manager_spv_rescan_filters": "packages/rs-platform-wallet-ffi/src/spv.rs",
"platform_wallet_manager_sync_fault_detected": "packages/rs-platform-wallet-ffi/src/manager.rs",
"platform_wallet_resume_identity_top_up_to_recorded_recipient_signer": "packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs",
"platform_wallet_resume_identity_with_existing_asset_lock_signer": "packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs",
"platform_wallet_sync_contested_dpns_names": "packages/rs-platform-wallet-ffi/src/dpns.rs",
"platform_wallet_sync_private_contact_requests": "packages/rs-platform-wallet-ffi/src/private_contact_request.rs",
"platform_wallet_token_purchase": "packages/rs-platform-wallet-ffi/src/tokens/purchase.rs",
"platform_wallet_token_transfer": "packages/rs-platform-wallet-ffi/src/tokens/transfer.rs",
"platform_wallet_token_update_config": "packages/rs-platform-wallet-ffi/src/tokens/update_config.rs",
"platform_wallet_top_up_external_identity_with_funding_signer": "packages/rs-platform-wallet-ffi/src/identity_top_up.rs",
"platform_wallet_top_up_from_addresses_with_signer": "packages/rs-platform-wallet-ffi/src/identity_top_up.rs",
"platform_wallet_topup_identity_with_existing_asset_lock_signer": "packages/rs-platform-wallet-ffi/src/identity_registration_funded_with_signer.rs",
"platform_wallet_tracked_asset_locks_free": "packages/rs-platform-wallet-ffi/src/manager_diagnostics.rs",
Expand Down Expand Up @@ -1160,6 +1164,103 @@
}
]
},
{
"id": "identity.top_up_any_identity_from_core",
"title": "Top up any identity from the Core balance, its recorded recipient kept across restart, assign and resume",
"area": "recovery",
"shared_apis": [
"platform_wallet_top_up_external_identity_with_funding_signer",
"platform_wallet_resume_identity_top_up_to_recorded_recipient_signer",
"platform_wallet_assign_identity_top_up_recipient",
"platform_wallet_tracked_asset_locks_list"
],
"required_persistence_capabilities": [
"asset_lock_identity_recipients",
"atomic_changesets",
"tracked_asset_locks",
"wallet_restore"
],
"hosts": {
"swift": {
"sdk": "unsupported",
"example_app": "unsupported",
"restart": "required",
"reason": "The Swift bindings, the SwiftData identity-recipient sidecar and the recovery UI are a separate change landing in parallel (dashpay/platform#5924 PR C)."
},
"kotlin": {
"sdk": "partial",
"example_app": "partial",
"restart": "required",
"reason": "Room v17 keeps the operation-UUID, shielded-recipient and identity-recipient sidecars (immutable, carried through upserts, fail-closed loads) and the handler attests bits 13, 14 and 17; JNI binds the external top-up, the recorded-recipient resume and the assignment, and TrackedAssetLock carries the recipient and the unassigned flag. The Top Up from Core screen resumes through the recorded recipient and assigns unassigned locks, but has no screen for the external top-up itself. Remaining gates: a funded testnet run of external top-up, interrupted resume across process death, and assignment."
}
},
"verification": [
{
"host": "kotlin",
"kind": "unit",
"file": "packages/kotlin-sdk/sdk/src/test/kotlin/org/dashfoundation/dashsdk/persistence/AssetLockSidecarPersistenceTest.kt",
"id": "shouldStoreEachSidecarAfterItsUpsertInTheSameRoundAndLoadItBack",
"command": "cd packages/kotlin-sdk && ./gradlew :sdk:testDebugUnitTest --tests '*AssetLockSidecarPersistenceTest*'",
"covers_restart": false
},
{
"host": "kotlin",
"kind": "unit",
"file": "packages/kotlin-sdk/sdk/src/test/kotlin/org/dashfoundation/dashsdk/persistence/AssetLockSidecarPersistenceTest.kt",
"id": "shouldAcceptTheSameValueAgainAndRefuseADifferentOne",
"command": "cd packages/kotlin-sdk && ./gradlew :sdk:testDebugUnitTest --tests '*AssetLockSidecarPersistenceTest*'",
"covers_restart": false
},
{
"host": "kotlin",
"kind": "unit",
"file": "packages/kotlin-sdk/sdk/src/test/kotlin/org/dashfoundation/dashsdk/credits/RecipientTopUpTest.kt",
"id": "shouldResumeEveryIdentityTopUpLockByOutpointWithoutNamingAnIdentity",
"command": "cd packages/kotlin-sdk && ./gradlew :sdk:testDebugUnitTest --tests '*RecipientTopUpTest*'",
"covers_restart": false
},
{
"host": "kotlin",
"kind": "device",
"file": "packages/kotlin-sdk/sdk/src/androidTest/kotlin/org/dashfoundation/dashsdk/wallet/WalletManagerRoundTripTest.kt",
"id": "assetLockSidecarsRoundTripThroughAReload",
"command": "cd packages/kotlin-sdk && ./gradlew :sdk:connectedDebugAndroidTest",
"covers_restart": true
},
{
"host": "kotlin",
"kind": "device",
"file": "packages/kotlin-sdk/sdk/src/androidTest/kotlin/org/dashfoundation/dashsdk/FfiSmokeTest.kt",
"id": "assetLockSidecarCapabilitiesNeedBothOverridesOfTheirPair",
"command": "cd packages/kotlin-sdk && ./gradlew :sdk:connectedDebugAndroidTest",
"covers_restart": false
},
{
"host": "kotlin",
"kind": "unit",
"file": "packages/kotlin-sdk/KotlinExampleApp/app/src/test/java/org/dashfoundation/example/services/assetlock/IdentityAssetLockRecoveryTest.kt",
"id": "should list an unassigned unbound topup apart and never as resumable",
"command": "cd packages/kotlin-sdk && ./gradlew :app:testDebugUnitTest",
"covers_restart": false
},
{
"host": "shared",
"kind": "unit",
"file": "packages/rs-platform-wallet/src/wallet/asset_lock/build.rs",
"id": "should_assign_an_unassigned_unbound_top_up_lock_once",
"command": "cargo test -p platform-wallet should_assign_an_unassigned_unbound_top_up_lock_once",
"covers_restart": false
},
{
"host": "shared",
"kind": "integration",
"file": "packages/rs-platform-wallet-storage/tests/integration/sqlite_asset_locks_filter.rs",
"id": "should_preserve_identity_recipient_when_later_snapshot_lacks_it_and_reject_a_change",
"command": "cargo test -p platform-wallet-storage --test integration should_preserve_identity_recipient_when_later_snapshot_lacks_it_and_reject_a_change",
"covers_restart": true
}
]
},
{
"id": "core.compact_filter_rescan",
"title": "User-triggered compact-filter rescan",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
package org.dashfoundation.example.services.assetlock

import org.dashfoundation.dashsdk.wallet.TrackedAssetLock
import org.dashfoundation.example.util.toHex

/** Pure presentation filtering; Rust remains the recovery state machine. */
object IdentityAssetLockRecovery {
fun registrations(rows: List<TrackedAssetLock>): List<TrackedAssetLock> =
rows.filter { it.fundingType == TrackedAssetLock.FundingType.IDENTITY_REGISTRATION }

/**
* Top-up locks a resume pays: bound ones for the selected identity, and
* unbound ones Rust has not flagged unassigned. A resume
* (`IdentityCredits.resumeTopUpToRecordedRecipient`) pays the identity
* the lock is for — an unbound lock's recorded recipient, which may be
* someone else's identity — so the screen's identity is never passed.
*/
fun topUps(
rows: List<TrackedAssetLock>,
selectedIdentityIndex: Int,
): List<TrackedAssetLock> =
rows.filter {
(it.fundingType == TrackedAssetLock.FundingType.IDENTITY_TOP_UP &&
it.registrationIndex == selectedIdentityIndex) ||
it.fundingType == TrackedAssetLock.FundingType.IDENTITY_TOP_UP_NOT_BOUND
(it.fundingType == TrackedAssetLock.FundingType.IDENTITY_TOP_UP_NOT_BOUND &&
!it.identityRecipientUnassigned)
}

/**
* Unbound top-up locks recording no identity (Rust's
* `identity_recipient_unassigned`): no resume pays them, so they are
* listed apart, for the user to assign an identity first.
*/
fun unassignedTopUps(rows: List<TrackedAssetLock>): List<TrackedAssetLock> =
rows.filter { it.identityRecipientUnassigned }

/** Resume-only dispatch: callers cannot accidentally select a fresh-funding operation. */
suspend fun <T> submitRegistrationResume(
lock: TrackedAssetLock,
Expand All @@ -31,6 +48,7 @@ object IdentityAssetLockRecovery {

/** Display-only; submission passes the snapshot's original bytes/vout. */
fun label(lock: TrackedAssetLock): String =
lock.outpointTxid.reversedArray().joinToString("") { "%02x".format(it) }.take(8) +
":${lock.outpointVout} · ${lock.status.name.lowercase().replace('_', ' ')}"
lock.outpointTxid.reversedArray().toHex().take(8) +
":${lock.outpointVout} · ${lock.status.name.lowercase().replace('_', ' ')}" +
(lock.identityRecipient?.let { " → " + it.toHex().take(8) } ?: "")
}
Loading
Loading