Smart contracts on the Lightning network?

in #bitcoin7 years ago

Remember me talking about Lapps on Bitcoin Lightning Network?
Well here the full post:
https://steemit.com/bitcoin/@sames/lapps-what-they-are-and-how-many-are-there-now
But I'll summarize the post for you.

Lapps are another name for Lightning apps and are kinda like Dapps. The Lightning network(LN) is kinda like a giant smart contracts for payments but utilizing that feature-apps can be built on the LN. LN nodes connect to these apps and maintain the payment in a decentralized structure. Every user can connect to the apps in a cheap manner. You in theory can run a LN node on your phone!

However in this new update:
https://www.coindesk.com/mit-testing-smart-contract-powered-bitcoin-lightning-network/
You can do more complex smart contracts on the LN now! :)

While the title of that post is a little misleading. Here what they are talking about!

They are actually referring to a new LApp development tool which allows for smart contracts to get executed instantly while seamlessly integrating with third party internet services. One example they give is that you could implement a futures contract on the lightning network, so Jim could bet $50 that bitcoin will hit $10k by Friday and if it does he would instantly get his money via the lightning network, with the futures contract enforced by a smart contract.
-reddit user dmar198

If you want to do this type of smart contract:

You and your counterparty would have to decide how to determine the price when you're setting up the contract. You'd probably use an exchange that has a digital way of presenting their prices to outside applications, or you might use an aggregate of several exchanges, but it'd all depend on how you and your counterparty design the off-chain part of the contract.

The important thing is how immensely this expands the ability of smart contracts that use lightning channels. We could already write contracts that trigger automatic actions -- like where if you pay someone a certain amount, their server automatically sends you a product (one implementation of this functionality is "IfPayThenThat" by Blockstream) -- but now we can write contracts where third party actions trigger a payment from your lightning channel, supposing you signed the contract ahead of time. So, for example, once the company ships the product, then your payment is automatically triggered. This vastly increases the abilities of bitcoin smart contracts in a dramatic way.
-reddit user dmar198

How is this accomplished?

By using Discreet Log Contracts.
The input that determines how to divide the funds locked in the contract comes from a trusted oracle. Oracles provide the connection between the blockchain and the real world, similar to other smart contract systems. There's (currently) no way around that - you have to trust the oracle will announce the correct value.

The paper already describes methods in which to mitigate the risk of the oracle not acting in good faith, for instance by using multiple oracles that have to agree (and the participants receiving their respective funds back if they don't).

There's an added benefit to the contract not being on chain. No one can actually see its existence from the public ledger which, for contracts you don't want to be known to the entire world, is a desirable feature.

The on-chain part of a discreet log contract is, similar to a payment channel, just a 2-of-2 multisig output.
-reddit user gertjaap

More decentralization of this type of L-contracts is being researched.

Also an erc20 type token standard can be built on the LN. I shall go more in depth on that one of these days. Also I going to combine these soon to be 3 posts into one bc they technically are about one subject Lapps :)
image.png

Sort:  

Upvoted ($0.17) and resteemed by @investorsclub

Join the Investors Club if you are interested in investing.

I agree that smart contracts will be nice addon to LN but for me BTC should stay at what is best,to be safest store of value and money.

The smart contract are good for the money part. I think the LN aka bitcoin will be for all money related transactions. The Ln app is a portal to money apps. But the apps will then run as apps on some type of blockchain hosting platform. Eos,ADA would be candidate for that. Blockchain platforms don't need to be as decentralized as bitcoin. They need to be fast,cheap and never stop running

Agree with that.

Rootstock is the future I see for Bitcoin for smart contract adoptiom but competition is always good so lets foot for both projects.

Yeah Rsk is pretty cool. I made a small caparison

Lapps are another name for Lightning apps and are kinda like Dapps. The Lightning network(LN) is kinda like a giant smart contracts for payments but utilizing that feature-apps can be built on the LN. LN nodes connect to these apps and maintain the payment in a decentralized structure. Every user can connect to the apps in a cheap manner. You in theory can run a LN node on your phone!
Is it better than Dapps yes and no. For one LN uses bitcoin so the apps can't make its own token well....unless Counterparty truly can use the LN for its token. That a story for another time. :)
And second, in a way LN apps need people to run it. In Dapps the apps are in the chain so now need of finding its own node-it shares it with others. LN apps are more scaleable than Dapp ie the Lapps don't store the data. Lapps are also more basic.

Roostock could be used more for running the app but the scalability needs to be much greater but i see huge potential for it.

This post received a $0.420 (92.11%) upvote from @upvotewhale thanks to @sames! For more information, check out my profile!

Coin Marketplace

STEEM 0.27
TRX 0.26
JST 0.039
BTC 94467.52
ETH 3348.45
USDT 1.00
SBD 3.35