Does successful state channel transaction require updating on the blockchain? If not, what prevents the double spend?

As the title goes; does successful state channel transaction require updating on the blockchain? If not, what prevents the double spend? For example A send money to B via state channel. Transaction is successful and close however the transaction is not updated on chain which mean A could still spend the money he sent to B thus double spend.

Thanks in advance.

to my opinion,maybe once A open a state channel,the amount of money is locked,he can’t spend it unless the state is closed.

Hi @crypto_user,
@luckybird is right about this: when Alice and Bob open a State Channel, each of them dedicates a certain amount of tokens that is locked in the channel while it is active. While it still running, users can deposit more tokens to the channel or withdraw some but the channel always has a positive balance. At Channel closing time the remaining tokens are redistributed beween the participants.

@Dimitar.Ivanov

At Channel closing time the remaining tokens are redistributed beween the participants.

Let’s say after channel is closed and Bob transfer his 100 AE to Alice, Bob restore his wallet with seed file and isn’t he can access his 100 AE in his wallet again because the final state is not updated on blockchain?

Current official wallet does not support state channel so I can’t really explore and understand state channel feature.

@crypto_user there is one single source of truth - this is the blockchain. A channel closing requires some locking of coins on-chain, then participants can perform as many off-chain updates as they desire but at the end the channel is closed on-chain, redistributing the coins on-chain. Despite being mostly off-chain, there are certain on-chain transactions that change the channel representation on-chain and no matter how one manipulates ones own wallet app - this has no impact on the blockchain whatsoever.

You can read about the Channel’s argumentation and different on-chain/off-chain transactions here and regarding the lifecycle from WebSocket API perspective here.

1 Like

Hi, thank you for the reply. I have read the state channel doc on github and I have a question. How fast is locking coins on chain? Is it instant?

Thanks in advance.

It is a regular transaction as any other. Creating the channel and locking the tokens in it is an atomic opration, so once the transaction is included - yes, it is instant from chain’s point of view.

I appreciate your reply. Thank you

1 Like