The question is very simple: c-lightning can be anchored to liquid, but it seems that it's non possible to anchor c-lightning to a standalone side-chain. Am I wrong? Thanks.
While it is hard to make a general statement without knowing the details, it should be possible to run c-lightning on most blockchains, including sidechains, without major changes on bitcoin-derivatives.
Some minor changes need to be performed for some blockchains, as long as they are based on the UTXO mode, like we did for the elements and liquid sidechains (and I personally consider those already on the far end of the spectrum when it comes to changes in the underlying model).
Deeper changes are required if the underlying model is not UTXO based, but the general concept of off-chain contracts still works, but in those cases the LN spec is likely not fit for the purpose.
Hi @cdecker and thanks for you answer and sorry of being too generic with my question. I just started to study both c-lightning and elements.
I configured a standalone elements side-chain:
# elements.conf
chain=mychain
validatepegin=0
...
Then I tried to configure c-lightning to connect to the above standalone chain:
#config
network=mychain
...
When I run lightningd it says: Unknown network name 'mychain'. It's that the expected behavior by using vanilla c-lightning anchored to a standalone elements chain?
Thanks for your time.
You need to modify C-Lightning code in order for C-Lightning to recognize mychain. You probably need to add an entry to this array: https://github.com/ElementsProject/lightning/blob/4b13b88f6cb8de9bdc25699de9db2ba66fac872c/bitcoin/chainparams.c#L28 with the details of your brand new sidechain.
Thanks so much @ZmnSCPxj . I'll take a look at it.
@cdecker should I close the issue or, considering you labeled it as a question I leave it open?
I'll close it for you. Feel free to open a new issue or contact us on IRC should you need more assistance :-)