Transaction fees are based on the complexity of the inputs/outputs, not the value transacted. You are literally paying for the minimum amount of data necessary to prove you own the funded sending-address, paying to write those hashes and amounts into the blockchain. The institution handling this offchaing lightning branch can implement fees in whatever structure you agree to transact, including percentage based.
Lightning is just an off-chain out-branch, which will eventually be re-integrated onto the main blockchain (based on its original funding/terms). The benefit of this is that single entities can branch off the main blockchain, which is limited in its total blocksize/capacity.
The only limits are those by the handling lightning institution. This differs from bitcoin's main public blockchain, which rewards/creates approximately six blocks /hour, each with a limit of just a couple megabytes.
Lightning is a protocol and there can theoretically be many disjoint networks. The biggest network is usually what's considered to be 'the' lightning network. Double spending, which would require 'settling' a superseded lightning transaction, is prevented by a penalty mechanism that makes it so the malicious party loses all the funds in their 'channel' when caught (which will be, at smallest, the amount the original payment was made for).
I'm still thrown. I don't see how an after the fact penalty can work.
Let's say I have 1 BTC. I buy something for 1 BTC on lightning network A. Simultaneously (within nanoseconds) I buy something for 1 BTC on lightning network B. I never plan to use BTC again (or if I do, I will use a different wallet, etc.) Do I just get two purchases? Is there a meta-network clearing house, and if so, why are there many disjoint networks.
Or do I need to have moved my BTC into the lightning network A or B before I spend it?
You have to commit the money upfront into not just the network, but the link on the network.
Basically a Lightning connection (or channel) is two parties locking up some money (in any amount and any split they want) and then repeatedly re-agreeing on what the current split is. At any time they can close the channel which unlocks the money according to the latest agreed split. It's cleverly set up so that if either one cheats (by trying to finalize an earlier split), the other one gets to overrule it and keep 100%.
The most money that can be transferred is when the split is 100% to one party. Then you need to finalize it and create a new one.
It's not as magical as its proponents think. It is better than the base protocol in some cases - if you have connections and money. The sender having to lock up actual money in advance, in the maximum amount they can foresee sending, is a real buzz killer for the sender. And if the sender is some central relay - if you want to receive via a central relay and not peer to peer - you'll have to convince them why they should do that. Usually by actually prepaying, in real bitcoins, a few percent of what you want them to lock. Which is more than the transaction fee for a nontrivial base layer transaction.
To date, my own full verification node rejects all lightning/segwit blocks, until a concensus level of 6+ is reached. I think both were BIP errors, but rejoined the main concensus network ~2018.
Also participated in the O.G. bitcoin hardfork, back in August 2017, supporting the larger_blocks camp (but now mainchain, only).
It also takes a week to get your money when finalizing the channel. This is because the other party has a week to post on the blockchain a proof that you cheated. Only if no cheating proof is posted can you actually finalize the channel.
On the main chain, bitcoin transactions can have "scripts" that describes who and under what condition this money can be spent.
You have to lock your bitcoin on the main chain in a script that shares the bitcoin between you, and another lightning network user (typically a hub)
The trick is that a lightning transaction happen by signing transactions to the other party that changes the way the bitcoins are split, without broadcasting it to the main chain. You only broadcast to the main chain when you want to unlock the bitcoin.
Broadcasting an earlier transaction will result of you losing the found because subsequent transaction contains secrets that allow the other party to take them.
So I allocate my one BTC to lightning network A, so I can spend it there. I try to spend it on lightning network B and it rejects the spend because it's allocated to A in the main blockchain, even if I never spent it on A. There exists some mechanism for me to switch my bitcoin to B (by broadcasting on the main chain)... maybe? But then A needs to sign off that I don't have pending transactions?
Normally, network A and network B would be connected by a path, so your bitcoins can be routed through the destination by moving balances of each intermediaries. If there is no route to the destination, you can't send them as is. You'd need to take the bitcoin out of network A and open a channel with B. And that's operations on the main chain so it may take some time.
Once you've allocated BTC, you cannot doublespend it elsewhere (well, you can try, but verification nodes will reject it so the blockchain will never accept).
> Transaction fees are based on the complexity of the inputs/outputs, not the value transacted
Not on the lightning network. Fees are used to incentivize or disincentivize routes across channels.
> The institution handling this offchaing lightning branch can implement fees in whatever structure you agree to transact, including percentage based.
No institution is needed. Even if one is used as an intermediary, when using lightning non-custodially, the economics of lightning are such that fees are determined by the nodes in the payer's desired route. If it's a custodial transfer from one user to another, no routes are needed.
No way they're boarding boats. They can get an accurate enough cargo weight within seconds visually (maybe minutes, depending on how computerized it is)