Pages:
Author

Topic: Why don't we have bitcoin smart contract? (Read 516 times)

hv_
legendary
Activity: 2534
Merit: 1055
Clean Code and Scale
sr. member
Activity: 377
Merit: 282
Finis coronat opus
December 14, 2019, 04:01:54 AM
#29
i honestly am not so sure which scripts bitcoin core considered non-standard by default. i may be misunderstanding the c++ code of it but it seems like it could consider OP_CLV as non-standard which is weird because i have seen people make this type of transaction.

I read few articles, and it looks like that every P2PKH output will be considered as "nonstandard" if it not following standard scheme (which i linked above)

Here some explaining from Achow101: https://bitcoin.stackexchange.com/questions/81623/non-standard-transaction-scripts-broadcasting

OP_CLTV is nonstadard in P2PKH. But standard in P2SH. Ordinary locktime is standard too, but it's not an opcode, just a special field (just a number) in transaction.
legendary
Activity: 3472
Merit: 10611
December 09, 2019, 10:17:18 PM
#28
If transaction doesn't match this standards when it's "nonstandard" with all it problems.

that is a very good point.
i honestly am not so sure which scripts bitcoin core considered non-standard by default. i may be misunderstanding the c++ code of it but it seems like it could consider OP_CLV as non-standard which is weird because i have seen people make this type of transaction.
legendary
Activity: 3472
Merit: 1724
December 09, 2019, 03:00:59 PM
#27
Colored coins isn't language to make Bitcoin script

No, I was just mentioning it in the context of smart contracts, maybe it would ring a bell to the OP.
sr. member
Activity: 377
Merit: 282
Finis coronat opus
December 09, 2019, 07:25:10 AM
#26
additionally the script i posted was not P2PKH, it can't be since it is not OP_DUP HASH160 <> EQUALVERIFY CHECKSIG! it is a "scriptpub".


Code:
OP_DUP OP_HASH160 OP_EQUAL
OP_IF
    OP_CheckSig
OP_ELSE
   OP_CheckLocktimeVerify OP_DROP OP_DUP OP_HASH160
   OP_EQUALVERIFY OP_CheckSig
OP_ENDIF

Maybe i get something wrong, because i'm not very good in english.

Edit: I have understood what you're talking about. You're right, but i'm right too: such script will not be mined with very high probability.

and finally there is no "must" in scripts, you can provide whatever you like.

Yes, but if other nodes will not retranslate it (transaction) and miners will not mine it - there is no much sense to "provide whatever i want". And my message was about that.
In theory, you can add to ScriptPubKey whatever you want (i'm about active Op codes). But in practice, we have something like that:

B peaлизaции пpoвepки нa cтaндapтнocть чёткo oпpeдeлён шaблoн cкpиптa P2PKH:

https://github.com/bitcoin/bitcoin/blob/master/src/script/standard.cpp#L60
https://github.com/bitcoin/bitcoin/blob/master/src/script/standard.cpp#L138

If transaction doesn't match this standards when it's "nonstandard" with all it problems.
sr. member
Activity: 1078
Merit: 340
December 09, 2019, 05:49:48 AM
#25
Thanks everyone for sharing so much meaningful information. I really feel that I got more information that I really wanted to be
aware of, yet it is not as promoted / marketed to the masses. I didn't know about Bitcoin already implementing the escrow thing,
nor did I know about RKS, Omni layer , simplicity and scripts.

Most of this is still highly experimental technology so there's no sense in marketing it to the masses (yet). Also, once these technologies are ready for the masses (in terms of maturity and usability), if all goes well they won't be aware that they are using these technologies to begin with.

Case in point: You have never heard of OMNI but you're probably aware of Tether. Well, it's an OMNI token.


We should really start working on user experience.

Lots of wallet projects working on that front. And it makes sense, because that's the part that is facing the user. Smart contracts, DApps? Your average user couldn't care less.



To use internet you don't need to know the OSI structure  Wink

Well one should be aware of at least layer 1 if the router is supposed to work Grin

I merited because of last joke which put a huge smile on my face as I am studying data-link and network layer for my last year exam on Friday 13th  Shocked
 Also because of the OMNI. I never heard about OMNI and yet is so interesting. This is such a powerful project, I don't know how it's not super famous yet. Thank you so much for sharing
For anyone interested here is the link https://www.omnilayer.org/
Good luck with your exams  Wink
after omni was famous years ago I think but not so much now and the copyright in the footer is 2017 so ...
But they still have some github activity and still working on it it seems
member
Activity: 421
Merit: 97
December 08, 2019, 11:33:58 AM
#24
Thanks everyone for sharing so much meaningful information. I really feel that I got more information that I really wanted to be
aware of, yet it is not as promoted / marketed to the masses. I didn't know about Bitcoin already implementing the escrow thing,
nor did I know about RKS, Omni layer , simplicity and scripts.

Most of this is still highly experimental technology so there's no sense in marketing it to the masses (yet). Also, once these technologies are ready for the masses (in terms of maturity and usability), if all goes well they won't be aware that they are using these technologies to begin with.

Case in point: You have never heard of OMNI but you're probably aware of Tether. Well, it's an OMNI token.


We should really start working on user experience.

Lots of wallet projects working on that front. And it makes sense, because that's the part that is facing the user. Smart contracts, DApps? Your average user couldn't care less.



To use internet you don't need to know the OSI structure  Wink

Well one should be aware of at least layer 1 if the router is supposed to work Grin

I merited because of last joke which put a huge smile on my face as I am studying data-link and network layer for my last year exam on Friday 13th  Shocked
 Also because of the OMNI. I never heard about OMNI and yet is so interesting. This is such a powerful project, I don't know how it's not super famous yet. Thank you so much for sharing
For anyone interested here is the link https://www.omnilayer.org/
legendary
Activity: 3472
Merit: 10611
December 08, 2019, 10:03:51 AM
#23
@ETF BTC but that's... the thing. I can't expect my heir to learn multisig, and the whole point was to avoid hiring an escrow =)

It's easy to create such contract without multisig

Code:
OP_CLTV OP_DROP OP_CHECKSIG

With ordinary locktime, your heir must keep signed transaction and also his (recepient) privatekey. In example above he's only need to keep privatekey (if he generate redeem script by himself) or privatekey + redeem script (if it was generated by you).

But in case above you can forget about your money before needed time and even if you don't want to give away your money to your heir. So, we need to create script where you can spend your money in some cases.

pooya87's example is the closest one to such conditions. But without multisig, of course. BUT: his script is for P2PKH address (pub key hash, in P2SH we must provide pubkey), so i woud not recommend to use it. We have such conversation in our local russian topic, and one user, Balthazar, said that most of bitcoin core nodes will reject P2PKH non standard scripts, so without mining powers or at least without friends in a big mining pool you're not will be able to confirm such transaction.

let's not confuse P2SH with multi-sig, the latter is only a subcategory of a wider range of scripts called pay to script hash. also your script will lock up his funds and can ONLY be unlocked by the heir. when inheritance is involved you want to continued having control over your own money until you are alive and only give it up after you pass away. if you lock it up with this script you are giving it up NOW.

Quote
his script is for P2PKH address (pub key hash, in P2SH we must provide pubkey)
there is no "address" for uncommon scripts. addresses are only defined for the most common scripts.
additionally the script i posted was not P2PKH, it can't be since it is not OP_DUP HASH160 <> EQUALVERIFY CHECKSIG! it is a "scriptpub".
and finally there is no "must" in scripts, you can provide whatever you like. not to mention that the script included hash of pubkey not the pubkey itself. you can change the hashes with pubkeys and use it as a redeem script for a P2SH scriptpub
sr. member
Activity: 377
Merit: 282
Finis coronat opus
December 08, 2019, 07:12:32 AM
#22
@ETF BTC but that's... the thing. I can't expect my heir to learn multisig, and the whole point was to avoid hiring an escrow =)

It's easy to create such contract without multisig

Code:
OP_CLTV OP_DROP OP_CHECKSIG

With ordinary locktime, your heir must keep signed transaction and also his (recepient) privatekey. In example above he's only need to keep privatekey (if he generate redeem script by himself) or privatekey + redeem script (if it was generated by you).

But in case above you can forget about your money before needed time and even if you don't want to give away your money to your heir. So, we need to create script where you can spend your money in some cases.

pooya87's example is the closest one to such conditions. But without multisig, of course. BUT: his script is for P2PKH address (pub key hash, in P2SH we must provide pubkey), so i woud not recommend to use it. We have such conversation in our local russian topic, and one user, Balthazar, said that most of bitcoin core nodes will reject P2PKH non standard scripts, so without mining powers or at least without friends in a big mining pool you're not will be able to confirm such transaction.
legendary
Activity: 3472
Merit: 1724
December 06, 2019, 03:59:41 PM
#21
I remember there was one more language (besides Simpicity and Bitcoin script) for writing Bitcoin smart contracts. They often referred to it when Solidity came. Can't for the life of me recall the name or even find it anywhere but it was some sort of 3-letter acronym. Does anyone know?

Maybe Miniscript is what you're thinking about?

http://bitcoin.sipa.be/miniscript/

Or OTX (Open Transactions)

https://github.com/FellowTraveler/opentxs

Or colored coins (that one didn't pan out, IIRC).
legendary
Activity: 2968
Merit: 3684
Join the world-leading crypto sportsbook NOW!
December 05, 2019, 02:22:48 PM
#20
@ETF BTC but that's... the thing. I can't expect my heir to learn multisig, and the whole point was to avoid hiring an escrow =)


even if you were high-end expert you still shouldn't have to be using scripts that you write by hand. there should always be a user friendly tool where it takes the inputs needed for creation of the script and then returns the  final transaction. for example to use the escrow (m of n multisig) script you can use the user friendly wallet called Electrum where you just import your master keys and m, the wallet does everything else.

otherwise it would not only take a lot of time but also you may easily make a lot of mistakes. for example  as an experiment and also to answer a question i recently created a script using OP_CLV and send some funds to it on testnet and then spent them. the whole thing took me about 1.5 hours and i messed up the first time and lost the first coins, they are now locked forever!!! here is the link: https://bitcointalksearch.org/topic/m.53211121

I guess, this process is what I mean by a "smart contract" or dapp (trust me I hate using those words)... I have used such an escrow smart contract (not on Bitcoin but on an alt client) and it was breathtakingly straightforward, the whole thing gave instructions so I never even needed a manual...

But you're right, and that's why, even if it is quite simple to see and achieve as you and others demonstrate, it is still risky enough for someone like me to attempt with serious amounts. As it is, even simple transactions take me some minutes to double triple check!;)
sr. member
Activity: 1078
Merit: 340
December 05, 2019, 05:30:10 AM
#19
Don't get me wrong, I love those solutions but as a very low-end Bitcoiner, I would be far from confident enough to attempt those scripts, much less hope the same for someone else I intend to pass my inheritance to. I consider myself the highest level technical knowledge you could possibly expect from a mainstream user:

even if you were high-end expert you still shouldn't have to be using scripts that you write by hand. there should always be a user friendly tool where it takes the inputs needed for creation of the script and then returns the  final transaction. for example to use the escrow (m of n multisig) script you can use the user friendly wallet called Electrum where you just import your master keys and m, the wallet does everything else.

otherwise it would not only take a lot of time but also you may easily make a lot of mistakes. for example  as an experiment and also to answer a question i recently created a script using OP_CLV and send some funds to it on testnet and then spent them. the whole thing took me about 1.5 hours and i messed up the first time and lost the first coins, they are now locked forever!!! here is the link: https://bitcointalksearch.org/topic/m.53211121


And of course if you don't understand something or are afraid, you will not use it. Cryptocurrencies need to be easy to use if we want to get an adopation....
Thanks for the other link too Smiley
legendary
Activity: 3472
Merit: 10611
December 04, 2019, 10:50:40 PM
#18
Don't get me wrong, I love those solutions but as a very low-end Bitcoiner, I would be far from confident enough to attempt those scripts, much less hope the same for someone else I intend to pass my inheritance to. I consider myself the highest level technical knowledge you could possibly expect from a mainstream user:

even if you were high-end expert you still shouldn't have to be using scripts that you write by hand. there should always be a user friendly tool where it takes the inputs needed for creation of the script and then returns the  final transaction. for example to use the escrow (m of n multisig) script you can use the user friendly wallet called Electrum where you just import your master keys and m, the wallet does everything else.

otherwise it would not only take a lot of time but also you may easily make a lot of mistakes. for example  as an experiment and also to answer a question i recently created a script using OP_CLV and send some funds to it on testnet and then spent them. the whole thing took me about 1.5 hours and i messed up the first time and lost the first coins, they are now locked forever!!! here is the link: https://bitcointalksearch.org/topic/m.53211121
sr. member
Activity: 1078
Merit: 340
December 04, 2019, 01:08:37 PM
#17
But the smart contract platforms people talk about make escrow smart contracts just easy to use, safe, simple. IF the scripts you just shared are so easy to use (they're not for me), why isn't it brought up to be used more often in the p2p trades this forum sees every day? We're still heavily reliant on hiring forum escrowers for big trades.

pooya87's script is about 2-of-3 multi signature address and you already can use it easily (without need to know about scripting) by using wallet which support multi signature wallet such as Electrum.

And obviously hiring escrow is still needed.

Of course, escrow is a huge + of blockchain so no reason to stop it  Smiley
After you just need to be careful when you choose your escrow guy ..
But be careful when you put your trust in someone is what we do everyday ..
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
December 04, 2019, 08:10:32 AM
#16
But the smart contract platforms people talk about make escrow smart contracts just easy to use, safe, simple. IF the scripts you just shared are so easy to use (they're not for me), why isn't it brought up to be used more often in the p2p trades this forum sees every day? We're still heavily reliant on hiring forum escrowers for big trades.

pooya87's script is about 2-of-3 multi signature address and you already can use it easily (without need to know about scripting) by using wallet which support multi signature wallet such as Electrum.

And obviously hiring escrow is still needed.
sr. member
Activity: 1078
Merit: 340
December 04, 2019, 04:53:12 AM
#15
While bitcoin may not have "smart-contract" implementation, there have been multiple initiatives in implementing smart contract as a bitcoin sidechain. Rootstock was talked about a lot once. Then there was the language Simplicity. I am not sure what is the progress on these concepts.

These were meaningful extensions of the bitcoin network. Although, we seem to have gone full "Bitcoin should only be used as SoV", a lot of original developers are the ones who diversified this vision too. In a way, they are all part of bitcoin.
The best scenario for crypto-economy would be to have the Pro-Dapp community and the maximalist community on the same page.
Links:
RSK Smart contracts
Simplicity whitepaper

Thanks for the links I will take a look too.
You don't hear a lot about project based on Bitcoin because of Ethereum.
And the last project (even if it is different ) Bitcoin based I heard about was "stratis" but ... They are dead , right ?
legendary
Activity: 2968
Merit: 3684
Join the world-leading crypto sportsbook NOW!
December 04, 2019, 03:13:46 AM
#14
Thank you pooya for that! As usual you have a lot to share=) See, all the other times I've actually asked, I don't ever recall getting the answer, but I think the arguments some have presented stand.

What you shared, again, are scripts, and not the sort of straightforward smart contract (and as someone pointed out not Turing complete either).

Don't get me wrong, I love those solutions but as a very low-end Bitcoiner, I would be far from confident enough to attempt those scripts, much less hope the same for someone else I intend to pass my inheritance to. I consider myself the highest level technical knowledge you could possibly expect from a mainstream user: we know how to sign and broadcast txs, we know how to spend particular inputs, we know RBF, CPFP, and we're just starting to get used to LN.

But the smart contract platforms people talk about make escrow smart contracts just easy to use, safe, simple. IF the scripts you just shared are so easy to use (they're not for me), why isn't it brought up to be used more often in the p2p trades this forum sees every day? We're still heavily reliant on hiring forum escrowers for big trades.

legendary
Activity: 1904
Merit: 1159
December 04, 2019, 02:36:33 AM
#13
While bitcoin may not have "smart-contract" implementation, there have been multiple initiatives in implementing smart contract as a bitcoin sidechain. Rootstock was talked about a lot once. Then there was the language Simplicity. I am not sure what is the progress on these concepts.

These were meaningful extensions of the bitcoin network. Although, we seem to have gone full "Bitcoin should only be used as SoV", a lot of original developers are the ones who diversified this vision too. In a way, they are all part of bitcoin.
The best scenario for crypto-economy would be to have the Pro-Dapp community and the maximalist community on the same page.
Links:
RSK Smart contracts
Simplicity whitepaper
legendary
Activity: 2898
Merit: 1823
December 04, 2019, 01:35:02 AM
#12
OP, Lightning channels are essentially smart contracts between users that serves the biggest use-case for cryptocurrencies. Payments.

Ethereum "DAPPS" are "show and tell" things you can use, but will not replace their centralized counterparts.
legendary
Activity: 3472
Merit: 10611
December 03, 2019, 11:16:01 PM
#11
i honestly don't see the attraction in what ethereum has. specially since so far in the past 5 years of ethereum's existence i have not seen even a single DApps that were remotely interesting or were doing anything meaningful!

You don't find DEX and Casino interesting ?

as far as i can tell you can not trade altcoins in any of these so called DEXes built on top of ethereum. the only thing you can trade is tokens that are created on that platform aka ERC20 tokens. i don't see the point in such exchange apart from letting people dump their ICO tokens!
i don't have much information about casinos, i have only seen them on Byteball and the idea seemed interesting. so i'll give you that.

What do you think is the next step in this industry? I don't believe it is "mature" yet and there is such a big gap left.
one thing about bitcoin that you should keep in mind is that it is a currency and as a payment system it has no need for very complicated and feature rich smart contracts.
Pages:
Jump to: