0

I am currently learning about wallet sending and now I have a question. One mnemonic corresponds to many addresses, and one address has many utxo

wallet: address1(baseaddr), address2(asset1)

What I restore by mnemonic is address1, but I want to send asset1

https://github.com/bloxbean/cardano-client-lib/issues/106

0

1 Answer 1

1

The address is an encoding of a hash of a public key. Different address means different public key, means different private key. A transaction such as Transaction 9f56ebbf115dc4a5d0370117b164800a74033b9e84b4fd0cefdd65cdbf5e7582 - Cardanoscan, which takes inputs from different addresses has to be signed by multiple private keys for all of the input addresses.

Wallet apps do that automatically. They can derive the private keys by the process described, e.g., in Address Derivation – Cardano Wallet. It doesn’t matter if the addresses are staked or not (“enterprise”) for this.

If that can be done with this (quite strange) Java API, I don’t know. It seems their transaction builder assumes that there is only one “sender” for each transaction.

In that issue, you mention that the proposed solution with selecting another index in the Account constructor did not work.

Did you choose the index for the address, where the asset resides? It’s the last component of the m/1852’/… derivation path shown to you by Eternl.

According to this, I solve it.

DerivationPath build = DerivationPath.builder() .purpose(new Segment(1852, true)) .coinType(new Segment(1815, true)) .account(new Segment(0, true)) .role(new Segment(1, false)) .index(new Segment(2, false)) .build();

Not only need to modify (index), but also need to modify (role)

address: m/1852’/1815’/0’/1/2

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.