<p>There's multiple ways to do it. For example using cardano-addresses or Pycardano library</p>
<p>Pycardano:</p>
<pre><code>script_cbor_hex = '...'
script = cbor2.loads(bytes.fromhex(script_cbor_hex))
script_hash = plutus_script_hash(script)
script_address = Address(script_hash)
</code></pre>

CC BY-SA 4.0
2022-06-11T10:43:57.647Z
2022-06-11T10:43:57.647Z
et97
<p>for those looking to use ```cardano-cli``</p>
<pre><code>cardano-cli address build --$testnet --payment-script-file path/to/serialized-smartContract.plutus.json
</code></pre>

CC BY-SA 4.0
2022-06-14T21:21:16.353Z
2022-06-14T21:21:16.353Z
Michele Nuzzi
<p>Once I have written up the smart contract how to I get the script address value to be able to interact with the script whilst its on chain?</p>

<cardano-serialization-lib><on-chain><smart-contract><script-addresses>
How to Get the Script Address of A Smart Contract?
# How to Get the Script Address of A Smart Contract?

(Asked by: username_0 on 2022-06-10)

Once I have written up the smart contract how to I get the script address value to be able to interact with the script whilst its on chain?

**Tags:** cardano-serialization-lib, on-chain, smart-contract, script-addresses

---

## 2 answers

### Answer by username_1 on 2022-06-11. Score: 1 | Accepted answer

There's multiple ways to do it. For example using cardano-addresses or Pycardano library
Pycardano:
script_cbor_hex = '...'
script = cbor2.loads(bytes.fromhex(script_cbor_hex))
script_hash = plutus_script_hash(script)
script_address = Address(script_hash)


---

### Answer by username_2 on 2022-06-14. Score: 1

for those looking to use ```cardano-cli``
cardano-cli address build --$testnet --payment-script-file path/to/serialized-smartContract.plutus.json


---

