<p>There is a big different between the language used by the bitcoin blockchain and the one used in ethereum.</p>

<p>Ethereum smart contract programmers usually write their code in a high level language (such as solidity) and then compile it into hard to read bytecode.</p>

<p>Bitcoin script programmers write the code in a language that is not compiled, like if they were writing the bytecode itself (it isn't actually a bytecode though).</p>

<p>So it is logical that you can't decompile a language that was never compiled in the first place.</p>

<p>The thing you can do is look at the hexadecimal representations of bytes in a bitcoin script and check which operation they represent.</p>

<p><a href="https://en.bitcoin.it/wiki/Script#Words" rel="nofollow noreferrer">This page</a> has the list of all the commands and their hex value.</p>

<p><strong>Edit</strong></p>

<p>When you write a script in Bitcoin it is already fully transparent. It <strong>never</strong>  gets compiled, <strong>NEVER</strong>. It is already fully transparent because you <strong>never</strong> compile it. You don't need to decompile it because it was <strong>never</strong> compiled, just like you can't destroy an house that was never built in the first place. </p>

<p>Did I already mention that you don't need to decompile because the code <strong>never gets compiled</strong>?</p>

<p>Because it is really important to understand that it <strong>never gets compiled</strong>. You can just read it as it is.</p>

<p>If you see a <code>0x6a</code> in the code it reads like <code>OP_RETURN</code> as for the link i gave you above. You can read through the whole list of hex charachters in a script and decode it like that. There is nothing more you can do</p>

<p>I hope it will be clear now.</p>

CC BY-SA 3.0
2017-08-23T17:07:12.923Z
`So it is logical that you can't decompile a language that was never compiled in the first place.` Why you think so? It is impossible or impractical?
Denis Leonov
CC BY-SA 3.0
2017-08-23T20:18:05.010Z
@Denis, compiling means converting source code into another, more basic (but less human-readable) code.  For example, converting C++ into x86 instructions.  Ethereum has it's own instruction set, but most people use a higher-level language and a compiler to convert it into the Ethereum instructions.  Bitcoin script is so simple and limited that nobody uses a higher level language.  As such, no compiler exists to convert this non-existent language into Bitcoin script, and no decomplier exists to convert it back.
Jestin
CC BY-SA 3.0
2017-08-24T10:06:03.353Z
@Denis how can you undo something that was never done?? It is not impossible or impratictical, it just never happened.
Ivano Donadi
CC BY-SA 3.0
2017-08-26T00:12:15.950Z
@IvanoDonadi I need full transparency for my tasks
Denis Leonov
CC BY-SA 3.0
2017-08-26T07:14:00.877Z
@Denis you are just not getting it. Read my edit please and try to understand
Ivano Donadi
CC BY-SA 3.0
2017-08-28T01:17:47.173Z
I do not mean only the script, but I mean the structure of full database, all structure dependencies and trees of value flow and so on. The script here is a small part of question.
Denis Leonov
CC BY-SA 3.0
2017-08-28T05:42:17.207Z
The link you posted about the ethereum decompiler is strictly about the script. Please read some basic documentation about bitcoin and the blockchain.
Ivano Donadi
CC BY-SA 3.0
2017-09-03T23:43:59.667Z
@IvanoDonadi thank you very much! •sarcasm•
Denis Leonov
CC BY-SA 3.0
2017-09-04T11:35:32.800Z
I suggest that before using your wonderful sarcasm you read the wikipedia definition for decompiler:  **A decompiler is a computer program that takes an executable file as input, and attempts to create a high level source file which can be recompiled successfully. It is therefore the opposite of a compiler, which takes a source file and makes an executable.** and then read the article you posted as reference. **A decompiler is used on the code**
Ivano Donadi
CC BY-SA 3.0
2017-09-05T08:38:24.197Z
@IvanoDonadi I think there is language barier. I mean not fully what you answer me. But i accept your answer, thank you for help!
Denis Leonov
CC BY-SA 3.0
2017-08-23T11:20:27.060Z
2017-08-26T07:10:52.187Z
2017-08-26T07:10:52.187Z
Ivano Donadi
<p>Is there any tool for Bitcoin blockchain decompiling?</p>

<p>I see news about <a href="https://www.coindesk.com/first-ethereum-decompiler-launches-jp-morgan-quorum-integration/" rel="nofollow noreferrer">Ethereum Decompiler</a>, but is something like for Bitcoin?</p>

CC BY-SA 4.0
2019-02-26T00:02:29.923Z
If you got here like me looking for something to translate a script back into human readable tokens (more of a "disassembler" for the pedantic crowd), check out https://bitcoin.stackexchange.com/questions/42576/online-bitcoin-script-simulator-or-debugger , especially https://github.com/kallewoof/btcdeb .
jhfrontz
<blockchain><bitcoin-core><bitcoin-core-development>
Bitcoin decompiler
Denis Leonov
# Bitcoin decompiler

(Asked by: username_0 on 2017-08-23)

Is there any tool for Bitcoin blockchain decompiling?

I see news about [Ethereum Decompiler](https://www.coindesk.com/first-ethereum-decompiler-launches-jp-morgan-quorum-integration/), but is something like for Bitcoin?

**Tags:** blockchain, bitcoin-core, bitcoin-core-development

> **Comments:**
> **username_1**: If you got here like me looking for something to translate a script back into human readable tokens (more of a "disassembler" for the pedantic crowd), check out https://bitcoin.stackexchange.com/questions/42576/online-bitcoin-script-simulator-or-debugger , especially https://github.com/kallewoof/btcdeb .  

---

## 1 answers

### Answer by username_2 on 2017-08-23. Score: 1 | Accepted answer

There is a big different between the language used by the bitcoin blockchain and the one used in ethereum.

Ethereum smart contract programmers usually write their code in a high level language (such as solidity) and then compile it into hard to read bytecode.

Bitcoin script programmers write the code in a language that is not compiled, like if they were writing the bytecode itself (it isn't actually a bytecode though).

So it is logical that you can't decompile a language that was never compiled in the first place.

The thing you can do is look at the hexadecimal representations of bytes in a bitcoin script and check which operation they represent.

[This page](https://en.bitcoin.it/wiki/Script#Words) has the list of all the commands and their hex value.

**Edit**

When you write a script in Bitcoin it is already fully transparent. It **never** gets compiled, **NEVER**. It is already fully transparent because you **never** compile it. You don't need to decompile it because it was **never** compiled, just like you can't destroy an house that was never built in the first place.

Did I already mention that you don't need to decompile because the code **never gets compiled**?

Because it is really important to understand that it **never gets compiled**. You can just read it as it is.

If you see a `0x6a` in the code it reads like `OP_RETURN` as for the link i gave you above. You can read through the whole list of hex charachters in a script and decode it like that. There is nothing more you can do

I hope it will be clear now.

> **Comments:**
> **username_0**: `So it is logical that you can't decompile a language that was never compiled in the first place.` Why you think so? It is impossible or impractical?  
> **username_3**: @username_0, compiling means converting source code into another, more basic (but less human-readable) code.  For example, converting C++ into x86 instructions.  Ethereum has it's own instruction set, but most people use a higher-level language and a compiler to convert it into the Ethereum instructions.  Bitcoin script is so simple and limited that nobody uses a higher level language.  As such, no compiler exists to convert this non-existent language into Bitcoin script, and no decomplier exists to convert it back.  
> **username_2**: @username_0 how can you undo something that was never done?? It is not impossible or impratictical, it just never happened.  
> **username_0**: @username_2 I need full transparency for my tasks  
> **username_2**: @username_0 you are just not getting it. Read my edit please and try to understand  
> **username_0**: I do not mean only the script, but I mean the structure of full database, all structure dependencies and trees of value flow and so on. The script here is a small part of question.  
> **username_2**: The link you posted about the ethereum decompiler is strictly about the script. Please read some basic documentation about bitcoin and the blockchain.  
> **username_0**: @username_2 thank you very much! •sarcasm•  
> **username_2**: I suggest that before using your wonderful sarcasm you read the wikipedia definition for decompiler:  **A decompiler is a computer program that takes an executable file as input, and attempts to create a high level source file which can be recompiled successfully. It is therefore the opposite of a compiler, which takes a source file and makes an executable.** and then read the article you posted as reference. **A decompiler is used on the code**  
> **username_0**: @username_2 I think there is language barier. I mean not fully what you answer me. But i accept your answer, thank you for help!  

---

