Skip to content

[TD-03b] Separate hospital/technician signing via partially-signed transaction hand-off #14

Description

@licette32

Implement true dual-wallet signing for complete_maintenance so hospital and technician
resolve to two distinct pubkeys, replacing the current state where both roles use the
same connected wallet. Follow-up to TD-03 (#3) — the localStorage keypair was removed
there, but role separation itself remains unresolved.

  • Add a builder that constructs the unsigned completeMaintenance instruction(s),
    sets hospital as fee payer, and returns a partially-signed Transaction once the
    hospital wallet signs.
  • Add serialize/deserialize helpers so the partially-signed transaction can be
    transferred out of the hospital's session and loaded into the technician's session.
  • Add a hand-off UI step in the hospital flow: after triggering "complete maintenance,"
    display the serialized transaction with a copy action instead of sending it directly.
  • Add a corresponding load step in the technician flow: paste input, decoded summary
    for review (asset, hospital, escrow amount) before signing, then submit.
  • Verify the account metas in the parsed transaction match PDAs re-derived from the
    transfer payload before allowing the technician to sign (no blind signing).
  • Handle transaction expiration (recentBlockhash validity window) with a visible
    countdown on both sides.

Acceptance Criteria:

  • hospital and technician resolve to two distinct pubkeys in a completed
    complete_maintenance transaction when tested with two separate wallets.
  • Technician sees a decoded, verified summary before signing — never a raw blob.
  • No new dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions