Epic: Bitcoin payment integration
The purpose of this implementation is to support guild member payments for premium features by Bitcoin cryptocurrency with single-use addresses.
Use Cases
- Accepting payment from guild owners for premium bot features
- Accepting payment from guild members for premium guild features
- Accepting payment from either of the above for premium ID verification
Flow
-
User requests some premium feature(set)
-
Bot creates or identifies a free single-use wallet address
-
Bot DMs requestor with the payment address and its QR code
-
Bot waits in a loop on a timer for user to send payment, scanning the blockchain for transactions to this address
a. On timeout, bot notifies the user
b. On payment receipt, bot logs timestamp of receipt and the user in the DB before calling the related grant flow for the premium feature(set)
Research
bitcoinlib seems like the best candidate
When exploring this library, I noticed that it doesn't appear to support proper asyncio. We'd have to write a wrapper for some functions to loop over wallet scans when waiting for a tx, but that shouldn't be too difficult.
Alternatively, this could be integrated into aerithe, my NodeJS bot. bitcoin support seems to be far more mature in JS