I am excited, my channel factory implementation is making great progress! I got "receiving" to work today -- which is the hard part. Right now I am working on making it so users can also "send" money from their off-chain channels.
Once that is done, it won't just be a channel factory, it will also count as a coinpool: n users share a utxo locked to an n-of-n multisig, and any member can spend money from it on LN (because it's a channel factory) OR on the base layer via an LN-to-base-layer swap.
if any member chooses the latter, a transaction will appear on the base layer that an analyst might be able to trace to the pool (if the swapper colludes, along with all routing nodes from the pool to the swapper), but they can't trace it any further. Nothing on the blockchain tells who's who in the pool, and not even the channel counterparties know who's who in the pool.
hopefully this will help fix two problems with LN: the sometimes-high cost of creating a channel and the privacy drawback of putting your channel-opening transaction on the base layer
Login to reply
Replies (9)
As noted by @bitcoinoptech: "For large numbers of users under ideal situations, channel factories can reduce the onchain size and fee cost of LN by 90% or more." 

Bitcoin Optech
Channel factories
Channel factories are a multi-user contract capable of opening payment channels without putting the channel-open transaction onchain.
Do you have more details about your solution? Is there any doc to read?
ππβ‘β‘πͺπͺ
I am excited, my channel factory implementation is making great progress! I got "receiving" to work today -- which is the hard part. Right now I am working on making it so users can also "send" money from their off-chain channels.
Once that is done, it won't just be a channel factory, it will also count as a coinpool: n users share a utxo locked to an n-of-n multisig, and any member can spend money from it on LN (because it's a channel factory) OR on the base layer via an LN-to-base-layer swap.
if any member chooses the latter, a transaction will appear on the base layer that an analyst might be able to trace to the pool (if the swapper colludes, along with all routing nodes from the pool to the swapper), but they can't trace it any further. Nothing on the blockchain tells who's who in the pool, and not even the channel counterparties know who's who in the pool.
hopefully this will help fix two problems with LN: the sometimes-high cost of creating a channel and the privacy drawback of putting your channel-opening transaction on the base layer
View quoted note →
I am about to give you three links instead of one. I recommend starting by reading this readme:
I think it is the simplest way to begin to understand how my channel factory works. While implementing that, I figured out a way to solve its principal problem, which is that the way "withdrawal transactions" work in hurricash does not allow users to know the txid of their "withdrawal utxo" in advance. Having figured out a solution, I created Tornado Factory:
I recommend reading that readme because it tells how I solve hurricash's problem. Also, play with the implementation! It calls itself a channel factory, but it doesn't actually produce channels; each user only gets a withdrawal utxo whose txid and amount they know in advance.
Lastly, there is Hedgehog Factory:
That doesn't have a readme yet, but it is a WIP attempt to improve Tornado Factory in three ways:
(1) it has real, usable channels now, not just a random utxo you get to withdraw (though the channels are currently receive-only)
(2) users can run the app separately now and coordinate over the internet to do the funding transaction (in Tornado Factory, all users are just different pubkeys generated by the same page, so it's really just one user with n pubkeys)
(3) I implemented a massive efficiency gain by delegating *one* person to do the funding transaction and having everyone else *pay him over lightning* as a kind of admission-fee to the pool. This makes it so that n channels are opened with a single transaction needing only one input and two outputs (the multisig and some change).
This greatly reduces the cost of channel opens *and* gives people an opportunity to make money on their bitcoin. E.g. if a btc transaction costs $10, you can make money on your bitcoin offering more than 10 people the opportunity to open a channel in a pool where you are the delegate, and then you just charge each person a $1 admission fee. Everyone wins: you make money, and they each get a channel for $1 that would have costed them $10 otherwise.
So that's what I'm currently building in Hedgehog Factory: a tool where you can invite people to enter a pool where you perform the funding transaction and charge an "admission fee" to recoup your costs and hopefully make something extra.
GitHub
GitHub - supertestnet/hurricash: It's almost like a coinpool except everyone has to exit with the same amount as everyone else
It's almost like a coinpool except everyone has to exit with the same amount as everyone else - supertestnet/hurricash
GitHub
GitHub - supertestnet/tornado_factory: A bitcoin channel factory that works without a soft fork
A bitcoin channel factory that works without a soft fork - supertestnet/tornado_factory
GitHub
GitHub - supertestnet/hedgehog_factory: It's like tornado factory but for hedgehog channels, and I added a coordinator
It's like tornado factory but for hedgehog channels, and I added a coordinator - supertestnet/hedgehog_factory
very cool
Wow this is amazing!
It's been so long since the original concept of multi party channels, it's so good to finally see at least a limited proof of concept implementation.
Well done, your hacking is greatly appreciated!
Super is a hero β€οΈ
Very, very cool...
Rock on, my dudeππ»πππ―π«π!
this sounds awesome. seems like utxo sharing will be critical down the road π€