-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Web Monetization + Open Payments: Part 2 Payment Sessions #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
13b9580 to
323423d
Compare
src/content/blog/2025-12-03-web-monetization-open-payments-part-1-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Show resolved
Hide resolved
| addedLinkElements.forEach((elem) => { | ||
| const id = assignId(elem) | ||
| const walletAddressInfo = await validateAndFetch(elem.href) | ||
| dispatch('start_monetization', { walletAddressInfo, id }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again I realise that you're assuming base knowledge of WM but I think clarity just makes reading easier. This can make it seem like monetization is starting all link elements simultaneously rather than setting them up to all be available for receiving. Unless I am behind on changes, my understanding is that each wallet address takes a turn to get paid? It might be nice to clarify that above or below. Like being on a site with 10 wallet addresses costs no extra per second than being on a page with 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced the start_monetization with setup_monetization and also added a paragraph about multiple link elements in start. I hope that reduces the confusion.
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Outdated
Show resolved
Hide resolved
src/content/blog/2026-12-08-web-monetization-open-payments-part-2-connecting-wallet.md
Show resolved
Hide resolved
|
|
||
| ### Manually finding minimum sendable amount | ||
|
|
||
| We use a probing method to find the minimum sendable amount. For example, if we try to send MX$0.01, we receive a "non-positive receive amount" error. We note this error and then attempt MX$0.02, which also fails. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it sound like you are trying to make payments with no upper boundary, like we try to send this and it doesn't work so we try sending more. What you're actually doing is checking the quotes. I think in terms of building confidence in new standards it helps to talk in ways that don't make people anxious before they understand the full context. So you could phrase this around quotes, or non fulfill-able payment requests or something rather.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in da945bb.
| We observed that MX$0.16 was not sendable, while MX$0.32 was sendable. Therefore, the minimum sendable amount lies somewhere in between. This is a textbook use-case of the binary search algorithm! | ||
| The midpoint between the two amounts is MX$0.24, which is sendable, but it is still above the minimum sendable amount. When we find the midpoint of MX$0.16 and MX$0.24, we get MX$0.20, which is also not the minimum sendable. After some back and forth, we determine that MX$0.17 isn’t sendable, but MX$0.18 is, concluding that MX$0.18 must be the minimum sendable amount. | ||
|
|
||
| Each test to determine whether an amount is sendable or not costs us one create quote request, which can add up significantly and delay the time it takes to send money to the recipient. To optimize this process, we can utilize currency exchange rates. Instead of starting our tests from MX$0.01, MX$0.02, MX$0.04, and so on up to MX$0.32, we can begin at MX$0.18. This way, we’ve trimmed our search space by a considerable margin. We still need to confirm whether the amount is sendable, as there may be associated fees, and to verify if it is indeed the minimum sendable amount. However, we have minimized the number of unnecessary requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have now increased the amount sent, it would be nice to add an explanation of increasing the time period too, to keep average payments / second at a relatively constant pace. Because, again, this feels like you agree to one thing up front in the extension and now all of these changes are happening outside of your control and readers may want some reassurance that they won't suddenly be sending 18x what they had planned per second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 7f00c56.
|
|
||
| Before creating the outgoing payment with our previously acquired tokens, the Open Payments API requires us to set up a receiving channel. | ||
|
|
||
| The process begins by creating an incoming payment grant on the receiver's wallet. This grant is non-interactive, meaning the user does not need to manually approve each incoming payment, which would be very cumbersome. Once we obtain the permission, we can proceed with creating the actual incoming payment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this confusing on first read. You say you don't need approval but you're waiting for permission. It would help to be clearer about user approval vs authorization servers granting permission.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 5b9ed35.
✅ Deploy Preview for developers-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
PR Checklist
Fixes #123)Summary
Follow up of #163.
Aiming to get it published by Dec 8.