<p>You can't get the Smart contract code starting from its address.</p>
<p>As @zhekson already mentioned, smart contract addresses are hashes of the code (the serialization of the untyped Plutus core to be clear).</p>
<p>Hash functions, that we can call h(x), are studied so that there can't be an h<sup>-1</sup>(x), so given a hash we can't know from which input it was generated via an inverse computation (if that was possible then the whole cryptography thing wouldn't stand).</p>
<p>We can get an input from a hash only if, when creating the hash of the input you store it somewhere and assign to it the generated hash, then we just got a hash-map.</p>
<p>It is possible however to get the Untyped Plutus, program starting from the flat serialized one.</p>

CC BY-SA 4.0
2022-04-08T17:22:42.720Z
2022-04-11T13:33:58.937Z
2022-04-11T13:33:58.937Z
Michele Nuzzi
<p>Firstly, the address you referenced in your question is a Byron address, as pointed out by Samuel. Byron addresses are payment only, and are not associated with scripts (smart contracts) or staking.</p>
<p>Second, even if it was a Shelley-era and/or script address, it is not possible to derive the actual smart contract code from a script address because, as Alicia pointed out, script addresses are hash-derivatives of the underlying code. Hashes are one-way by nature; they cannot be reverted back to their original data.</p>

CC BY-SA 4.0
2022-03-09T03:05:40.927Z
2022-03-09T03:05:40.927Z
zhekson
<p>That's a Byron address, not a plutus script address. Likely being sent to an exchange.</p>

CC BY-SA 4.0
2022-02-07T01:31:24.943Z
This may be factually correct, but doesn't answer the poster's question.
gRebel
CC BY-SA 4.0
2022-02-07T00:59:59.077Z
2022-02-07T00:59:59.077Z
Samuel Leathers
<p>How to find out what scripts / smart contracts are holding my assets and how could I recover these assets if the script allows?</p>
<p>I have in my transactions log a transfer of 500 ADA to this script address:
<code>DdzFFzCqrht3C53JYNZ3uRUGw7KBESCkV9854fK736678CPVPuKD1uVKLeemubBpDe1EWJNjCofKLATPCfKawQ4Pu2M7BZgFSvDVMbiK</code></p>
<p>(<a href="https://cardanoscan.io/address/DdzFFzCqrht3C53JYNZ3uRUGw7KBESCkV9854fK736678CPVPuKD1uVKLeemubBpDe1EWJNjCofKLATPCfKawQ4Pu2M7BZgFSvDVMbiK" rel="nofollow noreferrer">logged here</a>)</p>
<p>But I don't know what script is this and how to recover my balance. Is there a way to know, based on the script address, which contract is this and how could I recover my balance?</p>

CC BY-SA 4.0
2022-02-07T01:57:16.003Z
I think it is not posible, because a script address is a hash of the script, and we can not go back from hash to what generated the hash.
Alicia Basilio
<smart-contract><script><script-addresses>
Discovering the script source based on address
# Discovering the script source based on address

(Asked by: username_0 on 2022-02-07)

How to find out what scripts / smart contracts are holding my assets and how could I recover these assets if the script allows?

I have in my transactions log a transfer of 500 ADA to this script address:
`DdzFFzCqrht3C53JYNZ3uRUGw7KBESCkV9854fK736678CPVPuKD1uVKLeemubBpDe1EWJNjCofKLATPCfKawQ4Pu2M7BZgFSvDVMbiK`

([logged here](https://cardanoscan.io/address/DdzFFzCqrht3C53JYNZ3uRUGw7KBESCkV9854fK736678CPVPuKD1uVKLeemubBpDe1EWJNjCofKLATPCfKawQ4Pu2M7BZgFSvDVMbiK))

But I don't know what script is this and how to recover my balance. Is there a way to know, based on the script address, which contract is this and how could I recover my balance?

**Tags:** smart-contract, script, script-addresses
> **Comments:**
> **username_1**: I think it is not posible, because a script address is a hash of the script, and we can not go back from hash to what generated the hash.  

---

## 3 answers

### Answer by username_2 on 2022-04-08. Score: 2

You can't get the Smart contract code starting from its address.

As @zhekson already mentioned, smart contract addresses are hashes of the code (the serialization of the untyped Plutus core to be clear).

Hash functions, that we can call h(x), are studied so that there can't be an h-1(x), so given a hash we can't know from which input it was generated via an inverse computation (if that was possible then the whole cryptography thing wouldn't stand).

We can get an input from a hash only if, when creating the hash of the input you store it somewhere and assign to it the generated hash, then we just got a hash-map.

It is possible however to get the Untyped Plutus, program starting from the flat serialized one.


---

### Answer by username_3 on 2022-03-09. Score: 1

Firstly, the address you referenced in your question is a Byron address, as pointed out by Samuel. Byron addresses are payment only, and are not associated with scripts (smart contracts) or staking.

Second, even if it was a Shelley-era and/or script address, it is not possible to derive the actual smart contract code from a script address because, as Alicia pointed out, script addresses are hash-derivatives of the underlying code. Hashes are one-way by nature; they cannot be reverted back to their original data.


---

### Answer by username_4 on 2022-02-07. Score: 1

That's a Byron address, not a plutus script address. Likely being sent to an exchange.

> **Comments:**
> **username_5**: This may be factually correct, but doesn't answer the poster's question.  

---

