Are contracts deployed on channel ever deployed on chain?


#1

If I create a smart contract inside a channel, will that smart contract ever be deployed on chain? Are there variables that persist on blockchain?


#2

Hi @fedecaccia

Yep, quite a few of them: who the participants are, what their signing method is (if attached), what is the total amount of tokens dedicated to the channel, last seen on-chain round and state_hash and etc. Most of those are defined in the channel_create_tx opening transaction and are not allowed to be changed later on. You can see all of the data persisted for the channel on-chain here. Note that this changes a bit after Fortuna hardfork.

Usually off-chain data stays off-chain, except of the dispute scenario. Since the Force progress transaction produces the next off-chain state on-chain, it is expected the whole latest state to be provided on-chain, including any contracts and their states. You can read more about it here.


#3

an additional question regarding that topic:

  • so in case of a forced closing only the latest state and the used contract(s) are being published right? this means that there won’t be any history visible right? (assuming we don’t have a certain amount of slash transactions being published)

#4

Yes, exactly. Only the latest state is published. If you had a contract in the past that is not present in the latest state - it is not posted on-chain.