virto-network / open-runtime-module-library

Substrate Open Runtime Module Library
Apache License 2.0
0 stars 1 forks source link

Pooled payments #5

Open olanod opened 2 years ago

olanod commented 2 years ago

Imagine a group of people who want to pay dinner together or pay for some common expenses like in a trip, we could allow people "joining efforts" to pay for a good or service 💡 In swap.cash I think I can use it to allow users who want to buy a lot of crypto receive the payment from multiple sources, the marketplace matches a list of people that can fulfill the amount of the order and initiates the payment request that includes the list of people and the amounts they have to contribute.

I think this can be an extension of the payment request feature, someone initiates the payment request(e.g. the marketplace) specifying the map of accounts and their share and then we keep track of who payed what. Don't think we need to modify our map of (payer,payee) => detail, the payer here can be an address generated deterministically(e.g. a hash of the map) and we use that same temporary account as the id to track the progress of the completion.

olanod commented 2 years ago

The payment request might also be open-ended, meaning there could be a target amount that might or might not need to be reached(and could even be surpassed), for this kind of request users don't need to specify the accounts that need to make the payment, anyone could jump in and pay any amount. This could enable other use-cases like fund-raisings, imagine several Virto communities paying for a road or other shared infrastructure :)