Bitcoin Forum
April 26, 2024, 01:43:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Why don't we have bitcoin smart contract?  (Read 469 times)
malevolent
can into space
Legendary
*
Offline Offline

Activity: 3472
Merit: 1721



View Profile
December 06, 2019, 08: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).

Signature space available for rent.
1714138980
Hero Member
*
Offline Offline

Posts: 1714138980

View Profile Personal Message (Offline)

Ignore
1714138980
Reply with quote  #2

1714138980
Report to moderator
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714138980
Hero Member
*
Offline Offline

Posts: 1714138980

View Profile Personal Message (Offline)

Ignore
1714138980
Reply with quote  #2

1714138980
Report to moderator
1714138980
Hero Member
*
Offline Offline

Posts: 1714138980

View Profile Personal Message (Offline)

Ignore
1714138980
Reply with quote  #2

1714138980
Report to moderator
1714138980
Hero Member
*
Offline Offline

Posts: 1714138980

View Profile Personal Message (Offline)

Ignore
1714138980
Reply with quote  #2

1714138980
Report to moderator
TechPriest
Sr. Member
****
Offline Offline

Activity: 377
Merit: 282


Finis coronat opus


View Profile
December 08, 2019, 12:12:32 PM
 #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:
<needed time> OP_CLTV OP_DROP <pubkey> 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.

In science we trust!
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10504



View Profile
December 08, 2019, 03:03:51 PM
 #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:
<needed time> OP_CLTV OP_DROP <pubkey> 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

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
CristianOff (OP)
Member
**
Offline Offline

Activity: 421
Merit: 97


View Profile
December 08, 2019, 04:33:58 PM
 #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/
Tramirostronix
Sr. Member
****
Offline Offline

Activity: 1078
Merit: 340



View Profile
December 09, 2019, 10: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

I love XRP. XRP>BTC + DEDICACE A JULIEN le CROISE
TechPriest
Sr. Member
****
Offline Offline

Activity: 377
Merit: 282


Finis coronat opus


View Profile
December 09, 2019, 12:25:10 PM
Merited by pooya87 (1)
 #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 <hash_of_your_pubkey> OP_EQUAL
OP_IF
    OP_CheckSig
OP_ELSE
   <locktime=7years> OP_CheckLocktimeVerify OP_DROP OP_DUP OP_HASH160 <hash_of_your_heir's_pubkey>
   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.

In science we trust!
malevolent
can into space
Legendary
*
Offline Offline

Activity: 3472
Merit: 1721



View Profile
December 09, 2019, 08: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.

Signature space available for rent.
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10504



View Profile
December 10, 2019, 03:17:18 AM
 #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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
TechPriest
Sr. Member
****
Offline Offline

Activity: 377
Merit: 282


Finis coronat opus


View Profile
December 14, 2019, 09:01:54 AM
Last edit: December 14, 2019, 09:30:03 AM by TechPriest
Merited by suchmoon (4)
 #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.

In science we trust!
hv_
Legendary
*
Offline Offline

Activity: 2506
Merit: 1055

Clean Code and Scale


View Profile WWW
January 02, 2020, 11:17:10 AM
Last edit: January 02, 2020, 12:51:03 PM by hv_
 #30

Bitcoin is mostly complete

This guy has proven a lot

https://mobile.twitter.com/clemensley

And that


https://mobile.twitter.com/oudekaas3/status/1212704501804781568

Carpe diem  -  understand the White Paper and mine honest.
Fix real world issues: Check out b-vote.com
The simple way is the genius way - Satoshi's Rules: humana veris _
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!