XRPL-Labs / xrpld-hooks

ISC License
94 stars 28 forks source link

XRP Hook Microtransaction Sample Request (Version: n/a - Hooks amendment) #41

Closed thefex closed 2 years ago

thefex commented 2 years ago

Summary

Hello. Very frequent use-case is to use XRP-Ledger as microtransactions platform (due to XUMM great UX + low transaction fee's) - like in-mobile-app transactions between people (building project like this as we speak).

Therefore an app could set-up a hook to the account which takes X%/constants drop commission - User X send 100 XRP to user B -> with hook user X send 100 XRP to App address with tag equal to User B address. App address has hook set-up, it takes 0.25% (or 100 drops) commission and proceed with transaction by sending remaining amount to the User B.

I think this hook would not be complicated and I could develop it on my own but maybe you guys can create sample like this (taking in account that it is still in testnet and docs are just being created)?

Motivation

Microtransactions and % provision is a common use-case of XRPL/Hooks. Documentation for hooks is just being created so that would be a great example to learn.

Solution

Create hook example that transfer XRP from user X to user B and take %/constant provision.

wojake commented 2 years ago

I think you're describing what a Carbon hook is, "a hook that sends a percentage of sum to a specified account". Here's the wasm code for Carbon: link This folder has all the examples: link

thefex commented 2 years ago

@wojake oh wow. it already exists, thanks then