feat: StreamPay - Per-Second Artist Compensation with Session Keys#70
Conversation
When users click links to /id pages from Twitter, mobile browsers block autoplay because the user gesture happened in Twitter's app, not on our page. This adds a tap-to-play overlay that: - Detects Twitter/X referrers (t.co, twitter.com, x.com) - Shows a fullscreen overlay with album art and play button - Captures the user's tap gesture to unlock audio playback - Works on both mobile and desktop, with appropriate text Non-Twitter referrals continue to auto-play as before. https://claude.ai/code/session_0159TqgRHmtn1YwQiKXvtzmc
This update integrates Ed25519 ephemeral signers for background payout signing and uses the batch transfer contract for atomic artist settlement. - Added Astro and Cloudflare skills\n- Updated Remotion and DeFi mechanics skills\n- Integrated Session Keys in StreamPayCore.svelte
…ction identity mismatch
…ellar expert link
…before settlement
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 841c1344ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| async function getPasskeyKit(): Promise<any> { | ||
| if (!_passkeyKitInstance) { | ||
| const { PasskeyKit } = await import("passkey-kit"); | ||
| _passkeyKitInstance = new PasskeyKit({ | ||
| rpcUrl: getRpcUrl(), |
There was a problem hiding this comment.
Serialize PasskeyKit singleton initialization
Because getPasskeyKit() is now async, two callers can enter this block before _passkeyKitInstance is set and each create its own PasskeyKit instance. If one call connects the wallet while another signs (or any concurrent calls from multiple components), they can end up using different instances and lose the connected-wallet state, causing signing to fail intermittently. Consider caching a single in-flight promise (or a lock) so all concurrent callers share the same instance.
Useful? React with 👍 / 👎.
…ition The async getPasskeyKit() allowed multiple callers to enter the initialization block before _passkeyKitInstance was set, causing each to create their own PasskeyKit instance. This led to intermittent signing failures when one caller connected the wallet on one instance while another tried to sign on a different instance. Fix by caching the in-flight initialization promise so all concurrent callers share the same instance. https://claude.ai/code/session_012iZQopTzdWH8tKm9htrBuW
StreamPay: Proof of Per-Second Artist Compensation
Overview
This PR introduces StreamPay, a proof-of-concept for real-time, per-second artist compensation using Stellar/Soroban smart contracts and session keys.
Why This Matters
For Stellar
For the Music Industry
Technical Implementation
Session Key Flow
Key Components
StreamPayCore.sveltebatch-transfer.tsSecurity Hardening
Commits Included
feat(streampay): add balance pre-check before batch settlementfix(streampay): filter out NULL_ACCOUNT and invalid artist addressesfix(streampay): construct full audio URL from Song_1 UUIDstyle(streampay): clean up spacing and line breaks in agreement UIfix(streampay): correct session key text - no burn, just eject and settlestyle(streampay): refresh flavor text with punchy, on-brand copyfeat(streampay): add polished success UI with confetti, stats, and stellar expert linkfeat(streampay): add retry handler with exponential backoff for 503 errorsfix(streampay): sign and submit session key authorization transactionDemo Flow
Future Potential
This is experimental - not production ready, but demonstrates the core mechanics.