Skip to content

docs: codify paykit issuer interoperability - #1216

Open
ovitrif wants to merge 3 commits into
masterfrom
codex/1208-paykit-interop
Open

docs: codify paykit issuer interoperability#1216
ovitrif wants to merge 3 commits into
masterfrom
codex/1208-paykit-interop

Conversation

@ovitrif

@ovitrif ovitrif commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Closes #1208

This PR:

  1. Codifies the Android Paykit issuer contract aligned with bitkit-ios#719 at 5515aa049223dcfa1f1b0eaf0fe4e8f985e4e562.
  2. Validates the exact cross-platform request and endpoint fixtures through Android's production filtering and parsing paths.
  3. Adds stable automation identifiers and a regtest journey for the incoming Payment Request flow.

Description

  • Keeps Lightning identifiers chain-independent and covers network-specific P2TR, P2WPKH, P2SH, and P2PKH identifiers across Bitcoin, testnet, signet, and regtest.
  • Enforces exact lowercase btc and identifier casing, preserves issuer order, removes duplicates, and drops unsupported or wrong-network identifiers.
  • Requires endpoint payloads to be JSON objects with a non-empty string value, retaining optional string bounds.
  • Uses the byte-identical iOS fixture with SHA-256 934f4be316d589a221ace99683c828ae67ec60d433a06fcacb0d31501e5be300.

Preview

N/A — no user-visible changes.

QA Notes

Manual Tests

  • 1. Linked regtest issuer → publish a current btc-regtest-p2wpkh JSON endpoint → send the canonical 100,000-sat one-time request → Payment Requests → Pay: Payment Request Confirm shows 100,000 sats and the issuer as recipient.
  • 2. Linked regtest issuer → send an uppercase-asset, wrong-network, or unsupported-identifier fixture: the invalid request is not presented as actionable.

Automated Checks

  • PaykitIssuerInteropTest.kt: consumes the exact shared JSON fixture and covers accepted and rejected requests and endpoint payloads across all four networks and four documented on-chain scripts.
  • PaymentRequestsScreenTest.kt: verifies the stable Pay and Reject automation identifiers; the connected Pixel 9a run passed 5/5 tests.
  • Test coverage consolidated from PublicPaykitRepoTest.kt and PaykitPaymentRequestRepoTest.kt into the canonical fixture suite so one source exercises the real parser and request mapper.
  • Local compile, full unit suite, detekt, and dev build passed.

@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

The PR codifies and tests Android’s Paykit issuer interoperability contract while adding stable automation identifiers for the incoming Payment Request journey.

  • Centralizes endpoint identifier filtering and payload parsing.
  • Makes on-chain identifiers network-specific while keeping Lightning identifiers chain-independent.
  • Adds shared cross-platform fixtures covering accepted and rejected requests and endpoint payloads.
  • Adds Payment Request action and confirmation tags plus regtest journey documentation.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or non-blocking defects identified.

The network-specific identifiers remain aligned across publication, request filtering, SDK endpoint selection, and resolution; endpoint parsing preserves prior semantics, and the new automation tags are exposed through the application’s global Compose resource-ID semantics.

Important Files Changed

Filename Overview
app/src/main/java/to/bitkit/repositories/PaykitIssuerInterop.kt Centralizes the canonical Bitcoin asset, network-aware identifier filtering, and strict endpoint payload parsing without introducing a behavioral defect.
app/src/main/java/to/bitkit/repositories/PaykitPaymentRequestRepo.kt Applies current-network endpoint filtering to incoming payment requests while preserving order and removing duplicates.
app/src/main/java/to/bitkit/repositories/PublicPaykitRepo.kt Delegates endpoint payload handling to the shared interoperability helper and introduces consistent network-specific on-chain method IDs.
app/src/main/java/to/bitkit/services/PaykitSdkService.kt Uses the shared canonical asset when constructing Paykit request terms.
app/src/test/java/to/bitkit/repositories/PaykitIssuerInteropTest.kt Exercises the production request mapper and endpoint parser against fixtures for all supported networks.
app/src/main/java/to/bitkit/ui/screens/paymentrequests/PaymentRequestsScreen.kt Adds externally usable automation tags to incoming request Pay and Reject actions.
app/src/main/java/to/bitkit/ui/screens/wallets/send/SendConfirmScreen.kt Adds a stable root automation tag distinguishing Payment Request confirmation from ordinary send confirmation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Issuer sends one-time Payment Request] --> B[Validate btc asset, lifecycle, amount, and expiry]
    B --> C[Filter identifiers for current network]
    C --> D{Supported identifier remains?}
    D -->|No| E[Do not present request]
    D -->|Yes| F[Resolve linked issuer endpoint]
    F --> G[Parse JSON object and non-empty value]
    G --> H[Validate invoice or address]
    H --> I[Present incoming request]
    I --> J[Open Payment Request confirmation]
Loading

Reviews (1): Last reviewed commit: "test: align paykit issuer fixtures" | Re-trigger Greptile

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.

docs: codify Paykit issuer interoperability

1 participant