Bitcoin Forum
November 04, 2024, 05:41:49 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Taproot getting an address  (Read 60 times)
Sanka555 (OP)
Member
**
Offline Offline

Activity: 96
Merit: 36


View Profile
December 26, 2023, 10:29:01 AM
 #1

getting an address

I use bitcoin to easily get a bitcoin address from Seed

Quote
byte[] seed = PBKDF2SHA512.derive(seedCode, "mnemonic", 2048, 64);
      DeterministicKey deterministicKey = HDKeyDerivation.createMasterPrivateKey(seed);
      deterministicKey = HDKeyDerivation.createMasterPrivateKey(seed);
      deterministicKey = HDKeyDerivation.deriveChildKey(deterministicKey, new ChildNumber(0, true));
      deterministicKey = HDKeyDerivation.deriveChildKey(deterministicKey, new ChildNumber(0, false));
      for (int i = 0; i <= deep; i++) {
         temp = (Address.fromKey(MainNetParams.get(),
               HDKeyDerivation.deriveChildKey(deterministicKey, new ChildNumber(i, false)),
               Script.ScriptType.P2WPKH)).toString();
         adressAndseed.add(temp + " " + seedCode);
      }

how do I change this code to get a taproot type address? the latest version of bitcoinJ does not help

Tell me please.
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7360


Top Crypto Casino


View Profile WWW
January 25, 2024, 11:14:33 AM
 #2

Hi, I don't think generation of Taproot keys is supported in BitcoinJ yet: https://github.com/bitcoinj/bitcoinj/issues/1949

Read the last message by msgilligan:

Quote
WIP PR #3342 adds P2TR support to bitcoinj keychains. The comment on that PR explains what additional work is needed.

And also from reading the release notes, it seems like you can send a transaction amount to someone else's taproot address, which is simple because the scriptpubkey is very similar to Segwit v0, but you can't receive addreses to your own taproot address in BitcoinJ (because that feature doesn't exist) or spend them.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!