Is there a tool like Ethereum EVM at present for Bitcoin script?

Is there a tool like Ethereum EVM at present for Bitcoin script?
2021-08-24  7:36 ` Gijs van Dam
  
From: Null Null @ 2021-08-24  3:39 UTC (permalink / raw)
  To: bitcoin-dev

Hi all,

Is there a tool like Ethereum EVM at present? Users can write bitcoin scripts in a syntax just like python(or like other programming language); through this tool, they can be translated into bitcoin original scripts; it sounds like a new programming language has been invented.

In my opinion， Bitcoin script programming is based on reverse Polish expression; this is not friendly to programmers;

In fact, Bitcoin's opcode expression ability is very rich, and it may be unfriendly, which has affected the promotion of Bitcoin in the technical community.

Hope for hearing some voice about this.

Best wish.



 permalink raw reply	[|nested]
2021-08-24  3:39 [bitcoin-dev] Is there a tool like Ethereum EVM at present for Bitcoin script? Null Null

  2021-08-24 13:08   ` Andrew Poelstra
  2021-08-26  2:43   ` Null Null
  
From: Gijs van Dam @ 2021-08-24  7:36 UTC (permalink / raw)
  To: Bitcoin Protocol Discussion

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

Hi,


Bitcoin does not have a virtual machine. But you do have [Miniscript][1],
[Min.sc][2], [Simplicity][3] and [Sapio][4]. These are all higher level
languages that compile to Bitcoin Script. Sapio is "just" Rust, so that
might fit your setting best.

By the way, this question also has an answer on [Bitcoin Stackexchange][5]
which is a great resource for questions like this.

[1]: http://bitcoin.sipa.be/miniscript/
[2]: https://min.sc/
[3]: https://github.com/ElementsProject/simplicity
[4]: https://learn.sapio-lang.org/
[5]:
https://bitcoin.stackexchange.com/questions/108261/is-there-a-tool-like-ethereum-evm-at-present-for-bitcoin-script

On Tue, Aug 24, 2021 at 2:55 PM Null Null via bitcoin-dev <
bitcoin-dev@lists•linuxfoundation.org> wrote:

> Hi all,
>
> Is there a tool like Ethereum EVM at present? Users can write bitcoin
> scripts in a syntax just like python(or like other programming language);
> through this tool, they can be translated into bitcoin original scripts; it
> sounds like a new programming language has been invented.
>
> In my opinion， Bitcoin script programming is based on reverse Polish
> expression; this is not friendly to programmers;
>
> In fact, Bitcoin's opcode expression ability is very rich, and it may be
> unfriendly, which has affected the promotion of Bitcoin in the technical
> community.
>
> Hope for hearing some voice about this.
>
> Best wish.
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

[-- Attachment #2: Type: text/html, Size: 2660 bytes --]

 permalink raw reply	[|nested]
2021-08-24  7:36 ` Gijs van Dam

  2021-08-26  8:12     ` Oleg Andreev
  2021-08-26 10:26     ` Jeremy
  2021-08-26  2:43   ` Null Null
  
From: Andrew Poelstra @ 2021-08-24 13:08 UTC (permalink / raw)
  To: Gijs van Dam, Bitcoin Protocol Discussion


Simplicity does not compile to Bitcoin Script, and Sapio assumes extensions
to Bitcoin Script that are not currently part of the consensus code.


On Tue, Aug 24, 2021 at 03:36:29PM +0800, Gijs van Dam via bitcoin-dev wrote:
> Hi,
> 
> 
> Bitcoin does not have a virtual machine. But you do have [Miniscript][1],
> [Min.sc][2], [Simplicity][3] and [Sapio][4]. These are all higher level
> languages that compile to Bitcoin Script. Sapio is "just" Rust, so that
> might fit your setting best.
> 
> By the way, this question also has an answer on [Bitcoin Stackexchange][5]
> which is a great resource for questions like this.
> 
> [1]: http://bitcoin.sipa.be/miniscript/
> [2]: https://min.sc/
> [3]: https://github.com/ElementsProject/simplicity
> [4]: https://learn.sapio-lang.org/
> [5]:
> https://bitcoin.stackexchange.com/questions/108261/is-there-a-tool-like-ethereum-evm-at-present-for-bitcoin-script
> 
> On Tue, Aug 24, 2021 at 2:55 PM Null Null via bitcoin-dev <
> bitcoin-dev@lists•linuxfoundation.org> wrote:
> 
> > Hi all,
> >
> > Is there a tool like Ethereum EVM at present? Users can write bitcoin
> > scripts in a syntax just like python(or like other programming language);
> > through this tool, they can be translated into bitcoin original scripts; it
> > sounds like a new programming language has been invented.
> >
> > In my opinion， Bitcoin script programming is based on reverse Polish
> > expression; this is not friendly to programmers;
> >
> > In fact, Bitcoin's opcode expression ability is very rich, and it may be
> > unfriendly, which has affected the promotion of Bitcoin in the technical
> > community.
> >
> > Hope for hearing some voice about this.
> >
> > Best wish.
> >
> > _______________________________________________
> > bitcoin-dev mailing list
> > bitcoin-dev@lists•linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> >

> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev


-- 
Andrew Poelstra
Director of Research, Blockstream
Email: apoelstra at wpsoftware.net
Web:   https://www.wpsoftware.net/andrew

The sun is always shining in space
    -Justin Lewis-Webster



 permalink raw reply	[|nested]
2021-08-24  7:36 ` Gijs van Dam
  2021-08-24 13:08   ` Andrew Poelstra

  
From: Null Null @ 2021-08-26  2:43 UTC ( / )
  To: Gijs van Dam, Bitcoin Protocol Discussion

thanks for you suggestion, Gijs.

I spent some time learning miniscript, and there are some problems that need to confirm for me:

1. Is miniscript a brand new Bitcoin scripting language?
2. If I use miniscript, do I need to compile it into a Bitcoin OP_CODE script? If so, how to do that ? has someone written a compiler? 
I found that @sipa has open sourced a compiler implemented in C++ on github( https://github.com/sipa/miniscript ). This should translate the policy language into miniscript;

> 2021年8月24日 下午3:36，Gijs van Dam via bitcoin-dev <bitcoin-dev@lists•linuxfoundation.org> 写道：
> 
> Hi,
> 
> 
> Bitcoin does not have a virtual machine. But you do have [Miniscript][1], [Min.sc][2], [Simplicity][3] and [Sapio][4]. These are all higher level languages that compile to Bitcoin Script. Sapio is "just" Rust, so that might fit your setting best.
> 
> By the way, this question also has an answer on [Bitcoin Stackexchange][5] which is a great resource for questions like this.
> 
> [1]: http://bitcoin.sipa.be/miniscript/
> [2]: https://min.sc/
> [3]: https://github.com/ElementsProject/simplicity
> [4]: https://learn.sapio-lang.org/
> [5]: https://bitcoin.stackexchange.com/questions/108261/is-there-a-tool-like-ethereum-evm-at-present-for-bitcoin-script
> 
> On Tue, Aug 24, 2021 at 2:55 PM Null Null via bitcoin-dev <bitcoin-dev@lists•linuxfoundation.org> wrote:
> Hi all,
> 
> Is there a tool like Ethereum EVM at present? Users can write bitcoin scripts in a syntax just like python(or like other programming language); through this tool, they can be translated into bitcoin original scripts; it sounds like a new programming language has been invented.
> 
> In my opinion， Bitcoin script programming is based on reverse Polish expression; this is not friendly to programmers;
> 
> In fact, Bitcoin's opcode expression ability is very rich, and it may be unfriendly, which has affected the promotion of Bitcoin in the technical community.
> 
> Hope for hearing some voice about this.
> 
> Best wish.
> 
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
2021-08-24 13:08   ` Andrew Poelstra

  2021-08-26 10:26     ` Jeremy
  
From: Oleg Andreev @ 2021-08-26  8:12 UTC (permalink / raw)
  To: Bitcoin Protocol Discussion

It is worth checking out Ivy lang Playground by Dan Robinson, but AFAIK, it's not actively maintained. It compiles contracts to Bitcoin Script: https://www.ivylang.org/bitcoin

> On 24. Aug 2021, at 16:08, Andrew Poelstra via bitcoin-dev <bitcoin-dev@lists•linuxfoundation.org> wrote:
> 
> 
> Simplicity does not compile to Bitcoin Script, and Sapio assumes extensions
> to Bitcoin Script that are not currently part of the consensus code.
> 
> 
> On Tue, Aug 24, 2021 at 03:36:29PM +0800, Gijs van Dam via bitcoin-dev wrote:
>> Hi,
>> 
>> 
>> Bitcoin does not have a virtual machine. But you do have [Miniscript][1],
>> [Min.sc][2], [Simplicity][3] and [Sapio][4]. These are all higher level
>> languages that compile to Bitcoin Script. Sapio is "just" Rust, so that
>> might fit your setting best.
>> 
>> By the way, this question also has an answer on [Bitcoin Stackexchange][5]
>> which is a great resource for questions like this.
>> 
>> [1]: http://bitcoin.sipa.be/miniscript/
>> [2]: https://min.sc/
>> [3]: https://github.com/ElementsProject/simplicity
>> [4]: https://learn.sapio-lang.org/
>> [5]:
>> https://bitcoin.stackexchange.com/questions/108261/is-there-a-tool-like-ethereum-evm-at-present-for-bitcoin-script
>> 
>> On Tue, Aug 24, 2021 at 2:55 PM Null Null via bitcoin-dev <
>> bitcoin-dev@lists•linuxfoundation.org> wrote:
>> 
>>> Hi all,
>>> 
>>> Is there a tool like Ethereum EVM at present? Users can write bitcoin
>>> scripts in a syntax just like python(or like other programming language);
>>> through this tool, they can be translated into bitcoin original scripts; it
>>> sounds like a new programming language has been invented.
>>> 
>>> In my opinion， Bitcoin script programming is based on reverse Polish
>>> expression; this is not friendly to programmers;
>>> 
>>> In fact, Bitcoin's opcode expression ability is very rich, and it may be
>>> unfriendly, which has affected the promotion of Bitcoin in the technical
>>> community.
>>> 
>>> Hope for hearing some voice about this.
>>> 
>>> Best wish.
>>> 
>>> _______________________________________________
>>> bitcoin-dev mailing list
>>> bitcoin-dev@lists•linuxfoundation.org
>>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>> 
> 
>> _______________________________________________
>> bitcoin-dev mailing list
>> bitcoin-dev@lists•linuxfoundation.org
>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> 
> 
> -- 
> Andrew Poelstra
> Director of Research, Blockstream
> Email: apoelstra at wpsoftware.net
> Web:   https://www.wpsoftware.net/andrew
> 
> The sun is always shining in space
>    -Justin Lewis-Webster
> 
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev



 permalink raw reply	[|nested]
2021-08-24 13:08   ` Andrew Poelstra
  2021-08-26  8:12     ` Oleg Andreev

  
From: Jeremy @ 2021-08-26 10:26 UTC (permalink / raw)
  To: Andrew Poelstra, Bitcoin Protocol Discussion

[-- Attachment #1: Type: text/plain, Size: 3388 bytes --]

This has actually never been true (Sapio assumes extensions).

If the extensions are not present, you can stub them out with a signing
federation instead, configurable as flags, and you can also write many
contracts that do not use the ctv based components at all.

The protocol for emulation is a bit clever (if I do say so myself) since it
ensures that contract compilation is completely offline and the oracles are
completely stateless.

Relevant links:

https://learn.sapio-lang.org/ch05-01-ctv-emulator.html
https://learn.sapio-lang.org/ch03-02-finish.html

Cheers,

Jeremy

On Tue, Aug 24, 2021, 6:19 AM Andrew Poelstra via bitcoin-dev <
bitcoin-dev@lists•linuxfoundation.org> wrote:

>
> Simplicity does not compile to Bitcoin Script, and Sapio assumes extensions
> to Bitcoin Script that are not currently part of the consensus code.
>
>
> On Tue, Aug 24, 2021 at 03:36:29PM +0800, Gijs van Dam via bitcoin-dev
> wrote:
> > Hi,
> >
> >
> > Bitcoin does not have a virtual machine. But you do have [Miniscript][1],
> > [Min.sc][2], [Simplicity][3] and [Sapio][4]. These are all higher level
> > languages that compile to Bitcoin Script. Sapio is "just" Rust, so that
> > might fit your setting best.
> >
> > By the way, this question also has an answer on [Bitcoin
> Stackexchange][5]
> > which is a great resource for questions like this.
> >
> > [1]: http://bitcoin.sipa.be/miniscript/
> > [2]: https://min.sc/
> > [3]: https://github.com/ElementsProject/simplicity
> > [4]: https://learn.sapio-lang.org/
> > [5]:
> >
> https://bitcoin.stackexchange.com/questions/108261/is-there-a-tool-like-ethereum-evm-at-present-for-bitcoin-script
> >
> > On Tue, Aug 24, 2021 at 2:55 PM Null Null via bitcoin-dev <
> > bitcoin-dev@lists•linuxfoundation.org> wrote:
> >
> > > Hi all,
> > >
> > > Is there a tool like Ethereum EVM at present? Users can write bitcoin
> > > scripts in a syntax just like python(or like other programming
> language);
> > > through this tool, they can be translated into bitcoin original
> scripts; it
> > > sounds like a new programming language has been invented.
> > >
> > > In my opinion， Bitcoin script programming is based on reverse Polish
> > > expression; this is not friendly to programmers;
> > >
> > > In fact, Bitcoin's opcode expression ability is very rich, and it may
> be
> > > unfriendly, which has affected the promotion of Bitcoin in the
> technical
> > > community.
> > >
> > > Hope for hearing some voice about this.
> > >
> > > Best wish.
> > >
> > > _______________________________________________
> > > bitcoin-dev mailing list
> > > bitcoin-dev@lists•linuxfoundation.org
> > > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> > >
>
> > _______________________________________________
> > bitcoin-dev mailing list
> > bitcoin-dev@lists•linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>
> --
> Andrew Poelstra
> Director of Research, Blockstream
> Email: apoelstra at wpsoftware.net
> Web:   https://www.wpsoftware.net/andrew
>
> The sun is always shining in space
>     -Justin Lewis-Webster
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

[-- Attachment #2: Type: text/html, Size: 5904 bytes --]

 permalink raw reply	[|nested]
2021-08-26 20:03 ` Jeremy
  
From: Michael Folkson @ 2021-08-26 13:09 UTC (permalink / raw)
  To: Jeremy, Bitcoin Protocol Discussion

The "No Taproot" section of the Sapio docs need updating :) What are
your plans to take advantage of Taproot with Sapio? It would have been
interesting to see what a Taproot emulator would have looked like,
although no need for it now. It seems to me Taproot would have been
harder to emulate than CTV though I could be wrong.

https://learn.sapio-lang.org/ch05-02-taproot.html

Also there have been a number of people asking questions about Sapio
and CTV on the Libera equivalents of Freenode channels #sapio and
##ctv-bip-review over the past months. Do you plan to join and claim
those channels?

Date: Thu, 26 Aug 2021 03:26:23 -0700
From: Jeremy <jlrubin@mit•edu>
To: Andrew Poelstra <apoelstra@wpsoftware•net>, Bitcoin Protocol
        Discussion <bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Is there a tool like Ethereum EVM at
        present for Bitcoin script?
Message-ID:
        <CAD5xwhgmAepA4jW3tK7nihMFsMEdgs0Z6UEs3k=3J1soDea0QQ@mail•gmail.com>
Content-Type: text/plain; charset="utf-8"

This has actually never been true (Sapio assumes extensions).

If the extensions are not present, you can stub them out with a signing
federation instead, configurable as flags, and you can also write many
contracts that do not use the ctv based components at all.

The protocol for emulation is a bit clever (if I do say so myself) since it
ensures that contract compilation is completely offline and the oracles are
completely stateless.

Relevant links:

https://learn.sapio-lang.org/ch05-01-ctv-emulator.html
https://learn.sapio-lang.org/ch03-02-finish.html

Cheers,

Jeremy

-- 
Michael Folkson
Email: michaelfolkson@gmail•com
Keybase: michaelfolkson
PGP: 43ED C999 9F85 1D40 EAF4 9835 92D6 0159 214C FEE3


 permalink raw reply	[|nested]
2021-08-26 13:09 Michael Folkson

  
From: Jeremy @ 2021-08-26 20:03 UTC (permalink / raw)
  To: Michael Folkson;  Bitcoin Protocol Discussion

[-- Attachment #1: Type: text/plain, Size: 2338 bytes --]

Will update those soon / in November. Sapio needs the rust Bitcoin taproot
ecosystem to mature, as well as a spec for miniscript taproot (altho we can
kinda monkey patch one in without it).

To be honest, I had some technical difficulties with getting Libera to work
and I gave up... But perhaps I can retry getting it to work again. Irc
infra 🤷‍♂️ struggles...


On Thu, Aug 26, 2021, 6:10 AM Michael Folkson <michaelfolkson@gmail•com>
wrote:

> The "No Taproot" section of the Sapio docs need updating :) What are
> your plans to take advantage of Taproot with Sapio? It would have been
> interesting to see what a Taproot emulator would have looked like,
> although no need for it now. It seems to me Taproot would have been
> harder to emulate than CTV though I could be wrong.
>
> https://learn.sapio-lang.org/ch05-02-taproot.html
>
> Also there have been a number of people asking questions about Sapio
> and CTV on the Libera equivalents of Freenode channels #sapio and
> ##ctv-bip-review over the past months. Do you plan to join and claim
> those channels?
>
> Date: Thu, 26 Aug 2021 03:26:23 -0700
> From: Jeremy <jlrubin@mit•edu>
> To: Andrew Poelstra <apoelstra@wpsoftware•net>, Bitcoin Protocol
>         Discussion <bitcoin-dev@lists•linuxfoundation.org>
> Subject: Re: [bitcoin-dev] Is there a tool like Ethereum EVM at
>         present for Bitcoin script?
> Message-ID:
>         <CAD5xwhgmAepA4jW3tK7nihMFsMEdgs0Z6UEs3k=
> 3J1soDea0QQ@mail•gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> This has actually never been true (Sapio assumes extensions).
>
> If the extensions are not present, you can stub them out with a signing
> federation instead, configurable as flags, and you can also write many
> contracts that do not use the ctv based components at all.
>
> The protocol for emulation is a bit clever (if I do say so myself) since it
> ensures that contract compilation is completely offline and the oracles are
> completely stateless.
>
> Relevant links:
>
> https://learn.sapio-lang.org/ch05-01-ctv-emulator.html
> https://learn.sapio-lang.org/ch03-02-finish.html
>
> Cheers,
>
> Jeremy
>
> --
> Michael Folkson
> Email: michaelfolkson@gmail•com
> Keybase: michaelfolkson
> PGP: 43ED C999 9F85 1D40 EAF4 9835 92D6 0159 214C FEE3
>

[-- Attachment #2: Type: text/html, Size: 3580 bytes --]

 permalink raw reply	[|nested]