Skip to content

feat(mesh-payment): offline Solana payments through beacon relay#79

Merged
Magicred-1 merged 1 commit into
v3from
feat/mesh-execute-payment
May 18, 2026
Merged

feat(mesh-payment): offline Solana payments through beacon relay#79
Magicred-1 merged 1 commit into
v3from
feat/mesh-execute-payment

Conversation

@Magicred-1
Copy link
Copy Markdown
Member

Summary

  • New executeMeshPayment() in src/services/meshExecutePayment.ts — orchestrates offline Solana payments through a beacon relay node
  • Fetch durable nonce via mesh RPC (no internet required), derive ATAs for payer/recipient/broadcaster, partially sign the execute_payment tx with the payer key, zero the key immediately, send partial tx to beacon over LXMF
  • Beacon co-signs with broadcaster key and submits to Solana — payer key never leaves the device, no key material sent over mesh
  • Fix duplicate rpcAdapter params in sendTransaction.ts destructuring (builds were succeeding but was confusing noise)

Flow

Payer device                    Beacon relay
   |                                |
   |-- mesh RPC: getAccountInfo --> |-- forward to Solana RPC
   |<-- nonce account data ------   |
   |                                |
   | [derive ATAs locally]          |
   | [partialSign tx, zero key]     |
   |                                |
   |-- LXMF: { type, partialTx } -> |-- broadcaster signs + submits
                                    |-- Solana confirms

Test plan

  • Payment flow compiles with npx tsc --noEmit
  • Unit: executeMeshPayment throws when nonce account not found
  • Unit: secret key buffer is zeroed before partialSignExecutePayment call
  • Integration: partial tx reaches beacon, beacon submits, tx confirmed on devnet

- New executeMeshPayment() — fetch nonce via mesh RPC, derive ATAs, partially
  sign execute_payment tx with payer key, zero key immediately, send partial tx
  to beacon over LXMF. Beacon co-signs and submits to Solana.
- Fix duplicate rpcAdapter params in buildSplTransferTransaction /
  estimateSplTransferFeeLamports / sendSplTransfer destructuring.

Key never transmitted over mesh; only the partial transaction is relayed.
@Magicred-1 Magicred-1 merged commit 3b8c9cd into v3 May 18, 2026
1 check passed
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.

1 participant