Skip to content

feat(history): show shielded-pool activity in the Home history - #1690

Draft
HashEngineering wants to merge 53 commits into
feat/advanced-send-receivefrom
feat/shielded-history-rows
Draft

HashEngineering wants to merge 53 commits into
feat/advanced-send-receivefrom
feat/shielded-history-rows

Conversation

@HashEngineering

Copy link
Copy Markdown
Collaborator

Stacked on #1683 (feat/advanced-internal-transfer).

Problem

QA D-19T1-05: registering a username paid from the shielded pool spends 0.03 DASH with no Core transaction, so Home history shows nothing and the shielded balance drops unexplained. The DashPay welcome disclaimer also quoted the transparent balance ("You have 0.00000737 Dash") on a wallet about to pay from shielded.

What changes

  • Shielded activity in the Home history. One tx_display_cache row per SDK shielded_activities entry that has no Core transaction of its own. Room 22 → 23 adds a source column (0 = L1, 1 = shielded). L1 writers now clear and count L1 rows only; the wallet wipe still clears everything.
    • The value is the entry's effect on the Home total (L1 + shielded). Outgoing rows show amount + fee, so the username row reads −0.03 "Upgrade Fee". Credits convert at 1e11 per DASH, rounded down to the duff.
    • Not shown, because the Core transaction already has a row: shield from Core, and a withdrawal to the wallet's own Core address once the wallet holds the payout. While the payout waits in the Platform withdrawal queue, the withdrawal shows as "Unshielded".
    • A withdrawal to a foreign Core address, an unshield to someone else's Platform address, and a top-up of someone else's identity read "Sent". Ownership is resolved against the active wallet; an unknown owner never gets an own-balance label.
    • An own spend with only self-change, and outgoing entries with no known fee, get no row rather than a wrong amount.
    • ShieldedHistoryRowSync re-plans on shielded activity changes and on Core history changes (debounced). It replaces the shielded rows in one transaction and stops for a wallet wipe. A failed read or write writes nothing and retries.
  • Detail sheet for these rows, built on the existing transaction sheet: type, amount, network fee, date, status, From/To balances and memo. It follows the entry live and closes if the entry fails. Block explorer, tax category, memo edit and report issue are hidden (there is no Core txid).
  • Welcome disclaimer quotes the shielded balance when the shielded pool will pay the username.

Deferred (no SDK data)

  • Platform address transfers and withdrawals, and Identity credit transfers, withdrawals and top-ups. The SDK keeps only their current balances.

Known limits

  • After a restore, an own shield funded from an asset lock can show twice: once as shielded "Received", once as the Core "Shielded" row. The SDK activity row carries no Core txid to match on.
  • Activity dates are the SDK's record time, so a restored wallet's history sorts at the restore time.
  • A withdrawal to an own address the SDK has not derived yet reads "Sent". A withdrawal to an own address that already received coins gets no row until its payout lands.
  • For up to one debounce window after an own withdrawal's payout lands, both rows can show.

Testing

  • :wallet:compile_testNet3DebugKotlin passes.
  • New unit tests pass: ShieldedHistoryRowsTest, ShieldedHistoryRowSyncTest, ShieldedHistoryRowSyncRetryTest, PlatformActivityDetailFeedTest, AppDatabaseMigration22to23Test (real Room, from schema 22), UsernameDisclaimerBalanceTest.
  • Affected suites pass: ShieldedBalanceServiceTest, TxDisplayCache*, AssetLockKindResolver*. de.schildbach.wallet.service.platform.* (2,425 tests) last ran on the first commit, before the review fixes.
  • The 22 → 23 step was added to the instrumented DatabaseMigrationTest, but not run: androidTest does not compile at the base, for unrelated reasons.
  • Not yet tested on a device.

Local pre-review

  • Round 1: 4 blocking findings, fixed in b75b588.
  • Round 2: 2 blocking findings, fixed in 50711d0.
  • The round-2 fixes have not been reviewed again, because of the two-round limit.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

thepastaclaw commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 7e964e4. Normal review starts when eligible; priority review starts as soon as a slot is available.

@HashEngineering HashEngineering self-assigned this Nov 10, 2026
@HashEngineering
HashEngineering force-pushed the feat/shielded-history-rows branch from c35f177 to 8476cb2 Compare November 25, 2026 18:41
@HashEngineering
HashEngineering removed this pull request from stack #1681 November 27, 2026 00:32
HashEngineering and others added 22 commits November 26, 2026 16:38
…121)

The Advanced payments Send tab gets its own Compose page: send to a
username (Core, as today), to a typed/pasted/scanned destination, or by
scanning a Dash QR. The external send flow detects the destination type
from the whole address (Core, Platform dash1k/dash1s, Shielded dash1z,
identity ID) and rejects wrong-network or malformed input, then reuses
AmountEntryPage with From/To cards, a source picker, a confirm sheet and
PIN before every send.

ExternalSendService routes each source/destination pair to the SDK with
the SdkWriteResult rules (only provably pre-broadcast failures are
retryable, the bound wallet is captured and re-checked before submit).
Supported: Core->Core/Shielded/own Identity, Shielded->all,
Platform->Platform/Identity, Identity->Core/Platform/Identity. The rest
need SDK changes and are shown as not available yet. Basic mode is
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Core->Shielded locks amount + pool fee so the recipient gets the
  confirmed amount; fee, Max and Total agree.
- Core Max refuses when the balance changed since confirm; the confirm
  sheet shows a Max send as fee-inclusive, like Basic send-all.
- The SDK wallet is captured at confirm and checked before every write.
- An in-flight marker survives process death and restores the terminal
  "may have gone through" state instead of the editable form.
- dash: URIs for Shielded/Platform/Identity amount requests parse.
- The exact amount is pinned across a currency switch.
- AddressUtils/WifKey reject an empty Base58Check payload instead of
  crashing; destination detection never throws.
- Advanced scan keeps BIP70, AnyPay and serialized requests on the
  Basic invoice path.
- Live identity/shielded reads recover after a transient error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Keep the in-flight marker after a Sent until the user acknowledges it,
  so a process kill before the result is seen warns instead of
  reopening the form.
- Claim an acknowledgement atomically (new Acknowledging state) before
  clearing the marker, so a duplicate acknowledgement cannot clear a
  later send's marker.
- Core→Core: size the fee reserve by UTXO count and turn Max off when
  the balance does not exceed it, so the recipient amount is always
  positive.
- Core→Shielded Max now comes from the confirmed balance an asset lock
  can spend, with the L1 fee reserved up front; the Max retry is gone.

The Core Max drain is still uncapped by the confirmed amount (finding 1);
it is left for device testing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…inished

After the user closed the result of a send that went out (or may have),
the executor returned to Idle while the screen was leaving, and the
amount form, still holding the sent amount, became enabled again. A
`finished` flag, set before the executor is released and kept in saved
state, now keeps Continue, the keypad, Max and the source picker inert.
A not-sent result still returns to an editable amount.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…orm address

Bump the Kotlin SDK to 5.1.0-int36 (HashEngineering/platform
feat/kotlin-sdk-fund-from-asset-lock-external @ 760d00f559), which binds
fundFromAssetLockExternal, and use it for Core → Platform (P2PKH only).

- The payee gets exactly the amount; the lock carries a 62 000-duff margin
  (the DPP address-funding admission floor) whose remainder, after the
  Platform fee, lands on the wallet's own Platform address.
- Per the SDK contract the recipients are persisted before the call and the
  lock outpoint inside onAssetLockBuilt; once a lock is built a failure is
  "may have gone through", never Not sent.
- A resume sweep (executor start and screen open) completes an interrupted
  funding with exactly the persisted recipients, capped per process.
- A pending record blocks a second Core → Platform send.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Run the External Send Platform-funding resume sweep from
PlatformSynchronizationService.kickSdkEngines, right after the pending
wallet-shield sweep: every kick (app start and each blockchain-service
start), after the SDK bind pass. A stuck payee is now paid without the
user reopening External Send. The executor is injected as dagger.Lazy so
its service graph is built off the main thread and can't form a cycle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The app never started the Kotlin SDK's Platform-address (BLAST) sync, so
credits other wallets sent to our Platform addresses never appeared: the
wallet only knew balances it wrote itself.

PlatformAddressSyncService starts the SDK loop once the cutover is
committed, the SDK wallet is bound and exactly one SDK wallet is loaded.
PlatformSynchronizationService starts it with the L1 engine (foreground
blockchain-service lifetime, after the bind pass, and on bind heal) and
stops it last in stopSdkEngines (shutdown and wallet wipe). A stop
generation refuses a start decided before a stop. The SDK's 15 s interval
is used; External Send's 15 s Platform balance poll picks up each pass.

Verified on testnet emulators: a 0.05 DASH Core → Platform send from one
wallet appeared on the receiver's Platform address ten seconds later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closing a Sent or "may have gone through" result (including the one shown
after a process restart) now pops back to Home instead of only closing
the External Send screen, which left the user on Payments. The back
button, Not sent and leaving mid-send still return to Payments; if Home
is not on the back stack it falls back to the single pop.

Verified on a testnet emulator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Core → Platform-address External Send is an asset lock the SDK tracks
with funding type 4, which AssetLockKindResolver did not map, so its row
fell back to "Internal" with the internal-transfer icon.

Add AssetLockKind.PLATFORM for funding type 4: the row and detail sheet
read "Platform" with the sent arrow, count under the Sent filter and never
notify as received. The send seeds the kind from onAssetLockBuilt so the
row is right before the SDK's asset_locks row lands. A restored wallet's
own Platform top-up (also type 4) reads the same, since the funding type
cannot tell own from third-party.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ernal Send

Adopt Dash SDK 5.1.0-int37, which adds a partial Platform-address
withdrawal and recipient-taking shield calls, and turn on three
Advanced-mode External Send pairs:

- Platform → Core: ManagedPlatformWallet.withdrawCredits with
  wallet-selected inputs (never above an address's balance, at most 16,
  the first-sorting fee payer keeps the fee reserve). Amounts below the
  withdrawal minimum or above the maximum are refused before signing.
- Platform → Shielded: PlatformWalletManager.shieldedShieldToRecipient.
- Identity → Shielded: shieldedShieldFromIdentityToRecipient.

The three pairs show no fee estimate and keep Max off. Results stay
exactly-once (Sent / Not sent / may have gone through, never retried).
The shielded identity-debit-pending error and the own-shielded-recipient
refusal are now classified as NotBroadcast, as Rust builds nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A received AssetUnlock this wallet's shielded pool did not author can be
a Platform-address withdrawal (now sendable via Platform → Core), an
identity credit withdrawal or a foreign pool's unshield; the Core
transaction does not say which. "Unshielded Withdrawal" mislabelled the
first two, so the row now reads "Withdrawal". Own-pool unshields keep
"Unshielded"; receive semantics are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Switching the source after pressing Max kept the old source's Max as a
plain amount, so a Core Max could be confirmed as a Shielded send. Max
now follows the source: the amount is 0 and Continue disabled until the
new source's Max is read, then it is applied as if Max were pressed. A
source with no Max (unknown fee, empty balance) leaves the amount at 0.
Typing cancels a pending Max, and it survives process death.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- estimateFee drops its unused amount; estimateFee and maxSendable take
  the source and destination balance kinds (balanceKindOf, now shared).
- The shielded flag and own-identity flows are deduplicated before
  flatMapLatest, so an unrelated config write no longer restarts the
  balance flows or re-fetches the Identity balance.
- sendFromShielded and nativeWrite return mapWrite's mapping.
- The private retryReadErrors copy is replaced by the common helper.
- PlatformAddressSyncService shares SdkL1SendService's cutover check.
- ExternalSendFragment remembers its actions; the currency codes list is
  remembered per fiat code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The result used ModalDialog, a separate window that stayed above the
lock screen and could be closed without the PIN. It is now an in-screen
overlay like the source and confirm sheets, so the lock screen covers it
and it shows again after unlock. Back acknowledges the result as the
dialog did, and is ignored while the lock screen shows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rnal Send

A Core send that builds a transaction now returns its txid: the payment
itself for Core -> Core, and the asset lock for Core -> Platform,
Core -> Shielded and Core -> own identity. The screen then opens
TransactionResultActivity once, acknowledges the outcome and returns
Home, as the Basic send flow does. It opens only while the screen is
resumed and the wallet is unlocked. Sends without a Core transaction,
and every failure or unknown outcome, keep the in-screen result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The material3 Card import added for the result overlay took precedence
over the screen's private Card, so the From/To cards drew as Material3
cards (lavender, no padding). The private one is now SendCard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Core -> Platform send interrupted after its transition was submitted
could never resume: each resume rebuilds the same bytes, Tenderdash
refuses them as already in its cache, and the SDK returns that error
without waiting for the result. The record was kept, so every later
Core -> Platform send was refused as still pending. The resume sweep now
clears the record on the SDK's AlreadyExists error. Platform consumes a
lock once, so nothing can be paid twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pre-review findings on #1680:
- Platform, Identity and Shielded -> Core withdrawals now withdraw the
  amount plus the 190-duff Core fee, which Platform takes out of the
  withdrawn amount, so the recipient receives exactly what was
  confirmed. Limits and input selection use the gross amount; a
  Shielded -> Core Max shows the recipient amount net of the fee.
- A Core -> own identity send that only resumed an earlier unfinished
  top-up is now Not sent (EARLIER_TOP_UP_COMPLETED) instead of Sent.
- The confirm sheet's details scroll inside a weighted region, so the
  Cancel/Confirm row keeps its height on short screens or large text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shield to another wallet's Orchard address seeded the same SHIELD
kind as a shield into the wallet's own pool, so history showed it as an
internal transfer although the funds left the wallet. The external path
now seeds SHIELD_EXTERNAL: sent arrow, outgoing amount, titled
"Shielded", as the Core -> Platform send is titled "Platform". Like
PLATFORM, the kind is in-memory only; after a restart the funding-type
fallback reads SHIELD again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every non Core -> Core External Send route, and the Core -> Platform
resume sweep, now submits under FundingSelectionLock.withSharedSubmission
with the final bound-wallet check inside the hold, so a Reset Wallet can
neither race a credit payment nor have a stale funding record written
back after it cleared the store.

ExternalSendExecutor now forgets its state on wallet wipe (wipe listener
+ generation counter), so a finished or late-completing send of the
wiped wallet is never shown to, or opened by, the next wallet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…med locks

- Classify every typed *Unconfirmed SDK error (StateTransitionResultUnconfirmed,
  TransactionBroadcastUnconfirmed, shielded/masternode variants) as "may have
  gone through", ahead of any message match, in the credit writes, the
  shielded invite claim and the top-up recovery.
- Core -> Platform resume: the "Object already exists" match is gone (int38
  waits for the proved result itself). An unconfirmed outcome keeps the
  pending record for the next sweep.
- An AssetLockAlreadyConsumed answer is not proof, so, as the iOS wallet
  does, the record is moved to a durable "completion unconfirmed" set: it is
  no longer resumed automatically and no longer blocks new Core -> Platform
  sends, but is kept for a later manual retry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…essages out of logs

- The SDK's identityCredits.topUpFromAddresses only finds identities the
  wallet manages, so a Platform -> someone else's identity send failed on
  device with "Identity not found". External Send now offers Platform ->
  Identity only for the wallet's own (SDK-managed) identity, like
  Core -> Identity, and the service refuses the rest before building.
  Someone else's identity needs a Kotlin binding of platform#5860.
- That failure was logged with the SDK message, which named the recipient
  identity. External Send now logs only error class names (and a native
  code) via safeErrorSummary, never an exception message or stack trace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HashEngineering and others added 24 commits November 26, 2026 16:38
The SDK's PlatformShieldCapacityExceeded (native code 41) is raised while
fetching the shield's input nonces, before anything is built: the Platform
addresses cannot cover the amount plus input 0's fee reserve. It fell
through classifyBroadcastFailure to Ambiguous, so the user saw "Payment
status unknown, do not send again" for a transfer that never left. It is
now NotBroadcast (after the unconfirmed arm, which still wins) and maps to
INSUFFICIENT_FUNDS, so the user can enter a smaller amount.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nced mode

The Home Scan QR shortcut used only the legacy Core parser, so a Shielded
or Platform address (bare or dash:<addr>?amount=) failed with "invalid
Dash address". In Advanced mode, classify the scan the same way as the
Advanced Send page's Scan Dash QR: destinations open External Send
prefilled, a wrong-network address shows that error, and DashConnect,
BIP70, keys and raw transactions keep the legacy path. With Advanced mode
off nothing changes. MO-1121.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ode (MO-1125)

The Advanced payments Internal tab is now an internal-transfer screen
(Figma DashPay iOS 3333:10699): pick From and To among Core, Shielded,
Platform and Identity, enter an amount (DASH or fiat, Max), and confirm
through the same confirm/sending/result UI as External Send. No address
is entered: the transfer pays the wallet's own destination for the To
balance; transfers to Core use an unadvertised internal-chain address.

Supported now: Core->Shielded (self-shield), Core->Identity,
Shielded->Core/Platform/Identity, Platform->Shielded (self-shield),
Platform->Identity, Identity->Core/Platform. Core->Platform,
Platform->Core and Identity->Shielded show as not available yet (no
app wrapper / SDK support). History entry (AC14) is deferred.

- InternalTransferModels/Service/ServiceImpl: pair matrix, own
  destination resolution (fail closed), wallet-id pinning, routes.
- InternalTransferExecutor: application-scoped with its own durable
  in-flight marker, sibling of ExternalSendExecutor.
- Shared confirm components moved out of ExternalSendScreen.
- Internal tab always shown in Advanced mode; basic mode unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…125)

- Identity -> Platform resolves the wallet's own Platform address through
  a wallet-pinned SDK address-store read that does not need the shielded
  runtime, so the pair works with the shielded flag off.
- A chosen or restored pair is dropped only on confirmed absence
  (hasIdentity == false / shielded flag == false); an unreadable shielded
  flag is now null (unknown), not false.
- Focused InternalTransferExecutor tests for the durable in-flight marker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…125)

- Gate the Internal tab's BackHandler on the page being RESUMED, so Back
  on another Advanced Payments tab no longer closes a hidden sheet.
- Confirm validates the captured request (pair, wallet, balance/limit)
  instead of the live fiat-derived form; a refusal closes the sheet with
  a visible message, and submit re-checks after authentication.
- Re-render the fiat text of a Max or pinned amount when the exchange
  rate changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Route the Internal Platform → Core pair through the External Send's
partial Platform withdrawal (#1680) to the wallet's own unadvertised
Core address, pinned to the confirmed wallet, like Shielded → Core and
Identity → Core. No pre-send fee or Max, as in External Send. Core →
Platform and Identity → Shielded stay unavailable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…igation (MO-1125)

The Internal tab is a pager page of AdvancedPaymentsFragment, whose
destination keeps MainActivity's bottom navigation drawn over the bottom
of the nav host, so the "Transfer from/to" picker, the confirm sheet and
the sending card were partly hidden under it. Host them in their own
full-screen window (selected page only), as the app's other sheets over
the bottom navigation are. External Send, which has no bottom
navigation, is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The overlay window now covers the screen and pads itself by the system
  bars, so the scrim meets the status bar with no undimmed strip.
- The Internal page leaves the bottom navigation's height free, so the
  keypad's Continue is no longer drawn under it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Basic (non-Advanced) Payments shows only Receive | Send; Internal
transfers live in Advanced mode. A saved Internal tab opens Receive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closing a Sent, "may have gone through" (including the one shown after a
process restart) or other terminal outcome now pops back to Home, the way
the External Send does since 5610dfc. Not sent stays on the Internal tab
so the user can retry. The outcome is read before acknowledging, only the
selected pager page navigates, and it falls back to a single pop when Home
is not on the back stack.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…appears

The From/To picker, the confirm sheet, the sending overlay and the outcome
dialog are drawn in their own windows, which stayed above the lock screen
(dismissDialogsForLockScreen only dismisses DialogFragments).
InternalTransferFragment is now LockScreenAware: on lock the picker and the
confirm sheet close (the amount is kept), and the sending overlay and the
outcome are withheld, not acknowledged, until LockScreenActivity.walletLocked
turns false. A running transfer continues on the app scope.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…place

The Advanced payments screen now shows MainActivity's bottom navigation on
the Receive tab only; Internal and Send hide it, re-applied after the
destination listener when the screen becomes current again.

Without the bar, the Internal transfer's picker, confirm sheet and sending
overlay are drawn in place in the screen, as the External Send does, and
AboveBottomNavigation (a separate dialog window) and the 60dp bottom padding
are gone. The lock screen now covers those overlays, so on lock only the
outcome dialog (its own window) is withheld until unlock.

Verified on a testnet emulator: bar per tab, return from External Send,
picker Back, confirm sheet above the system navigation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
InternalTransferExecutor now mirrors ExternalSendExecutor's wipe handling:
a wallet-wipe listener plus a generation counter, so a finished, restarted
or late-completing transfer of the wiped wallet is never shown to, and never
touches the in-flight marker of, the next wallet.

InternalTransferServiceImpl's own routes (Core -> Shielded,
Shielded -> Platform, Platform -> Shielded) now submit under
FundingSelectionLock.withSharedSubmission with the bound-wallet check inside
the hold; delegated routes already take it in ExternalSendService.send.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
LockScreenActivity registered its Back callback with the activity as
LifecycleOwner. Such a callback is removed at ON_STOP and re-added at
ON_START, which the activity reaches after its fragments, so after any
screen-off it sat above every fragment and Compose BackHandler and took Back
from them (Advanced Payments: Back left the screen instead of closing the
balance picker or confirm sheet, and skipped acknowledging an outcome).

The activity's Back is now added once without a LifecycleOwner, so it stays
the lowest priority, and removed in onDestroy. A second callback, enabled
only while the lock screen is displayed and re-added on top when it comes
up, keeps Back from reaching the screens it covers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
External Send (#1680) now funds a Platform address from Core
(fundFromAssetLockExternal), so the Internal pair matrix allows
Core -> Platform. The route already delegated to External Send with the
wallet's own Platform address; fee (paid on top), Max, pending-funding
resume and the wipe barrier all come from External Send. Identity ->
Shielded is now the only pair not supported yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
External Send supports Identity -> Shielded (identityShieldTo, Type 21), so
the Internal pair matrix now allows every pair of two different balances;
NOT_SUPPORTED_YET and internalTransferPairSupported are gone.

The Shielded-destination routing used to send every non-Core source to the
Platform-credits self-shield. Identity now delegates to External Send with
the wallet's own default shielded address, read by the new
ShieldedBalanceService.ownShieldedAddressOf, which is pinned to the
confirmed wallet and fails closed (Not sent, nothing called). Platform ->
Shielded keeps its self route. As in External Send, an identity source has
no fee estimate and no Max.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hield

The SDK refuses shieldedShieldFromIdentityToRecipient when the recipient
belongs to the wallet's own shielded account ("use the self-shield entry
point"), so the External Send delegate added in the previous commit was
Not sent on a device. Wrap shieldedShieldFromIdentity (Type 21, no
recipient) as ShieldedBalanceService.shieldFromIdentity, mirroring
shieldFromIdentityToAddress through runShieldedWrite, and route Internal
Identity -> Shielded to it as a self route under the wipe barrier, with the
own identity checked as SDK-managed first. ownShieldedAddressOf is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
As d4a6e58 did for External Send: every Throwable-passing log in
InternalTransferExecutor and InternalTransferServiceImpl now logs only
safeErrorSummary (error class names and a native code), never an exception
message or stack trace, which can name a recipient or identity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A Shielded -> Core Max withdraws the Max itself and the asset unlock's
Core fee comes out of it, so the own Core balance receives the Max minus
WITHDRAWAL_CORE_FEE_DUFFS. Internal's confirm sheet showed the full Max as
received and a total of Max + fee (the Core fee counted twice). It now
uses External Send's rule, shared as withdrawalCoreFeeIncluded /
amountAfterWithdrawalCoreFee: amount shown = Max - Core fee, total = that +
fee. The send was already right and is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A username paid from the shielded pool, a shielded send or an unshield to
a Platform address creates no Core transaction, so the Home history had no
row for it and the balance drop was unexplained (QA D-19T1-05).

Add one tx_display_cache row per SDK shielded_activities entry that has no
Core transaction of its own (Room 22 -> 23 adds a `source` column). The
value is the entry's effect on the Home total (L1 + shielded): outgoing
kinds show amount + fee, so the username row reads -0.03. ShieldFromAssetLock
and Withdrawal are skipped because their Core transaction already has an L1
row; ShieldedSpend (self-change, fee unknown) and outgoing entries without a
known fee get no row rather than a wrong amount. L1 writers now clear and
count L1 rows only.

ShieldedHistoryRowSync collects the activity feed on IO, replaces the
shielded rows in one transaction, ignores the not-ready state, and stops
for a wallet wipe. Tapping a shielded row opens the transaction detail
sheet with the type, amount, fee, date, status, From/To balances and memo.

Platform address and Identity credit history are deferred: the SDK keeps
only their current balances.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…name

The DashPay welcome disclaimer said "You have 0.00000737 Dash" (the
transparent balance) on a wallet about to pay the username from its
shielded balance. Quote the shielded balance when the fee will be paid
from the shielded pool; otherwise keep the transparent balance.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A withdrawal to a foreign Core address now gets a "Sent" row; only a
  withdrawal to this wallet's own Core address is left to its L1 row. An
  unresolvable payout gets no row rather than risk a double count.
- An unshield to someone else's Platform address and a top-up of someone
  else's identity read "Sent" instead of an internal move to the user's
  own balance. Ownership is resolved against the snapshot's wallet; an
  unknown owner falls back to the neutral "Sent".
- The detail sheet follows the entry in the live feed, so it updates on
  settlement and closes when the entry fails or the wallet changes.
- A failed cache write goes through the feed's retry path instead of
  waiting for the next activity change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A failed SDK read while resolving who a shielded payout went to now
  fails the whole sync pass before anything is written and retries, so
  existing rows are kept. Only an undecodable payout stays "unknown".
  The detail sheet keeps its last detail and retries on such a failure.
- A withdrawal to this wallet's own Core address shows as "Unshielded"
  until the wallet holds a Core output paying that address; only then is
  it left to its L1 row. The sync also re-plans on Core history changes
  (DisplayCacheRefreshBus, debounced), and an unchanged plan writes
  nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- replaceShieldedRows compares and writes in one transaction: one read,
  nothing written when the plan is unchanged, only new or changed rows
  upserted.
- ShieldedActivityEntry derives pending and amount from status and
  amountCredits.
- signedTotalDuffs returns a sealed result; ShieldedKindSpec carries
  isSend; the test-only planShieldedHistoryRow wrapper is gone.
- Core script decoding uses dashj via TxInfoConverter.standardAddressOf
  (exact 25/23-byte templates only), replacing CoreAddressVersions.
- TransactionResultViewBinder shares one bindHeader, and the icon table
  lives in TxDisplayCacheEntry.iconResFor.
- TxDisplayCacheDao queries name SOURCE_L1 / SOURCE_SHIELDED.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@HashEngineering
HashEngineering force-pushed the feat/shielded-history-rows branch from 8476cb2 to 7e964e4 Compare November 27, 2026 00:39
Base automatically changed from feat/advanced-internal-transfer to feat/advanced-send-receive December 3, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants