Basic questions about lightning network HTLC I'm reading about lightning and I have a few questions:


The HTLC contract seems to be different at each new path payment channel is opened (due to a different Hash value that needs to be provided), but from my understatement, the channel opens in an independent and in advance to the payments in that channels, between two parties.
How is it possible? Does the HTLC is not written on the blockchain?
This part confuses me.
Are there are known ways to extend the time of a channel before the predefined period time is over? (without closing and opening a new channel)?


Thanks.
How is it possible? Does the HTLC is not written on the blockchain?


In the Lightning Network, HTLCs are part of the commitment transactions which are not broadcast to the network. This means that the HTLCs do not go onto the blockchain unless some fraud has occurred or someone is unresponsive.

None of the conditions of a commitment transaction (all of the punishment, timelock, HTLC, etc. stuff) ever go onto the blockchain unless fraud has occurred or one party is unresponsive. In a typical Lightning Channel, the only things that go onto the blockchain are the funding transaction which just pays a standard 2-of-2 multisig address, and the closing transaction, which just spends from a standard 2-of-2 multisig.


  Are there are known ways to extend the time of a channel before the predefined period time is over?


Channels do not have a predefined period of time.

Only HTLCs have a predefined timeout time and this cannot be changed without revoking the HTLC and creating a new one.