Live data from Hacker News

Smart contracts on Bitcoin

avc.com

151–160 of 246 posts

Re: Smart contracts on Bitcoin

#151
post #140

Following the links down a hole a little bit I saw this statement: "Bitcoin is by far the largest and most secure blockchain"[1] Sure it's the largest, but it seems ETH2 might now be the most secure. It (at current prices) has $2,400,000,000 staked in the network. Sure this is still in the league of nation states to corrupt, but the penalties for breaking the rules are _so much higher_. Given that, and the fact that…

having a lot of money staked doesn't mean it's secure. The security model of Bitcoin comes from proof of work, which most people complain as being waste. But it's not actually waste. It's secure because miners have to keep working hard and "wasting energy" because the network is worth protecting (and only if the network is worth protecting). With proof of stake, the stakers only need to make an investment once in the…

> the stakers only need to make an investment once in the beginning

> The whole system could collapse overnight like a domino if something goes wrong

IMO, these two things are one of the main points of tension which PoS uses to operate. The stakers have put up a significant amount of value, and it's in their interest to maintain that value by preventing things from going wrong.

Not only that, but they are actively pitted against each other -- it's in their interest to find any node that tries to violate the rules, and submit an attestation slashing the offender's stake for bad behavior.

There are also a number of incentives (such as the upcoming EIP-1559 upgrade) which are designed to align incentives so that cartel members are encouraged to break away for their own advantage.

Re: Smart contracts on Bitcoin

#152

This is basically a bespoke blockchain that uses BTC as oracle. It's not a smart contracts "on Bitcoin". By this logic, I could write an ERC20 token on ETH and use some BTC state, and call it "smart contracts on Bitcoin".

Muneeb here, Stacks co-founder. So it does not use Bitcoin as oracle. It uses Bitcoin as a settlement layer. (Oracles like Chainlink can be, and are being, built using Clarity lang for Stacks blockchain itself.)

For using Bitcoin state on Ethereum, you'll need to implement Bitcoin SPV proofs. It's entirely possible but fairly complicated to do that given (a) Ethereum is a separate network that can fork independently from Bitcoin (Clarity contracts on Stacks fork with Bitcoin), and (b) Eth miners have no native visibility into Bitcoin state (Stacks miners have full visibility into Bitcoin state). Possible but more complicated. Further, any asset generation and transfers etc on such ERC20 asset would have nothing to with Bitcoin vs on Stacks all asset generation and transfers etc settle on Bitcoin and are secured by the Bitcoin main blockchain.

Re: Smart contracts on Bitcoin

#153

Earlier quoted context omitted.

having a lot of money staked doesn't mean it's secure. The security model of Bitcoin comes from proof of work, which most people complain as being waste. But it's not actually waste. It's secure because miners have to keep working hard and "wasting energy" because the network is worth protecting (and only if the network is worth protecting). With proof of stake, the stakers only need to make an investment once in the…

I'm not sure of the argument - so it results in rich get richer In PoW, the same 'rich get richer' applies - miners can buy more mining rigs and thus it compounds the same? miners invest heavily in constantly innovating and investing back into the network In PoS, is this not exactly the same, if not even more true? Stakers are by definition highly invested into the network The whole system could collapse overnight li…

> so it results in rich get richer In PoW, the same 'rich get richer' applies - miners can buy more mining rigs and thus it compounds the same?

In theory, if and when proof of mining actually becomes the mainstream vehicle for global financial transactions, simply buying more mining rigs won't be enough. They will need to institutionalize and reinvest heavily into their infra. The mining rig that could find ten blocks yesterday may only be able to find one block tomorrow if the competition becomes fierce. Since it's a permissionless system, if one miner starts doing it and makes a lot of money AND Bitcoin gets accepted as a legitimate payment network, other companies will enter the space and the competition will accelerate. That can't happen with PoS.

> miners invest heavily in constantly innovating and investing back into the network In PoS, is this not exactly the same, if not even more true? Stakers are by definition highly invested into the network

The difference is in continuous investment vs. one time investment. With proof of work (again, assuming when these models actually work as designed), you will need to invest more and more into the infrastructure as a miner to stay profitable. As a result the entire network becomes more and more secure. But with proof of stake, the stakers do not have incentive to compete in this manner. With proof of stake, you can literally throw around money to gain influence over a network. With Proof of Work that's not enough because you have to "keep investing", so you need actual commitment to the future. That's much stronger security than a network made up of people who only care about the present.

> PoW had decreased decentralization substantially to only happen in regions where electricity is the cheapest. PoS prevents this problem.

This is like saying "Riding car is dangerous because people can get hit by a car and die. Walking prevents this problem." There's always a solution for every problem. Even the decentralization. The only reason why that hasn't happened is because the Bitcoin network is not worth that much when it comes to its value as a payment system. That doesn't mean there is no solution. For example, using certain clever hashing algorithm, multiple miners can specialize and only do things that each location is optimized for. Mining doesn't just involve hashing. You can generate revenue through including more transactions in a block, for example.

Re: Smart contracts on Bitcoin

#154
post #151

Earlier quoted context omitted.

having a lot of money staked doesn't mean it's secure. The security model of Bitcoin comes from proof of work, which most people complain as being waste. But it's not actually waste. It's secure because miners have to keep working hard and "wasting energy" because the network is worth protecting (and only if the network is worth protecting). With proof of stake, the stakers only need to make an investment once in the…

> the stakers only need to make an investment once in the beginning > The whole system could collapse overnight like a domino if something goes wrong IMO, these two things are one of the main points of tension which PoS uses to operate. The stakers have put up a significant amount of value, and it's in their interest to maintain that value by preventing things from going wrong. Not only that, but they are actively pi…

see my comment in sibling thread. with proof of work, it's not just about money. proof of work mining forces miners to invest through future commitment, which means you can't just bring some one time money and gain influence. For proof of stake it's only about the present.

Re: Smart contracts on Bitcoin

#155

So it's a sidechain that ocassionally checks in it's state to bitcoin's main chain? And you can lock up BTC on the mainchain to use it on the sidechain?

The design can be thought of similar to a side chain but it's not really a side chain. It uses a new type of consensus, called Proof of Transfer (PoX). Stacks miners have visibility into both the Bitcoin chain and the Stacks chain. Leader election happens on Bitcoin and winning leader writes blocks on the Stacks chain. Details: https://blockstack.org/pox.pdf

Re: Smart contracts on Bitcoin

#156
post #151

Earlier quoted context omitted.

having a lot of money staked doesn't mean it's secure. The security model of Bitcoin comes from proof of work, which most people complain as being waste. But it's not actually waste. It's secure because miners have to keep working hard and "wasting energy" because the network is worth protecting (and only if the network is worth protecting). With proof of stake, the stakers only need to make an investment once in the…

> the stakers only need to make an investment once in the beginning > The whole system could collapse overnight like a domino if something goes wrong IMO, these two things are one of the main points of tension which PoS uses to operate. The stakers have put up a significant amount of value, and it's in their interest to maintain that value by preventing things from going wrong. Not only that, but they are actively pi…

> it's in their interest to maintain that value by preventing things from going wrong

It's also in their interest to never sell anyone enough tokens that they could become rival stakers, which makes the system vulnerable to node or network failures. Fewer stakers means fewer nodes to disrupt to trigger consensus failure.

Re: Smart contracts on Bitcoin

#157
post #12

Earlier quoted context omitted.

Muneeb here, Stacks co-founder. Great question. You are right that Clarity smart contracts have direct visibility into Bitcoin, so you can write a contract that has logic triggered by pure Bitcoin transactions. Moving Bitcoin to Stacks is a bit more complicated and there are several ways: a) Wrapped assets. Tokensoft + Anchorage (custodian) have a solution that they're calling xBTC where a "wrapped Bitcoin" is issued…

Bitcoin to Stacks is supposed to be the easy part... The question was about how you move Stacks to Bitcoin. I take from this handwaving answer that it isn't actually possible. Or let's rephrase the question in Bitcoin terms: While the BTC are locked up on the Bitcoin blockchain, which key is necessary to unlock them? Surely one controlled by Blockstack, no?

You'd need a STX-collateralized relay service that would trade your xBTC for real BTC. The collateral would be burnt over time if the service misbehaved, such as by not doing outstanding trades in a timely manner. The collateral itself would live in a Clarity contact so it could validate proofs that the service sent BTC to xBTC sellers.

Re: Smart contracts on Bitcoin

#158
post #152

This is basically a bespoke blockchain that uses BTC as oracle. It's not a smart contracts "on Bitcoin". By this logic, I could write an ERC20 token on ETH and use some BTC state, and call it "smart contracts on Bitcoin".

Muneeb here, Stacks co-founder. So it does not use Bitcoin as oracle. It uses Bitcoin as a settlement layer. (Oracles like Chainlink can be, and are being, built using Clarity lang for Stacks blockchain itself.) For using Bitcoin state on Ethereum, you'll need to implement Bitcoin SPV proofs. It's entirely possible but fairly complicated to do that given (a) Ethereum is a separate network that can fork independently…

People are asking you why this counts as "on Bitcoin", and you've been saying throughout this thread it's because it has access to the Bitcoin ledger data. My point is that it pretty much sounds like you're using BTC as an "oracle" (and of course, you're using BTC as settlement, but that's a given, and also doesn't qualify as being "on bitcoin"). Stacks is a separate ledger that pegs itself to Bitcoin, not "on". "Smart contracts on Bitcoin" would be something that's entirely built on the Bitcoin ledger and every smart contract transaction is a Bitcoin transaction that settles.

Re: Smart contracts on Bitcoin

#159

I remember Counterparty (XCP) tried something like this a long time ago. Not full blown smart contracts, but things like asset creation (tokens) and decentralized exchanges like on Ethereum. Anyway at the time they received a lot of pushback from some Bitcoin core devs and some threatened to block them over their use of OP_RETURN. Wonder how sustainable Stacks approach is in comparison? Don't know if it works the sam…

Yup. Creator of Counterparty here. It's funny to think that if the Core devs hadn't be so incredibly resistant to people using the Bitcoin blockchain in unexpected ways, Ethereum wouldn't exist in its current form. See https://twitter.com/vitalikbuterin/status/929804867568373760

Vitalik's claim is a lie. No "OP_RETURN wars" happened. It's a complete fabrication.

See https://twitter.com/notgrubles/status/1187470076833697794

Re: Smart contracts on Bitcoin

#160
post #122

Earlier quoted context omitted.

Notably, Vitalik was run out on a rail by small blockers (mostly LukeJr) when he was trying to work on smart contracts on BTC back in the day. This is the entire reason he launched Ethereum, and took with him everyone else interested in working on smart contracts. Smart contracts are neat. Bitcoin is neat. Smart contracts on Bitcoin could have been a thing, but now it's too late. There is almost zero intersection bet…

> .. now it's too late. Perhaps it is too late for replicating existing use cases. However, the general idea of running EVM-like smart contracts secured by Bitcoin PoW (e.g. merge mined sidechains) is still quite attractive

Only if you enjoy all of the negatives of EVM-like smart contracts including chain splits, gas problems, subtle bugs that could drive exchanges to insolvency, mass theft, broken multisig, the list goes on...
Post reply on HN