Post
Topic
Board BitcoinJ
Topic OP
Taproot getting an address
by
Sanka555
on 26/12/2023, 10:29:01 UTC
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 bitcoin does not help

Tell me please.