We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I build and sign a BTC transaction, it defaults to type 1. Is it possible to build and sign a type 2 BTC transaction using Wallet Core?
This is how I'm building the tx, how can I convert it to type 2? Btw, is there any advantage to using transaction type 2?
//BUILD TX val scriptUTXO = BitcoinScript.lockScriptForAddress(addressFrom, CoinType.BITCOIN) val scriptHash = scriptUTXO.matchPayToWitnessPublicKeyHash() val redeemScriptHash = scriptHash.toHexString() val redeemScript = BitcoinScript.lockScriptForAddress(addressFrom, CoinType.BITCOIN).data() //INPUT val input = Bitcoin.SigningInput.newBuilder().apply { this.amount = amount //1962973 if (maxAmount) { this.useMaxAmount = true //auto-sweep } this.hashType = BitcoinSigHashType.ALL.value() this.toAddress = addressToTss //Receiver ADDRESS (TO) MUST BE TSS this.changeAddress = changeAddressLeftOver.ifEmpty { addressFrom } //LEFT OVER this.byteFee = byteFee.toLong() this.coinType = CoinType.BITCOIN.value() this.fixedDustThreshold = 1000 // or 546 for P2PKH, P2WPKH transfers this.dustPolicyCase //this.disableDustFilter = true this.addPrivateKey(ByteString.copyFrom(hexPrivateKey.hexStringToByteArray())) //HEX } input.putScripts(redeemScriptHash, ByteString.copyFrom(redeemScript))
Originally posted by @ronaldoguedess in trustwallet/wallet-core#3874
The text was updated successfully, but these errors were encountered:
Not related to termux.
Sorry, something went wrong.
No branches or pull requests
When I build and sign a BTC transaction, it defaults to type 1. Is it possible to build and sign a type 2 BTC transaction using Wallet Core?
This is how I'm building the tx, how can I convert it to type 2? Btw, is there any advantage to using transaction type 2?
Originally posted by @ronaldoguedess in trustwallet/wallet-core#3874
The text was updated successfully, but these errors were encountered: