Skip to content

Re-introduce RFC-006 payment.topUp / balanceSubscribe on the TrUAPI runtime (iOS + Android) #778

Description

@tommyldev

Background

Product top-up used to work. Both phones implemented paymentTopUp and the balance subscription behind the native product container: iOS ProductsNativeApi+Payment.swift → IncomingPaymentService (polkadot-ios-community#85 "Top up durability"), Android HostApiInteractor.resolveTopUpSource → TopUpSource.Onboard (polkadot-app-android-v2#1002). A product handed over ProductAccount { derivationIndex }, the host watched the account, signed Coinage.load_recycler_with_external_asset_unpaid from it, and the money showed up in the user's coinage balance.

TrUAPI is now the standard product runtime (iOS Nightly defaults to it; Android is landing its binding). On that runtime the payment surface was never carried over: truapi-server's Payment::top_up answers Unknown("Payments are not supported in dot.li") and balance_subscribe answers PermissionDenied (runtime/capabilities/payment.rs), and the iOS RustHostRuntimeBridge exposes no payment hooks that could override it. The working implementation is still in the apps, one runtime over, unreachable from a TrUAPI product.

Why it matters now

Humanity's Daily Dollar pays each winner's prize on chain into the product account //product//peopl.<tld>/0 as a pUSD balance. Coinage has no deposit address, so the only way that prize becomes spendable is the host's payment.topUp({ source: ProductAccount { derivationIndex: 0 } }). Humanity calls it right after a claim and again at every app start (humanity-spa#134, #136, #137) — and every call dies at the stub.

On paseo-next-v2 the test identity's prize account 5CXjDEKmQhsRKPwbR8eCjBio8Bt4Gv6J9UkkA7uHCkE9hGG7 holds 4 pUSD from four claimed draws and has never signed anything. Every dollar a user wins is sitting on an account no wallet shows.

Ask

Re-introduce on the TrUAPI runtime, on iOS and Android, routed to the top-up the apps already have:

  • payment.topUp with the ProductAccount source
  • payment.balanceSubscribe

payment.request / statusSubscribe are not needed for this.

To decide along the way

  • The native container's paymentTopUp took a 32-byte top-up id and offered topUpStatusSubscribe (Detecting → Claimed / ClaimedPartially / NotClaimed). HostPaymentTopUpRequest in @parity/truapi has neither. Either the bridge makes up an id per call, or RFC-0006 grows id + a status subscription so a product can learn a top-up ended NotClaimed.
  • ProductAccount must resolve to the same account truapi-server/src/host_logic/product_account.rs derives (soft junction u32 LE ++ blake2("product-account-index")[..28]). iOS's ProductAccountId.derivationPath() already matches.

Related

Activity

  1. added
    needs-ownerNo assignee and no recent activity
    host-workNeeds implementation in one or more host repos
    and removed
    needs-ownerNo assignee and no recent activity
    on Sep 15, 2026
  2. changed the title [-]TrUAPI runtime: route payment.topUp(ProductAccount) to the host's coinage on iOS/Android — Humanity's Daily Dollar prize is stranded without it[/-] [+]Re-introduce payment.topUp / balanceSubscribe on the TrUAPI runtime (iOS + Android) — it worked on the native container, Humanity's Daily Dollar needs it back[/+] on Sep 15, 2026
  3. changed the title [-]Re-introduce payment.topUp / balanceSubscribe on the TrUAPI runtime (iOS + Android) — it worked on the native container, Humanity's Daily Dollar needs it back[/-] [+]Re-introduce RFC -006 payment.topUp / balanceSubscribe on the TrUAPI runtime (iOS + Android)[/+] on Sep 15, 2026
  4. changed the title [-]Re-introduce RFC -006 payment.topUp / balanceSubscribe on the TrUAPI runtime (iOS + Android)[/-] [+]Re-introduce RFC-006 payment.topUp / balanceSubscribe on the TrUAPI runtime (iOS + Android)[/+] on Sep 15, 2026
  5. valentyna-kozlova commented on Sep 23, 2026

    @valentyna-kozlova

    @TorstenStueber: check after RFC17 is done as it contains amendments to RFC6.

  6. TorstenStueber commented on Sep 23, 2026

    @TorstenStueber
    Collaborator

    (and also check whether RFC-17 needs to be extended so that the recipient of a payment would also choose a specific purse id to move the funds into).

  7. self-assigned this
    on Oct 7, 2026
  8. filvecchiato commented on Oct 7, 2026

    @filvecchiato
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Coinage R2HumanityHumanity SPAR2 blockerMust be done for R2host-workNeeds implementation in one or more host repos

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions