0

I've read a lot about mangled/franken addresses recently. A mangled address is an address, where the payment part of the address belongs to a different wallet than the stake part. This is an important thing to consider when building DApps on Cardano.

I'm wondering how it is possible to create such an address.

To create a payment address using the cardano-cli, both the private payment key and the private stake key are required:

cardano-cli address build \
    --payment-verification-key-file payment.vkey \
    --stake-verification-key-file stake.vkey \
    --out-file payment.addr \
    --mainnet

Let's say we have Alice who owns wallet A and Bob who owns wallet B.

Alice doesn't have access to the private keys of Bob, so how can Alice create an address with the payment part of her wallet A and the stake part of Bob's wallet B?

Or the other way around: How can Alice create a mangled address with Bob's payment part of wallet B and her stake part of wallet A?

5
  • 2
    The vkey are just the verification keys not your private (signing) keys which have skey suffixes. So creating a franken address only requires someones else's payment or stake vkey.
    – Will
    Commented Oct 10, 2022 at 12:51
  • You can extract the PubKeyHash of a given address and hence you can also create a franken address combining the payment PKH with your stake PKH.
    – Will
    Commented Oct 10, 2022 at 12:52
  • @William-BerlinPool But to spend the utxos i would still need both skeys, isn't it?
    – wutzebaer
    Commented Jan 25, 2023 at 7:29
  • 2
    @wutzebaer To Spend a UTxO you just need the skey of the payment part of the address. The staking part is not relevant for spending.
    – eddex
    Commented Jan 25, 2023 at 15:05
  • 1
    For spending any UTxO, you either need the payment skey for the address that the UTxO belongs to, if it is a wallet address. In case of it being a script address, then the on-chain validator logic needs to pass in order for the UTxO to be spent. Addresses are made up of one or two parts (payment part & an optional staking part). In order to create any address you'll need the verification key (vkey) of each part. All this is only applicable for shelley addresses. Byron addresses don't follow that structure.
    – Will
    Commented Jan 26, 2023 at 10:47

3 Answers 3

2

Your cardano-cli example is correct - only the verification (public) keys are needed to build addresses, not the private keys. Therefore, we can build shelley addresses with any pair of payment.vkey and stake.vkey, regardless of whether or not they are derived from the same master seed.

"Mangled" in this case just means the payment and stake vkey's are derived from different master seeds.

1

ADA addresses (ignoring the bootstrap address type) consist of two components, like this (from here):

  = Addr Network (PaymentCredential c) (StakeReference c)

If you have two address, from two different wallets, you can create a franken address by taking the PaymentCredential from one address and the StakeReference from the other.

0

I am pretty sure its not possible to create one of these franken addresses with any of the standard tools. However, if you are relatively competent in Haskell its probably not difficult to write a tool to do it.

If you do not write Haskell, it may even be possible to do it with the JS library cardano-serialization-lib (which I have never looked at).

1
  • While a tool would ofc be helpful, the main goal of this question is to understand how it is possible to craft such an address when usually the private keys are required to create addresses.
    – eddex
    Commented Oct 10, 2022 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.