Skip to content

feat: index pay.sh channel payouts (add facilitator, fix payout matching) - #1097

Open
fmhall wants to merge 2 commits into
mainfrom
feat/paysh-facilitator
Open

feat: index pay.sh channel payouts (add facilitator, fix payout matching)#1097
fmhall wants to merge 2 commits into
mainfrom
feat/paysh-facilitator

Conversation

@fmhall

@fmhall fmhall commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #1091. The channels sync deployed cleanly but indexed 0 rows — investigation showed both causes and this PR fixes them:

  1. No configured facilitator signs payment-channels transactions. Sampling all 4,651 mainnet program txs, the top signer is BcdwLA62UPEAvRn7AWauMUXKtYMXxdLzTPaSQg5tNaFc — pay.sh (Solana Foundation), per the payment-channels README and solana-foundation/explorer fixtures. Added as a facilitator (Solana USDC, first tx window from the program's 2026-06-24 mainnet launch).

  2. Extractor bug on real pay.sh transactions: pay.sh passes the merchant's ATA as treasury_token_account, so the same address is accounts[6] and the recipient tail. The exclude-accounts-4-6 heuristic from feat(svm): index x402 upto and batch-settlement channel payouts #1091 dropped the genuine payout. Payouts are now matched as escrow legs destined to the dynamic recipient tail (accounts 11..), which per the program source is exactly the merchant payout set — refunds, the payee implicit remainder, and treasury residuals are never in the tail.

Testing

  • Probed live mainnet pay.sh tx J4fFspqR… (settle_and_seal + distribute): extracts one upto payout of 36,968 units, payer 3CaVdQ… → merchant Cs2zdf…; payee remainder and payer refund excluded.
  • New regression test for the treasury==recipient shape (9 tests total).
  • pnpm check green.

Once merged, the sync-state cutover backfills pay.sh channel history from 2026-06-24 automatically.

https://claude.ai/code/session_01NaND1Bpv2PCyAiDa1v6t4K

fmhall added 2 commits August 25, 2026 17:16
Top signer of payment-channels program transactions on mainnet
(BcdwLA62UPEAvRn7AWauMUXKtYMXxdLzTPaSQg5tNaFc, active since the program's
2026-06-24 launch). Attribution: the payment-channels README names pay.sh
as the protocol built on the program, and the wallet appears as the fee
payer in solana-foundation/explorer fixtures.

Claude-Session: https://claude.ai/code/session_01NaND1Bpv2PCyAiDa1v6t4K
Live pay.sh distributes pass the merchant's ATA as treasury_token_account,
so the same address is accounts[6] and the recipient tail — the old
exclude-accounts-4-6 heuristic dropped the genuine payout. Payouts are
exactly the escrow legs destined to the dynamic recipient tail (accounts
11..): refunds, the payee implicit remainder, and treasury residuals are
never in the tail. Verified against pay.sh mainnet tx J4fFspqR… (extracts
the 36,968-unit upto payout; payee remainder and refund excluded); adds a
regression test for the treasury==recipient shape.

Claude-Session: https://claude.ai/code/session_01NaND1Bpv2PCyAiDa1v6t4K
@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
x402scan Ready Ready Preview Aug 25, 2026 9:19pm

Request Review

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