<p>Just tested on testnet, <code>cardano-cli transaction policyid --script-file ...</code> works.</p>
<p>Just make sure in your Haskell code to include something like the following to turn it into an address:</p>
<pre><code>testnetDumpValidatorHash :: ValidatorHash
testnetDumpValidatorHash = &quot;10101010110101010101010101010101010101010101010101123456&quot;
 
testnetDumpAddress :: Ledger.Address
testnetDumpAddress = scriptHashAddress testnetDumpValidatorHash
</code></pre>

CC BY-SA 4.0
2021-11-23T01:50:03.920Z
2021-11-23T01:50:03.920Z
yoyobigmanyo
<p>I'm checking the <code>Value</code> locked by certain <code>ValidatorHash</code> of another script that I deployed. Does anyone know how to get <code>Ledger.Address</code> or <code>ValidatorHash</code> from Plutus or cardano-cli? I know the &quot;address&quot; that is a string that starts with &quot;addr_test1...&quot; but how do I turn that into the above Plutus types?</p>
<p>Sort of like <a href="https://cardano.stackexchange.com/questions/4274/how-to-convert-a-cardano-address-into-a-public-key-hash">this</a> question but for <code>ValidatorHash</code>. I know that you can use <code>cardano-cli transaction policyid</code> for monetary policies, is there an equivalent for <code>ValidatorHash</code>?</p>
<p>Thanks!</p>

CC BY-SA 4.0
2021-11-18T22:16:58.887Z
So you want to go from `address` (addr_test1...) to `Ledger.Address` or `ValidatorHash`?
georgeos
<plutus><smart-contract><testnet><address>
Getting Validator Hash
# Getting Validator Hash

(Asked by: username_0 on 2021-11-17)

I'm checking the `Value` locked by certain `ValidatorHash` of another script that I deployed. Does anyone know how to get `Ledger.Address` or `ValidatorHash` from Plutus or cardano-cli? I know the "address" that is a string that starts with "addr\_test1..." but how do I turn that into the above Plutus types?

Sort of like [this](https://cardano.stackexchange.com/questions/4274/how-to-convert-a-cardano-address-into-a-public-key-hash) question but for `ValidatorHash`. I know that you can use `cardano-cli transaction policyid` for monetary policies, is there an equivalent for `ValidatorHash`?

Thanks!

**Tags:** plutus, smart-contract, testnet, address
> **Comments:**
> **username_1**: So you want to go from `address` (addr_test1...) to `Ledger.Address` or `ValidatorHash`?  

---

## 1 answers

### Answer by username_0 on 2021-11-23. Score: 1 | Accepted answer

Just tested on testnet, cardano-cli transaction policyid --script-file ... works.
Just make sure in your Haskell code to include something like the following to turn it into an address:
testnetDumpValidatorHash :: ValidatorHash
testnetDumpValidatorHash = "10101010110101010101010101010101010101010101010101123456"
 
testnetDumpAddress :: Ledger.Address
testnetDumpAddress = scriptHashAddress testnetDumpValidatorHash


---

