<p>Check here please:</p>
<p><a href="https://cardano.stackexchange.com/a/8808/6196">https://cardano.stackexchange.com/a/8808/6196</a></p>
<p>I answered a similar question in a different post</p>

CC BY-SA 4.0
2022-08-05T02:11:35.033Z
2022-08-05T02:11:35.033Z
D S
<p>So in Plutus we have the <code>Address</code> type which has two constructors <code>ScriptCredential</code> which is a <code>ValidatorHash</code> or <code>PubKeyCredential</code> which is a <code>PubKeyHash</code> but all these are not encoded in the same way as addresses on the alonzo testnet or any other real net.</p>
<p>I'm using the script <code>Alwayssucceed</code> from the <code>Alonzo-testnet</code> repo.</p>
<p>When we compile it to <code>.plutus</code> and build its address in cli we get <code>addr_test1wpnlxv2xv9a9ucvnvzqakwepzl9ltx7jzgm53av2e9ncv4sysemm8</code></p>
<p>But in Plutus if we display its Address we get a totally different output. This is what I tried because Cardano addresses are encoded in bech32.</p>
<pre><code>import Data.ByteString.Base16 as B16
import Codec.Binary.Bech32 as B32

valhash :: Maybe Plutus.ValidatorHash
valhash = toValidatorHash $ scriptAddress validator

transform :: IO ()
transform = let Right prefix = humanReadablePartFromText &quot;addr_test1&quot; in
  case valhash of
    Nothing -&gt; print @String &quot;Nothing&quot;
    Just vhash -&gt; case vhash of
      Plutus.ValidatorHash vhashbs -&gt; print $ B32.encode prefix (dataPartFromBytes $ fromBuiltin vhashbs)
</code></pre>
<p>Output : <code>addr_test11xpnaff4z2xn3szgf8z6a2txju6dnsmsar22h2fnmvf7hyx8lpvw</code></p>
<p>Someone suggested here that in Plutus these Addresses are encoded in Base16, but <code>B16.decode $ fromBuiltin vhashbs</code> returns that it isn't a Base16 encoded bytestring.</p>
<p>My question is, is there a way to convert Plutus addresses to real Cardano addresses? Or will they understand each other when off-chain support (PAB) comes to real blockchains?</p>
<p>Thanks</p>

CC BY-SA 4.0
2021-11-04T19:18:23.907Z
Have you managed to solve this?
martin
CC BY-SA 4.0
2021-11-18T14:18:39.323Z
I think the question does not make much sense actually, we can convert from .plutus to bech32 and that's enough, I think when you convert to `Address` you put it in the format for the Emulator, it is not linked to real net, but honestly I don't know. Currently I'm looking at how to get the right ValidatorHash from the validator, still no clue. This conversion process is very unclear (what format does plutus understand, what format is to be passed on the blockchain...)
Alain Magazin
<plutus><address><cardano-address><script><script-addresses>
Convert Plutus Address Credential to real-net address
# Convert Plutus Address Credential to real-net address

(Asked by: username_0 on 2021-08-30)

So in Plutus we have the Address type which has two constructors ScriptCredential which is a ValidatorHash or PubKeyCredential which is a PubKeyHash but all these are not encoded in the same way as addresses on the alonzo testnet or any other real net.
I'm using the script Alwayssucceed from the Alonzo-testnet repo.
When we compile it to .plutus and build its address in cli we get addr_test1wpnlxv2xv9a9ucvnvzqakwepzl9ltx7jzgm53av2e9ncv4sysemm8
But in Plutus if we display its Address we get a totally different output. This is what I tried because Cardano addresses are encoded in bech32.
import Data.ByteString.Base16 as B16
import Codec.Binary.Bech32 as B32

valhash :: Maybe Plutus.ValidatorHash
valhash = toValidatorHash $ scriptAddress validator

transform :: IO ()
transform = let Right prefix = humanReadablePartFromText "addr_test1" in
  case valhash of
    Nothing -> print @String "Nothing"
    Just vhash -> case vhash of
      Plutus.ValidatorHash vhashbs -> print $ B32.encode prefix (dataPartFromBytes $ fromBuiltin vhashbs)

Output : addr_test11xpnaff4z2xn3szgf8z6a2txju6dnsmsar22h2fnmvf7hyx8lpvw
Someone suggested here that in Plutus these Addresses are encoded in Base16, but B16.decode $ fromBuiltin vhashbs returns that it isn't a Base16 encoded bytestring.
My question is, is there a way to convert Plutus addresses to real Cardano addresses? Or will they understand each other when off-chain support (PAB) comes to real blockchains?
Thanks

**Tags:** plutus, address, cardano-address, script, script-addresses
> **Comments:**
> **username_1**: Have you managed to solve this?  
> **username_0**: I think the question does not make much sense actually, we can convert from .plutus to bech32 and that's enough, I think when you convert to `Address` you put it in the format for the Emulator, it is not linked to real net, but honestly I don't know. Currently I'm looking at how to get the right ValidatorHash from the validator, still no clue. This conversion process is very unclear (what format does plutus understand, what format is to be passed on the blockchain...)  

---

## 1 answers

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

Check here please:

<https://cardano.stackexchange.com/a/8808/6196>

I answered a similar question in a different post


---

