Bitcoin Q&A: Smart contracts, sidechains, and the Lightning Network

“How can assets be transferred between blockchains?” “How do they agree on the exchange contract, if nobody
owns the implementation?” Great question, Gabriel. Essentially, the way assets are transferred between
blockchains is through a very basic smart contract. [So basic] that you can also implement it in a very
simplified script language like [what is in] Bitcoin. These contracts are usually some form of multi-sig
or merkle proof that allows you to lock value… on one blockchain and release an equivalent amount
on the other blockchain [through a series of conditions]. The two parties who engage in a transfer
or atomic swap between two blockchains… [must] agree [to those conditions]
and choose which contract to use. There can be multiple implementations that transfer
value between two blockchains, between sidechains. You [would] choose which implementation you [will] use;
if somebody else is also using that implementation, then you can execute a swap with them. “[Are] multi-sig and time delays [features]
of smart contracts?” In some cases. [Although] I don’t see why you would implement a smart
contract system that didn’t at least have the [option for] multiple owners / signatures and time delays. I have never seen a smart contract
language [which] didn’t have those. Even Bitcoin, which most people don’t call a
‘smart contracts’ platform, [has] basic script [for both]. You don’t need [complex] smart contracts in order to do
[multi-sig, time delays, or] Lightning payment channels, The ability to do basic multi-sig
and time delays is usually enough. “Do the participants of the Lightning
Network [need to] set up a smart contract?” What I mean by “smart contract” is basically… a Bitcoin address with [scripts] for multi-sig,
time [delays], and a refund or penalty process. [Those are] used to continuously update the channel. You don’t do any of that [manually]; effectively,
that is automatically done by your Lightning wallet. It looks very similar to a bitcoin payment. You receive a QR code [within] a Lightning invoice,
you tell your wallet to pay that invoice, and [your node] finds a route within the network… through which it can make a series of commitments
to transmit [satoshis] to the party [who sent the invoice]. That will execute in less than a second, in most cases.
[The Lightning Network] is very fast. Your payment will be received at the other end [of the
route]. All of the smart contracts, multi-sig [conditions], and all of those details are managed by the
wallets [and can be made] invisible to the user. To the user, it just looks like a very fast bitcoin
transaction that can have very small amounts. You can [send] amounts that are even less than a
satoshi, with very low fee or sometimes no fee at all. “Is the Lightning Network a sidechain or a second-layer?”
A very good question, Erik. Lightning is not a sidechain. Lightning is a second-layer [network]. Lightning is a mechanism for transmitting payments
off-chain, using an underlying blockchain for security. It allows you to route through payment channels, which
are smart contracts using multi-sig and time delays. It allows you to transfer [small amounts of] bitcoin… between two participants, without [needing] to record it
on the blockchain [until settlement or there is a dispute]. Those two participants don’t need to trust [anyone else]
because the underlying Bitcoin blockchain is the basis… of trust and security. Because something like Lightning can
also be a multi-currency routing network, you can have nodes that are participating in
Lightning with Bitcoin, or nodes that run Litecoin. Theoretically you could have nodes that run
Ethereum or [other compatible blockchains]. The requirements for a blockchain to be Lightning
compatible, to interact with these payment channels, are certain fundamental security functions, including
multi-sig, time delay, [and a transaction malleability fix]. Together with those two functions, [multi-sig and
time delays] you can implement what is called… a hashed timelock contract, which is the building block.. for [uni-directional and bi-directional,
or] routed, payment channels. The Lightning Network is absolutely not a sidechain.
It is a second layer. Theoretically, you could use it… to connect side chains to each other. Today, in fact, you can transmit a Lightning payment
[with] bitcoin, and the recipient [will get] Litecoin, which is another blockchain, because
both of them are Lightning compatible. Effectively, that has made Litecoin and Bitcoin into sidechains of each other, with the Lightning Network… being the smart contract layer that connects them. “If sidechains had to be created as a second layer
from the original decentralized Bitcoin blockchain, does this mean centralization?” “Who runs, keeps, maintains, or is incentivized
for [the security model] regarding side chains?” Great question, Christian.
Sidechains aren’t a second layer. The technology that connects two blockchains
together is kind of a second layer, but not really. [They involve] transactions within each of the
blockchains, but sidechains are not really a layer. They’re more a parallel stack, if you like.
You have two stacks that operate side by side. [And you ask], “Who runs, keeps, maintains,
and is incentivized for the security [model]?” That is the most important question. Unless you can answer that question, you can’t
say anything about the security of a sidechain. Keep in mind, a sidechain is
an attribute of a relationship. To be a sidechain to another blockchain means that one
blockchain has the ability to transfer or peg value… in and out of another blockchain, with
some form of atomic swap mechanism. Neither of these is really subordinate to the other.
The term ‘sidechain’ is often confusing. Bitcoin can be a ‘sidechain’ to something else. If something is a sidechain to Bitcoin, then
[perhaps] Bitcoin is also sidechain to [that chain]. It [can] simply mean “a chain on the side.”

23 thoughts on “Bitcoin Q&A: Smart contracts, sidechains, and the Lightning Network”

  1. How would i pay someone wid LN if i dont have payment channels to him? Would that wallet does that for me automatically? Does that mean, my Private Key is now exposed?

  2. Stakenet (XSN) Have already performed Lightning swaps with LTC and will soon come out with a lightwallet where u can do one click swaps to any lightning compatible coin and their dex will be a true decentralized Dex since its the first one to be run by masternodes. Now THATS something to be hyped about 😀

  3. If lightning compatible bitcoin and litecoin can transfer to one another how d ok e that affect the supply. Litecoin becomes bitcoin? Thank you Harvey

  4. Useful video as usual, thank you Andreas.
    I've heard blockchain is built on top of the ISO/OSI stack. Does it means blockchain belongs to the layer 7 (Application layer) of the Osi architecture?

  5. Who provides the security for the side-chains? Well you just have side-chains merge-mine with the Bitcoin blockchain, and then those side-chains can inherit the hash rate of the Bitcoin blockchain. This is what Elastos is doing.

  6. Hi Andreas, thanks for a great contribution to Crypto community you do by sharing your profound knowledge. I have a question about so called "paper bitcoin" . There is a fear that banks could print in the future their own paper bitcoins, of course they will claim that every paper bitcoin is actually backed by the real one, (something like we see today with Tether). The problem is that average person/investor will trust the banks instead of trusting to the technology and so the decentralization aspect of bitcoin will be removed, also if every bank can create false paper bitcoins, it means inflation of coins and the deflationary nature of the real bitcoin can be lost with crowds buying the paper coins, that are not really backed by real bitcoins. How will all this in your view impact the price/usage/ adoption of the real bitcoin. How can the real bitcoin fight back. Thanks

  7. Opening a channel requires a transaction on the main blockchain. Once I exhaust that btc or LTC, I have to refill that channel via another transaction on the main chain right?

  8. Several comments are people asking Andreas talk about or basically shill some scammy alt coin. He seems to never take money or "sponsorship" to promote ICOs or scammy stuff. And 95%+ of the a available coins out there are garbage that invested primarily in marketing and have no developers.
    Most crypto youtubers do take money to include some alt coin in a video, often with titles like Top 10 coins to own usually include a few shit coins only there because the youtuber was compensated in some way.
    I admire Andreas for not selling out and promoting crap. Greed is so powerful, and with his level of influence, he must have been offered huge money during the ICO craze. I respect that he didnt sell out.

  9. So give up freedom for faster payments then after a while be charged for faster payments lol because this was set up by the world banks

Leave a Reply

Your email address will not be published. Required fields are marked *