Bitcoin Forum
May 07, 2024, 08:48:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: Turing completeness and state for smart contract  (Read 12220 times)
Karartma1
Legendary
*
Offline Offline

Activity: 2310
Merit: 1422



View Profile
July 04, 2016, 06:45:49 AM
 #41

Writing smart contracts is inherently not 'natural' software development similar to how writing legal contracts are not 'natural' prose. The requirements and implications are quite different.

Often the "simply written" smart contracts are grievously insecure-- I guess you could say that they're not that smart. Smiley


I would agree that the amount of effort required in order to get such things written and working "as expected" is far from trivial (even with such a tiny program such as the Crowdfund example I posted).

However it really isn't that much different to writing critical code for other things (such as medical equipment or software for spaceships) so I don't think it is without precedent (but is perhaps quite alien to the vast majority of programmers).

Rushing into writing complex "smart contracts" (and putting them in charge of millions of dollars worth of tokens) is not a good idea. This is a new and emerging field that is most likely only going to improve through a lot of unfortunate mistakes.


Exactly.

But this is where we are now: a lot of money has been put into the big "blockchain" pot. Who put that money wants results sooner rather than later and there it goes the lack studying and preparation.

I want to stress my point of view that you can easily find somewhere else: we can not allow any smart contract to rule anything that is subject to so much discretionality.
1715071707
Hero Member
*
Offline Offline

Posts: 1715071707

View Profile Personal Message (Offline)

Ignore
1715071707
Reply with quote  #2

1715071707
Report to moderator
1715071707
Hero Member
*
Offline Offline

Posts: 1715071707

View Profile Personal Message (Offline)

Ignore
1715071707
Reply with quote  #2

1715071707
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715071707
Hero Member
*
Offline Offline

Posts: 1715071707

View Profile Personal Message (Offline)

Ignore
1715071707
Reply with quote  #2

1715071707
Report to moderator
1715071707
Hero Member
*
Offline Offline

Posts: 1715071707

View Profile Personal Message (Offline)

Ignore
1715071707
Reply with quote  #2

1715071707
Report to moderator
1715071707
Hero Member
*
Offline Offline

Posts: 1715071707

View Profile Personal Message (Offline)

Ignore
1715071707
Reply with quote  #2

1715071707
Report to moderator
go1111111
Full Member
***
Offline Offline

Activity: 187
Merit: 162


View Profile
August 19, 2016, 09:05:37 AM
 #42

but I'm not seeing why exactly this means they shouldn't be written in a declarative language

How about now?

Though your example is making a distinction without a difference, something like that could easily be converted to something more Bitcoin script like... but the real differences I'm highlighting are things like avoiding mutable state,

Just seeing your comment now. Yes, the DAO stuff is evidence against having such an expressive scripting language. However I see the mutable state vs script-like language are fairly orthogonal. Assuming that Bitcoin's more constrained system of state is better, what I wonder is whether a more declarative way to write Bitcoin-script-equivalent stuff would still be preferable. As mentioned above, I think the declarative style puts less mental load on developers and is more 'natural'.

The gist of an earlier comment of yours seemed to be: "writing smart contracts is inherently hard and unnatural, so it's fine if the scripting language is hard to understand." I just don't see how one aspect of writing contracts being hard (getting the logic right) implies that it would be better for other aspects to be harder than they need to be.

If a declarative version of Bitcoin script made mistakes less likely, what is the downside? Are you worried about newbs who just learned a bit of javascript thinking they can write secure smart contracts just because Bitcoin script v2 might look a bit more like javascript? So the fact that current script looks intimidating is actually good? If so would it have been even better if Satoshi made all op codes of the form OP_XYZ where X, Y, and Z were digits? And maybe disallowed spaces when not including them would still be unambiguous? That would certainly reinforce in people's mind that writing Bitcoin script is tricky.
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
August 20, 2016, 01:03:41 AM
Last edit: August 21, 2016, 04:01:11 AM by gmaxwell
 #43

The gist of an earlier comment of yours seemed to be: "writing smart contracts is inherently hard and unnatural, so it's fine if the scripting language is hard to understand." I just don't see how one aspect of writing contracts being hard (getting the logic right) implies that it would be better for other aspects to be harder than they need to be.

If a declarative version of Bitcoin script made mistakes less likely, what is the downside? Are you worried about newbs who just learned a bit of javascript thinking they can write secure smart contracts just because Bitcoin script v2 might look a bit more like javascript? So the fact that current script looks intimidating is actually good? If so would it have been even better if Satoshi made all op codes of the form OP_XYZ where X, Y, and Z were digits? And maybe disallowed spaces when not including them would still be unambiguous? That would certainly reinforce in people's mind that writing Bitcoin script is tricky.

You misunderstood what I was saying.

A declarative model doesn't reflect the reality of these systems well. It is easier to get started, but hard to do things right, and very hard or impossible to to be confident that you got things right when you did.

A more functional model reflects the reality of the systems better, while also providing powerful scaling and analysis benefits.  I believe it is possible to construct systems which are harder to get started, but once you get something working its very likely to get things right, and hard but far from impossible to _prove_ you're achieving the properties that you set out to achieve.

I haven't proven that better can be done, yet (unless you count Bitcoin script)-- but what DAO/ETH seem to be proving is that at least that design is too dangerous to be used-- when their highest profile contract, reviewed by the designers of the system/language, got robbed blind by a rather simple vulnerability.
go1111111
Full Member
***
Offline Offline

Activity: 187
Merit: 162


View Profile
August 20, 2016, 08:26:59 AM
 #44

<some stuff>

That makes more sense. Thanks for clarifying.
marleybobthedog
Full Member
***
Offline Offline

Activity: 210
Merit: 100



View Profile
August 27, 2016, 06:43:08 PM
 #45

If ethereum technology becomes fondamental and useful, would it be wise to modify bitcoin to incorporate its fundamental changes which are the turing completeness and the possibility for contracts to have a state? (as well as a easier scripting language as serpent).

Best regards,
ilpirata79

Exactly, if someone care to modify the technology then it would prove be  very beneficial for us. As because many cryptocurrency are coming up each day so to contest the compedition it's necessary to bring the latest change.
spartacusrex
Hero Member
*****
Offline Offline

Activity: 718
Merit: 545



View Profile
August 31, 2016, 03:54:27 PM
 #46

.. how often do you write ordinary programs whos execution gets rolled back in a reorg or could "run out of gas"? The implications of failure are typical fairly different. The interactions with privacy are very different than ordinary software development.

Well.. anyone who has worked in SQL would know what a ROLLBACK is. (..and running out of gas could be considered a time condition ie it's taking too long, fail )

That is a technology that has had to manage complex financial 're-orgs' for a looong time.

There are many occasions on a daily basis that a SQL function call fails mid-sequence and you have to 'go back to the beginning..' .. undoing everything that the transaction has done up to that point. It's absolutely taken into account in the design of your system, and expected. 

Maybe using a system similar to the way SQL handles rollbacks and designing your system with that 'paradigm' in mind, would prove helpful when writing and running smart contracts, and then the re-orgs when they invariably do fail.

Life is Code.
Shockaftermoon
Full Member
***
Offline Offline

Activity: 224
Merit: 100


beatcoin team leader


View Profile WWW
September 01, 2016, 04:46:23 PM
 #47

 https://www.reddit.com/r/ethereum/comments/4g1bh6/greg_maxwells_critique_of_ethereum_blockchains/d2e24sy

Shiroslullaby
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250



View Profile
September 01, 2016, 04:57:04 PM
 #48

This is why I love this forum. 
As someone who only knows basic programming, its amazing to come to a thread like this and learn about things like "Turing Completeness" on my lunch break.

Is it possible to feel smarter and dumber at the same time?
The more learn, I realize how little I know...

Pages: « 1 2 [3]  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!