pBitcoin QA: 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. that you can also implement it in a very simplified script language like Bitcoin. These contracts are usually some form of multisig or merkle proof that allows you to lock value. on one blockchain and release an equivalent amount on the other blockchain . The two parties who engage in a transfer or atomic swap between two blockchains. agree and choose which contract to use. There can be multiple implementations that transfer value between two blockchains, between sidechains. You choose which implementation you use if somebody else is also using that implementation, then you can execute a swap with them. multisig and time delays of smart contracts? In some cases.
I dont see why you would implement a smart contract system that didnt at least have the multiple owners signatures and time delays. I have never seen a smart contract language didnt have those. Even Bitcoin, which most people dont call a smart contracts platform, basic script . You dont need smart contracts in order to do Lightning payment channels, The ability to do basic multisig and time delays is usually enough.
Do the participants of the Lightning Network set up a smart contract? What I mean by smart contract is basically. a Bitcoin address with for multisig, time, and a refund or penalty process. used to continuously update the channel. You dont do any of that effectively, that is automatically done by your Lightning wallet. It looks very similar to a bitcoin payment.
You receive a QR code a Lightning invoice, you tell your wallet to pay that invoice, and finds a route within the network. through which it can make a series of commitments to transmit to the party . That will execute in less than a second, in most cases. is very fast. Your payment will be received at the other end . All of the smart contracts, multisig, and all of those details are managed by the wallets invisible to the user. To the user, it just looks like a very fast bitcoin transaction that can have very small amounts. You can 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 secondlayer?
A very good question, Erik. Lightning is not a sidechain. Lightning is a secondlayer . Lightning is a mechanism for transmitting payments offchain, using an underlying blockchain for security. It allows you to route through payment channels, which are smart contracts using multisig and time delays.
It allows you to transfer bitcoin. between two participants, without to record it on the blockchain . Those two participants dont need to trust because the underlying Bitcoin blockchain is the basis. of trust and security. Because something like Lightning can also be a multicurrency 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 . The requirements for a blockchain to be Lightning compatible, to interact with these payment channels, are certain fundamental security functions, including multisig, time delay, . Together with those two functions, you can implement what is called. a hashed timelock contract, which is the building block. for 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 bitcoin, and the recipient 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 regarding side chains? Great question, Christian. Sidechains arent a second layer. The technology that connects two blockchains together is kind of a second layer, but not really. transactions within each of the blockchains, but sidechains are not really a layer.
Theyre more a parallel stack, if you like. You have two stacks that operate side by side., Who runs, keeps, maintains, and is incentivized for the security ? That is the most important question. Unless you can answer that question, you cant 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 Bitcoin is also sidechain to . It simply mean a chain on the side.p