<p>I am a newbie in bitcoin development and I just started it with bitcoinj library for Java.
I can get the code snippet to generate bitcoin wallet and legacy address.</p>
<pre class="lang-java prettyprint-override"><code>Timestamp createdAt = Timestamp.valueOf(LocalDateTime.now());
DeterministicSeed seed = new DeterministicSeed(entropy, &quot;&quot;, createdAt.getTime()); 
Wallet btcWallet = Wallet.fromSeed(netParams, seed, Script.ScriptType.P2PKH);
Address receiveAddress = btcWallet.currentReceiveAddress();
String bitcoinAddress = receiveAddress.toString();
</code></pre>
<p>This works well for P2PKH but I want latest type - P2TR. I just changed that parameter but it throw exception. I could not get any help from googling.
Any help would be great for me.
Thanks in advance.</p>

CC BY-SA 4.0
2024-05-26T20:55:20.313Z
As far as I know, BitcoinJ does not support (receiving to) taproot addresses yet.
Pieter Wuille
CC BY-SA 4.0
2024-05-26T21:35:05.370Z
@PieterWuille Ah, I got it. Then what is the latest version that bitcoinj support?
Pavlo Posternak
CC BY-SA 4.0
2024-05-26T22:11:49.303Z
There isn't really a "versioning" of things regarding that, just features that may or may not be supported. I don't follow BitcoinJ development, but according to https://en.bitcoin.it/wiki/Bech32_adoption, receiving to P2WPKH and P2WSH addresses is supported.
Pieter Wuille
CC BY-SA 4.0
2024-05-27T05:37:11.257Z
@PieterWuille Thanks a lot.
Pavlo Posternak
<wallet><bitcoinj><seed><p2tr>
Bitcoin wallet generation with P2TR
Pavlo Posternak
# Bitcoin wallet generation with P2TR

(Asked by: username_0 on 2024-05-26)

I am a newbie in bitcoin development and I just started it with bitcoinj library for Java.
I can get the code snippet to generate bitcoin wallet and legacy address.

```java
Timestamp createdAt = Timestamp.valueOf(LocalDateTime.now());
DeterministicSeed seed = new DeterministicSeed(entropy, "", createdAt.getTime()); 
Wallet btcWallet = Wallet.fromSeed(netParams, seed, Script.ScriptType.P2PKH);
Address receiveAddress = btcWallet.currentReceiveAddress();
String bitcoinAddress = receiveAddress.toString();

```

This works well for P2PKH but I want latest type - P2TR. I just changed that parameter but it throw exception. I could not get any help from googling.
Any help would be great for me.
Thanks in advance.

**Tags:** wallet, bitcoinj, seed, p2tr

> **Comments:**
> **username_1**: As far as I know, BitcoinJ does not support (receiving to) taproot addresses yet.  
> **username_0**: @username_1 Ah, I got it. Then what is the latest version that bitcoinj support?  
> **username_1**: There isn't really a "versioning" of things regarding that, just features that may or may not be supported. I don't follow BitcoinJ development, but according to https://en.bitcoin.it/wiki/Bech32_adoption, receiving to P2WPKH and P2WSH addresses is supported.  
> **username_0**: @username_1 Thanks a lot.  

---

## 0 answers

