Sender and receiver send amount of bitcoin to a common bitcoin wallet address . this creates a channel between both of them. once bitcoin are deposited on the channel , users are able to transact between them off the bitcoin blockchain which we called before off-chain.
lets correct some things.
people LOCK UP some bitcoin to a UTXO, on the bitcoin network.. bitcoin never leaves the bitcoin network.. its impossible.. where that UTXO is not a common bitcoin address made by native bitcoin wallets/nodes.. . but a address created by a lightning node made specifically to hold up/lock in the coins. that the bitcoin network recently recognises as an acceptable address to have in bitcoin blocks
EG. bitcoins common address is a legacy address (starts with a 1).
EG. bitcoins common multisig address is a address (starts with a 3).
people cannot create a LN channel using the 1 or 3 style common bitcoin addresses.
they need to use the new format added in 2017 specifically added to bitcoin to be the LN/altnet gateway address formats that other networks can utilise(yep segwit was made specifically to have a format that allowed bitcoin to altnet locks to be formed sch as liquid,LN and other sidechain,subnets)
anyway. when using the formats compatible with altnets like LN where the LN node has funds on a key created by the LN node, (the private key(LN call the HSM secret) is not a standard bitcoin private key)
within the LN node another(second) transaction is made to the bitcoin network to then put a split of those funds into a channel LN address with further locks.
yep.
most LN wallets do not direct fund a channel.. people first need to "fund" their LN node address and then find a LN channel partner multisig address.. to lock up funds and let the channel establish its units of account pegs in the LN channel.. so in most cases 2 transactions are needed to actually get funds into a channels lock.
then inside LN channel(s) payment message go between LN users of channels are not measured in btc.. but instead measured in a completely different unit of account. called a msat.. (which is a peg of 1000msat=1sat)
these message/payments/invoices are not even bitcoin transaction common formats. they are different messages in a completely different order/format to a bitcoin transactions. and for emphasis, made using a unit of account that bitcoin does not understand.
EG 0.00003btc is 3000sats.. which in LN is 3000000msat
bitcoin does not understand units of 0.00003000000 because that is 11 decimals of bitcoin, and bitcoin only understand 8 decimal limit.
as we all know from recent revelations of altnets that lockup bitcoin and then pretend to peg their new token/unit of measure to btc.. that peg can break.
there is no hard rule which all LN nodes are forced to follow(no consensus) that forces 1000msat to always be 1sat
be warned about this especially when recent news has been talking about the luna and usdt altnets of pegged tokens that broke their peg
Anti-cheating measures are also included in lightning technology and if someone tries to steal any other's fund using old transaction record it can be found by any node. And that attempt can be blocked.
IF the victim stays awake 24/7. stays online 24/7 or employees a service to watch for the cheating broadcast..
.. then. that attempt wont be blocked. but instead in the transaction out of the channel. the victim or its watchtower service can spend the funds before they are moved out of the LN network system of the locks and penalty mechanism of their formats
note the risk, and be warned. even the LN devs that created lightning have lost funds through theft. if they cant stop it the be very aware that LN is not as safe as advertised.
LN does have a small niche of utility. and by small i means small.. it is not a solution for everyone and the more users that use it the more channels and splitting up of funds people need to do to have possible routes to others. which in-of itself- becomes more risk of bottlenecks and problems making payments via needing to pass through more peoples channels along routes where each channel might have issues of liquidity or passing on funds.
LN has alot of other flaws. be risk aware of the flaws and dont just follow the positive hope.dream utopian adverts of LN. for your own safety be risk aware of your funds.