300 points · by TD-Linux · 9y ago · 95 comments
"Currently I’m confident I can write an interpreter of Bamboo in Coq or Isabelle/HOL. I don’t want to expand the language much further until I write one so that I can prove properties of Bamboo programs. Ultimately I’d like to replace the compiler with a proven-correct one, but for that, a Bamboo interpreter needs to exist in a theorem prover."
He made a good argument. But these developments make me question whether crypto wont make them popular. This "early future" is kinda amazing.
Agda also added recently support for cubical paths https://agda.readthedocs.io/en/latest/language/cubical.html .
I'm also waiting on Lean https://leanprover.github.io to introduce cubical type theory for HoTT. Version 2 of the language had HoTT based on the univalence axiom which was dropped in version 3. With cubical type theory the univalence axiom can be constructively proved and is no longer an axiom.
https://github.com/noether-lang/noether/tree/master/doc/pres...
Among other interesting features. I recommend reading old one then new one.
Plus, I thought you'd enjoy the language presentation as extra benefit.
I do proofs and write small programs in coq regularly. I've spent most of my professional life as a web developer.
As with everything learning to do proofs and learning to use Coq are a matter of time, effort, and access to good documentation and other resources.
2 out of the top 10 committers work for Blockstream (matt works at Chaincode Labs now).
Care to revisit your conspiracy? Or is something wrong with the data?
Garzik, Hearn, Andresen. Gone.
Blockstream's business model depends on selling services to enterprises, that's why they keep attempting to prevent upgrades to the blocksize, to the detriment of high fees and a clogged network.
The paper here is written by a single member employed by Blockstream.
>to the detriment of high fees and a clogged network.
Sigh. It is astonishingly cheap to spend bitcoin right now. In fact, I paid the absolute minimum fee (1000 satoshis, or a handful of cents) the other day.
Yep, that's what happens when demand decreases for a good or service.
Someone put it very well the other day when they said "The only winners in the scaling debate has been alt coins"
What concerns me is that the presented language is not suitable for any practical programming. Even for the most simple smart contracts, the final Simplicity program will be huge and unreadable due to the lack of familiar data structures and constructs. The language resembles me some kind of lambda calculus which is good for theoretical investigation, but not suitable for practical stuff. I am not ready to exchange a language convenience for better provability: it must have both issues addressed at the same time, only then the mix will be right for an end-user.
[1] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017...
When a suitably rich set of jets is available, we expect the bulk of the
computation specified by a Simplicity program to be made up of these jets,
with only a few combinators used to combine the various jets. This should
bring the computational requirements needed for Simplicity programs in line
with existing blockchain languages. In light of this, one could consider Simplicity
to be a family of languages, where each language is defined by a set of jets that
provide computational elements tailored for its particular application.For two reasons:
1) A smart contract can not be changed in a BC after deployment, so it has to be correct up-front (I am not sure if this fact is obvious for readers, so I decided to add it).
2) A compiler is able to deduce only a limited set of properties. Actually, the less expressive language you have, the more properties you can deduce at compile-time.
The proposed language have chosen to be less expressive to get a higher degree of decidability. But, in my opinion, it goes to the extreme where it becomes no longer useful. The real thing would be to find the right intersection of decidability and expressiveness.
Yeah, this "language" is really not going to be useful anywhere. A big company raising many millions of dollars should have tested their academic ideas in the field before releasing sth like this. I'd be far more impressed by some actual use cases.
1) Have Simplicity running on the blockchain
2) Have dumb old JS running on the blockchain, and transpile Simplicity (or anything else) to it using formally verified tools
I think (2) is better in every way. It lets everyone choose their own tradeoff of safety vs convenience, and leaves the door open for future advances in verification instead of locking in Simplicity forever.
I'm curious if there is an interpreter written in Gallina that implements the semantics? Maybe with a simulation proof (or similar)? It would be pretty sweet to have a verified interpreter.
Also, found this in the corresponding blog post while search for the Coq source.
> It is Turing incomplete, disallowing unbounded loops and allowing for static analysis
It's definitely possible (and not so hard depending) to do proofs and static analysis of looping programs provided the specification can be encoded as an invariant. To be fair I'm not sure what the implications of non-terminating programs are in this setting and with respect to a specification.
Note that you can do things like unroll a loop entirely and build a Merkle tree of the possible unrolled versions, just revealing at redemption time the one actually used.
Assuming you only want the core language, the semantics is an interpreter -- available in Appendix A.
UPDATE: found it thank you.
Simplicity is explicitly not Turing-complete: it is not possible to write a Simplicity program that loops forever. In other words, Simplicity is a total functional programming language: every Simplicity program will finish computing in a finite number of steps.
See Turner 2004 for a great introduction to total functional programming: https://github.com/mietek/total-functional-programming/blob/...
Totality is also important in the context of theorem-proving: if we're interested in treating programs as proofs, and types as propositions, then the type system of our language must correspond to a consistent logic. Otherwise, if we could write a program that loops forever, we could prove any proposition, and so our logic would be inconsistent. Languages such as Agda, Coq, and Idris are total, and writing programs in them is constructive theorem-proving.
Wadler 2015 places the above principle in a fascinating historical context: http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-...
[1]: Some argue that Turing-completeness is not a property of languages, but rather of their runtime semantics. McBride 2015 has more details: https://pdfs.semanticscholar.org/e291/5b546b9039a8cf8f28e0b8...
An invariant that is true of all loop iterations is true of all loop iterations even if the loop diverges. Again, I'm not sure what the implications are for divergence in this setting but it doesn't prevent one from proving loop invariants.
Question: speaking in Haskell-terms, is this Simplicity Core language similar to GHC Core in that it’s a typed intermediate language (not intended to be written by programmers)?
Would be nice to see a higher-level language that compiles to, first, Simplicity Core and then Bitcoin script — including example contracts implemented in that language (ie. the various contracts used for Lighting Network).
> Maintain Bitcoin’s design of self-contained transactions whereby programs do not have access to any information outside the transaction.
This drastically changes the use cases, and may keep both chains complimentary.
I don't agree. It is possible to keep the interaction pure without any practical loss of functionality-- a transaction still has access to its own casual state, in particular using a technique we call covenants (which is mentioned in the paper).
This kind of controlled state management avoids the destruction of scalablity (no caching, no parallelism, no out of order processing, no skipping activity when overloaded) that we've seen in other systems.
Using covenants Russel was, in earlier work, able to implement "Vaults"-- a kind of useful smart contract some have described as impossible in Bitcoin-- in the elements implementation of Bitcoin Script (it uses opcodes that are currently disabled in Bitcoin) with no changes to any of the system's state management. Part of the overall intent with Simplicity is to make this kind of approach efficient and accessible.
And page 4: "As such, we expect it to be a target for other, higher-level, languages to be complied to."
[ed: you almost certainly will not achieve a net benefit from paying a subscription to an orthographic linter.]
____________________
In practice one always exists, just not explicitly, and instead implementations will randomly fail or disagree with each other where you exceed their hidden limits... limits which might arise out of their construction implicitly (and depend on the user's configuration) and not even be known to the program authors.
Of course, if you are actually parsing BER in a smart contract, you should really reconsider what life choices brought you to this point :) But it might be useful for a non-blockchain related crypto library.
https://www.reddit.com/r/Bitcoin/comments/79ohjw/bitcoindev_...
EDIT: Why do you say that?