
Discussion
A coinpool is a type of bitcoin L2 that allows multiple users to deposit funds into a multisig, in such a way that they can withdraw their deposit without needing any additional trust assumptions beyond bitcoin's standard ones (e.g. that miners won't do a 51% attack)
While a user's funds are in the pool, the user can *also* spend "partial" amounts of their deposit, in such a way that it’s not possible to tell from the blockchain which pool user spent the funds
My implementation has a few extra features: (1) every pool member can send and receive money via lightning (2) and/or via hedgehog (3) inside the pool, all transactions are free (4) thanks to hedgehog's support for asynchronous payments, you can send someone money even if they are offline, and if *you* go offline, they can still take the money you sent them
This is awesome
How are fees managed at the chain level?
Does there still need to be a budget for transaction fees to be covered? Especially for force withdrawals.
Who pays the fees:
1. When the first person withdraws on chain.
2. When the funds are all dispersed on chain.
Other scenarios?
There is no fee budget for the coinpool. Instead, I use the new v3 transaction standard so that the following holds:
When the first person withdraws on chain, they pay for their exit transaction via child-pays-for-parent. The same applies for every subsequent user who wishes to exit.
There is no situation where the funds are all dispersed on chain at once. Instead, only one user may do a force ejection at a time. If two try to force eject themselves at the same time, it's a race condition, and the loser may have to pay an extra tx fee.
Also, force ejections are a lot like force closures on LN: users are not expected to use them. Outside of accidental usage, you'd only realistically use one if the pool manager disappeared and you couldn't get out via the "happy path" -- which is just sending all your money out via a lightning transaction (or hedgehog).
