<p>On if it's possible to decode the Plutus code of a given contract, there's a possible duplicate of this question here: <a href="https://cardano.stackexchange.com/questions/6767/can-blockchain-viewers-read-the-source-code-of-a-smart-contract-if-they-know-its">Can blockchain viewers read the source code of a smart contract if they know its address?</a>.</p>
<p>In case that you want to verify that a compiled code sitting in the blockchain is what their creators claim to be (given that it comes from an open-source project), and you know the Plutus version they used and any other parameters needed, you could recompile the code and compare the resulting script hash with the hash on the blockchain, thus verifying the code is the same.</p>
<p>I'm afraid straight reading of source code from the blockchain right now is not possible. We can expect more tools and possibilities on reading contract's source code in the future since we are still in the &quot;early days&quot; of Cardano's smart contracts.</p>

CC BY-SA 4.0
2022-01-25T16:30:59.263Z
thanks for sharing that post, it definitely has helped my understanding. From my understanding of it, I guess it is possible to see the code of a smart contract but you have to convert it from Plutus Core bytecode to some other readable language?
Myles
CC BY-SA 4.0
2022-01-25T16:50:05.857Z
Updated the answer with a small idea on comparing open code with the one on the chain.
joaquimgamero
CC BY-SA 4.0
2022-01-25T16:09:56.847Z
2022-01-25T16:48:16.283Z
2022-01-25T16:48:16.283Z
joaquimgamero
<p>Given a script address, is it possible to decode the Haskell/Plutus code of said script? How can you verify a script does what someone says it will do?</p>

CC BY-SA 4.0
2022-01-25T16:30:00.783Z
Somewhat but not completely I think. From one of the replies, I understand now the Plutus Core bytecode is on-chain, so this means it is possible to get the code of the smart contract if you can convert the bytecode back to Plutus / Haskell or some other language? So it's possible but just kind of hard / tedious?
Myles
CC BY-SA 4.0
2022-01-26T22:40:54.183Z
Better as a comment on the original question/answer than to open a duplicate.  But this question has a better title.
gRebel
<plutus><smart-contract><script-addresses>
Is it possible to decode smart contract code from a script hash?
# Is it possible to decode smart contract code from a script hash?

(Asked by: username_0 on 2022-01-25)

Given a script address, is it possible to decode the Haskell/Plutus code of said script? How can you verify a script does what someone says it will do?

**Tags:** plutus, smart-contract, script-addresses
> **Comments:**
> **username_0**: Somewhat but not completely I think. From one of the replies, I understand now the Plutus Core bytecode is on-chain, so this means it is possible to get the code of the smart contract if you can convert the bytecode back to Plutus / Haskell or some other language? So it's possible but just kind of hard / tedious?  
> **username_1**: Better as a comment on the original question/answer than to open a duplicate.  But this question has a better title.  

---

## 1 answers

### Answer by username_2 on 2022-01-25. Score: 2

On if it's possible to decode the Plutus code of a given contract, there's a possible duplicate of this question here: [Can blockchain viewers read the source code of a smart contract if they know its address?](https://cardano.stackexchange.com/questions/6767/can-blockchain-viewers-read-the-source-code-of-a-smart-contract-if-they-know-its).

In case that you want to verify that a compiled code sitting in the blockchain is what their creators claim to be (given that it comes from an open-source project), and you know the Plutus version they used and any other parameters needed, you could recompile the code and compare the resulting script hash with the hash on the blockchain, thus verifying the code is the same.

I'm afraid straight reading of source code from the blockchain right now is not possible. We can expect more tools and possibilities on reading contract's source code in the future since we are still in the "early days" of Cardano's smart contracts.

> **Comments:**
> **username_0**: thanks for sharing that post, it definitely has helped my understanding. From my understanding of it, I guess it is possible to see the code of a smart contract but you have to convert it from Plutus Core bytecode to some other readable language?  
> **username_2**: Updated the answer with a small idea on comparing open code with the one on the chain.  

---

