The end of Coil left a hole in the WebMonetization and by extension the XRP communities. Coil served two purposes; it let people get streamed micropayments for their content & it allowed people who were not familiar with crypto or web3 spaces to still benefit from them.
In the XRP ecosystem only the first of those is necessary. XRPLoop aims to allow XRP enabled services to recieve streamed micropayments from users with an XRP (XUMM) wallet.
What it does
Coils underlying ledger technology still runs on the XRPL. This proof of concept application uses that to set up a Payment Channel between the consumer/user and the service. The service then uses this to request micropayments when the front end client submits a payment notice.
How we built it
The application runs in flask with a simple UI made with tailwind. The app uses XUMM to login (there by getting a wallet address) and sign requests for creating a PaymentChannel. Once done the client establishes a websocket to the server and periodically submits a request for payment. This is then propagated to the ledger and the result of that transaction logged to the screen.
Challenges we ran into
The main challenge was finding how to get the appropriate signature for the
PaymentChannelClaim transactions - it feels like this should be doable in client code, but I couldn't get it to work. That would be a requirement (or running a ledger node) before going into production/mainnet use.
Accomplishments that we're proud of
Getting the PaymentChannel flow together was pretty smooth, the docs were good & I was able to quickly make standalone scripts that demonstrated each step, which then made pulling together the server easy.
What we learned
- The ledger APIs around
- First use of the XUMM python SDK (wasn't available last time I started a project on the XRPL)
What's next for XRPLoop
There's a fairly long todo list in the project readme (patches welcome...), a few highlights:
- distill app into clearer components, better modularisation of the code
- example UI components, front end installable as an independent script
- async accounting function (write to local DB?)
- third party payment propagation
- service payment
- channel closing - both from expiration & user request
- UI to set the channel ammount
- generate signature without accessing ledger