<p>A payment address is just the hash of the payment pubkey (and optionally the stake pubkey if that addresses funds will delegate) with some prefixed bytes that indicate what type of address it is. The payment secret keys can either be randomly generated (such as how <code>cardano-cli address key-gen</code> works), or can be derived from a wallet root private key (which usually has an associated mnemonic to generate the root private key).</p>
<p>If your app doesn't need to use a full wallet, you can generate random bytes, convert that to a pubkey, get the payment key hash and assemble an address.</p>
<p>If your app does use a wallet, you would generate keys under the derivation path: <code>1852H/1815H/0H/0/$i</code> using cardano-addresses, and then the rest of the steps are exactly the same, but using the bytes derived rather than randomly generated.</p>
<p>If you go the random generation route, please ensure you have many backups of every secret key you generate, otherwise if the keys are lost, those funds are completely unspendable!</p>

CC BY-SA 4.0
2022-01-12T11:43:10.717Z
Between this answer and https://github.com/uniVocity/cardano-tutorials/blob/master/cardano-addresses.md#generating-a-payment-address. I get the process from a high level using cardano-address but what happens during the hashing process and can this be easily easily implemented if I have the root pub key and the derivation path?
g0atm1lk
CC BY-SA 4.0
2022-01-17T02:38:39.763Z
You need the account pub key. Any derivations followed by H are hardened and need the private key to derive.
Samuel Leathers
CC BY-SA 4.0
2022-01-11T05:09:06.437Z
2022-01-11T05:09:06.437Z
Samuel Leathers
<p>You could use Blockfrost API to create a new address. Please refer <a href="https://docs.blockfrost.io/#tag/Cardano-Utilities/paths/%7E1utils%7E1addresses%7E1xpub%7E1%7Bxpub%7D%7E1%7Brole%7D%7E1%7Bindex%7D/get" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 4.0
2022-01-12T10:54:30.857Z
Thanks for the reply. That would be perfect if it was implemented in the Java SDK. However it still might be a better alternative than running a node like I was thinking of doing.
g0atm1lk
CC BY-SA 4.0
2022-01-15T06:50:13.770Z
Blockfrost has a Java SDK too https://github.com/blockfrost/blockfrost-java
Marek Mahut - StakeNuts
CC BY-SA 4.0
2022-01-10T18:56:06.307Z
2022-01-10T18:56:06.307Z
Joseph Ku
<p>I am creating a project and would like to be able to give new addresses for each transaction to simplify tracking of payments. I need a method to create a new payment address similar to the below question but in Java.</p>
<p><a href="https://cardano.stackexchange.com/questions/889/how-can-i-generate-new-wallet-address-using-cardano-wallet-cli-and-cardano-walle">How can i generate new wallet address using cardano-wallet cli and cardano wallet api after created my wallet?</a></p>
<p>Currently I am using Blockfrost Api Java SDK and cardano-client-lib but neither are able to create a new payment address from what I can tell.</p>
<p>I would like to avoid needing to run Cardano-cli and JNI (no experience) if possible.</p>

CC BY-SA 4.0
2022-01-23T00:04:44.147Z
@samuelleathers put in time and effort to answer your question.  If you want to keep getting good answers, don't forget to vote an answer up when you accept it. :-)
gRebel
CC BY-SA 4.0
2022-01-23T00:10:56.467Z
A better question might have been, "How can I create a new payment address using the Blockfrost Java API"
gRebel
<address><payment><java><native>
New payment address in Java
# New payment address in Java

(Asked by: username_0 on 2022-01-08)

I am creating a project and would like to be able to give new addresses for each transaction to simplify tracking of payments. I need a method to create a new payment address similar to the below question but in Java.

[How can i generate new wallet address using cardano-wallet cli and cardano wallet api after created my wallet?](https://cardano.stackexchange.com/questions/889/how-can-i-generate-new-wallet-address-using-cardano-wallet-cli-and-cardano-walle)

Currently I am using Blockfrost Api Java SDK and cardano-client-lib but neither are able to create a new payment address from what I can tell.

I would like to avoid needing to run Cardano-cli and JNI (no experience) if possible.

**Tags:** address, payment, java, native
> **Comments:**
> **username_1**: @samuelleathers put in time and effort to answer your question.  If you want to keep getting good answers, don't forget to vote an answer up when you accept it. :-)  
> **username_1**: A better question might have been, "How can I create a new payment address using the Blockfrost Java API"  

---

## 2 answers

### Answer by username_2 on 2022-01-11. Score: 1 | Accepted answer

A payment address is just the hash of the payment pubkey (and optionally the stake pubkey if that addresses funds will delegate) with some prefixed bytes that indicate what type of address it is. The payment secret keys can either be randomly generated (such as how `cardano-cli address key-gen` works), or can be derived from a wallet root private key (which usually has an associated mnemonic to generate the root private key).

If your app doesn't need to use a full wallet, you can generate random bytes, convert that to a pubkey, get the payment key hash and assemble an address.

If your app does use a wallet, you would generate keys under the derivation path: `1852H/1815H/0H/0/$i` using cardano-addresses, and then the rest of the steps are exactly the same, but using the bytes derived rather than randomly generated.

If you go the random generation route, please ensure you have many backups of every secret key you generate, otherwise if the keys are lost, those funds are completely unspendable!

> **Comments:**
> **username_0**: Between this answer and https://github.com/uniVocity/cardano-tutorials/blob/master/cardano-addresses.md#generating-a-payment-address. I get the process from a high level using cardano-address but what happens during the hashing process and can this be easily easily implemented if I have the root pub key and the derivation path?  
> **username_2**: You need the account pub key. Any derivations followed by H are hardened and need the private key to derive.  

---

### Answer by username_3 on 2022-01-10. Score: 1

You could use Blockfrost API to create a new address. Please refer [here](https://docs.blockfrost.io/#tag/Cardano-Utilities/paths/%7E1utils%7E1addresses%7E1xpub%7E1%7Bxpub%7D%7E1%7Brole%7D%7E1%7Bindex%7D/get).

> **Comments:**
> **username_0**: Thanks for the reply. That would be perfect if it was implemented in the Java SDK. However it still might be a better alternative than running a node like I was thinking of doing.  
> **username_4**: Blockfrost has a Java SDK too https://github.com/blockfrost/blockfrost-java  

---

