2

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.

Yihen
  • 31
  • 4
  • I agree with Murch. Would like to add: You don't need EVM for programming languages that helps in easier bitcoin scripting. EVM helps in parallel processing and even that can be achieved without EVM: https://link.medium.com/DKaOm7hxYib –  Aug 24 '21 at 06:07
  • @Prayank sorry sir, Maybe I misled you by using EVM; indeed, what I want to know is whether there is a bitcoin script compiler that allows programmers to write scripts in a high-level language programming mode; this question may be more appropriate; – Yihen Aug 24 '21 at 06:16
  • As Murch says below, check out Miniscript (encoding of Script), Policy or Minsc for a higher level language for writing scripts. Best resource on Miniscript and Policy is http://bitcoin.sipa.be/miniscript/. Best resource on Minsc is https://min.sc/ – Michael Folkson Aug 24 '21 at 08:33
  • @MichaelFolkson AGREE about best resource points. – Yihen Aug 24 '21 at 09:32
  • FYI, EVM is also reverse Polish notation, although there exist compilers from higher-level languages. The same is possible in principle for bitcoin script, although by design, only a very restricted subset of the things that are possible with EVM are possible with bitcoin script. – James_pic Aug 24 '21 at 12:50
  • @MichaelFolkson Thanks for your reply. If I use miniscript, how to compile miniscript to bitcoin OP_CODE script? I don't find a compiler to do this. – Yihen Aug 26 '21 at 02:36
  • The easiest way is to put the Miniscript in the Analyze a Miniscript section of http://bitcoin.sipa.be/miniscript/ and then press the Analyze button. That's useful for learning. But Miniscript is just an encoding of Script there is no compiling between Miniscript and Script. You'd need to use the C++ or Rust encoding/decoding code to convert Miniscript to Script in a software project. Or if you use Policy, that compiles to Miniscript and there is compiler code in the C++ and Rust implementations. – Michael Folkson Aug 26 '21 at 11:08
  • See https://bitcoin.stackexchange.com/questions/91565/what-does-bitcoin-policy-language-offer-the-developer-that-miniscript-doesnt-w for more details – Michael Folkson Aug 26 '21 at 11:08

1 Answers1

3

People creating smart contracts on a cryptocurrency network are designing cryptographic protocols—frankly, it might be a good thing if not every JavaScript programmer takes a go at that. Bitcoin does not have a virtual machine, but there are Miniscript, Minsc, or Sapio as higher level languages that translate to script. Additionally, there is an on-going development effort with Simplicity as a language specifically engineered to express smart contracts with provable outcomes.

And if you insist on EVM, check out RSK.

Murch
  • 75,206
  • 34
  • 186
  • 622
  • 1
    nit: Simplicity isn't a higher level language that translates to Script. It is a low level potential replacement for Script. But the point about not needing to interact with Script directly is what you're getting at. – Michael Folkson Aug 24 '21 at 07:37
  • Thanks, good point, I've updated my answer. – Murch Aug 24 '21 at 18:04