Patreon on Bitcoin
We introduce a recurring payment contract that allows a customer to deposit money in and a business to collect payment at a regular interval.
Implementation
The contract have three public functions.
- The first one is for the user to deposit more money.
- The second one allows the user to opt out at any time. Note that if the user needs to provide a cancellation notice before stopping the recurring payment, it can be achieved on the basis of this contract with minimal modifications.
- The last one is for the merchant to withdraw certain amount of money from the contract periodically. It contains an nLockTimeVerify part to prevent the merchant from draining it at once. Also note nLockTimeVerify only applies to the merchant and the user can still deposit more money or opt out.
Applications
While this contract is very useful for subscription payment, a similar contract can also be designed to work like a checking account: have a spending limit per day, have an emergency closing if your phone is stolen and a secret key to retrieve the money, have special condition to spend your money, … The possibilities are endless.