user2656: 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

user6196: Check here please:
https://cardano.stackexchange.com/a/8808/6196
I answered a similar question in a different post

2656: <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>
 6196: <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>
