This is great. Now, I wonder if there is the ability to write a script for electrum that is able to sign transactions and amounts on specific dates in-so-order to automate loan repayment.
I am aware that there are some forum users who are using scripts to automate transactions for their signature campaigns. Having scripts that sign transactions on the agreed upon dates could automate and remove much of the manual process of signing transactions are repayments.
---
Also, lets say that I borrow 0.1BTC off the back of a 0.1BTC funded cas. What is the payment schedule? If I am making payments each day there will be transaction fees which eat into the loan amount and produce no value for the lender or borrower. What does the payment schedule look like.
It is possible to have presigned transactions with block height or block time based timelocks, but it may be more effort than its worth for less technical users. Such approaches often end up significantly overpaying fees, since it can be hard to predict a good feerate 2 weeks out, and underpaying might mean you end up defaulting simply because the tx doesn't confirm.
My solution to this problem was to add an option to export the payment schedule to a calendar file that can be imported into whatever calendar software one uses. Probably works just as well.
Payments are only due every 14 days, so if you start on 9th September 2024 for a 28 day loan with a 0.1 BTC principal (although you can only borrow 90%, so on a 0.1 BTC Cas you'd get 0.09 BTC), you would make your first payment on the 14th day (22nd September) of the cumulative interest of the first 14 days (0.0007
BTC). Then, on the 28th day, you would repay the principal + cumulative interest for the second 14 days (0.1007
BTC)
Having the payments spread apart by two weeks was an intentional choice to avoid prohibitive tx fees, and just make the logistics easier - it is onerous on the borrower to have to make a payment every day, and easy enough for life to make you miss a day and end up in default. Two week periods are much more manageable, and a cadence that many folks are already used to.