Search in sources :

Example 1 with TransactionWitness

use of org.bitcoinj.core.TransactionWitness in project sentinel-android by Samourai-Wallet.

the class SendFactory method signTransaction.

private synchronized Transaction signTransaction(Transaction transaction, HashMap<String, ECKey> keyBag) throws ScriptException {
    List<TransactionInput> inputs = transaction.getInputs();
    TransactionInput input = null;
    TransactionOutput connectedOutput = null;
    byte[] connectedPubKeyScript = null;
    TransactionSignature sig = null;
    Script scriptPubKey = null;
    ECKey key = null;
    for (int i = 0; i < inputs.size(); i++) {
        input = inputs.get(i);
        key = keyBag.get(input.getOutpoint().toString());
        connectedPubKeyScript = input.getOutpoint().getConnectedPubKeyScript();
        connectedOutput = input.getOutpoint().getConnectedOutput();
        scriptPubKey = connectedOutput.getScriptPubKey();
        String script = Hex.toHexString(connectedPubKeyScript);
        String address = null;
        if (Bech32Util.getInstance().isBech32Script(script)) {
            try {
                address = Bech32Util.getInstance().getAddressFromScript(script);
            } catch (Exception e) {
                ;
            }
        } else {
            address = new Script(connectedPubKeyScript).getToAddress(MainNetParams.get()).toString();
        }
        if (FormatsUtil.getInstance().isValidBech32(address) || Address.fromBase58(MainNetParams.get(), address).isP2SHAddress()) {
            final P2SH_P2WPKH p2shp2wpkh = new P2SH_P2WPKH(key.getPubKey(), MainNetParams.get());
            System.out.println("pubKey:" + Hex.toHexString(key.getPubKey()));
            // final Script scriptPubKey = p2shp2wpkh.segWitOutputScript();
            // System.out.println("scriptPubKey:" + Hex.toHexString(scriptPubKey.getProgram()));
            System.out.println("to address from script:" + scriptPubKey.getToAddress(MainNetParams.get()).toString());
            final Script redeemScript = p2shp2wpkh.segWitRedeemScript();
            System.out.println("redeem script:" + Hex.toHexString(redeemScript.getProgram()));
            final Script scriptCode = redeemScript.scriptCode();
            System.out.println("script code:" + Hex.toHexString(scriptCode.getProgram()));
            sig = transaction.calculateWitnessSignature(i, key, scriptCode, connectedOutput.getValue(), Transaction.SigHash.ALL, false);
            final TransactionWitness witness = new TransactionWitness(2);
            witness.setPush(0, sig.encodeToBitcoin());
            witness.setPush(1, key.getPubKey());
            transaction.setWitness(i, witness);
            if (!FormatsUtil.getInstance().isValidBech32(address) && Address.fromBase58(MainNetParams.get(), address).isP2SHAddress()) {
                final ScriptBuilder sigScript = new ScriptBuilder();
                sigScript.data(redeemScript.getProgram());
                transaction.getInput(i).setScriptSig(sigScript.build());
                transaction.getInput(i).getScriptSig().correctlySpends(transaction, i, scriptPubKey, connectedOutput.getValue(), Script.ALL_VERIFY_FLAGS);
            }
        } else {
            if (key != null && key.hasPrivKey() || key.isEncrypted()) {
                sig = transaction.calculateSignature(i, key, connectedPubKeyScript, Transaction.SigHash.ALL, false);
            } else {
                // watch only ?
                sig = TransactionSignature.dummy();
            }
            if (scriptPubKey.isSentToAddress()) {
                input.setScriptSig(ScriptBuilder.createInputScript(sig, key));
            } else if (scriptPubKey.isSentToRawPubKey()) {
                input.setScriptSig(ScriptBuilder.createInputScript(sig));
            } else {
                throw new RuntimeException("Unknown script type: " + scriptPubKey);
            }
        }
    }
    return transaction;
}
Also used : Script(org.bitcoinj.script.Script) TransactionOutput(org.bitcoinj.core.TransactionOutput) TransactionWitness(org.bitcoinj.core.TransactionWitness) TransactionSignature(org.bitcoinj.crypto.TransactionSignature) ECKey(org.bitcoinj.core.ECKey) ScriptBuilder(org.bitcoinj.script.ScriptBuilder) TransactionInput(org.bitcoinj.core.TransactionInput) ScriptException(org.bitcoinj.script.ScriptException) AddressFormatException(org.bitcoinj.core.AddressFormatException) P2SH_P2WPKH(com.samourai.sentinel.segwit.P2SH_P2WPKH)

Example 2 with TransactionWitness

use of org.bitcoinj.core.TransactionWitness in project samourai-wallet-android by Samourai-Wallet.

the class RBFTask method signTx.

private Transaction signTx(Transaction tx) {
    HashMap<String, ECKey> keyBag = new HashMap<String, ECKey>();
    HashMap<String, ECKey> keyBag49 = new HashMap<String, ECKey>();
    HashMap<String, ECKey> keyBag84 = new HashMap<String, ECKey>();
    HashMap<String, String> keys = rbf.getKeyBag();
    for (String outpoint : keys.keySet()) {
        ECKey ecKey = null;
        String[] s = keys.get(outpoint).split("/");
        Log.i("RBF", "path length:" + s.length);
        if (s.length == 4) {
            if (s[3].equals("84")) {
                HD_Address addr = BIP84Util.getInstance(activity).getWallet().getAccount(0).getChain(Integer.parseInt(s[1])).getAddressAt(Integer.parseInt(s[2]));
                ecKey = addr.getECKey();
            } else {
                HD_Address addr = BIP49Util.getInstance(activity).getWallet().getAccount(0).getChain(Integer.parseInt(s[1])).getAddressAt(Integer.parseInt(s[2]));
                ecKey = addr.getECKey();
            }
        } else if (s.length == 3) {
            HD_Address hd_address = AddressFactory.getInstance(activity).get(0, Integer.parseInt(s[1]), Integer.parseInt(s[2]));
            String strPrivKey = hd_address.getPrivateKeyString();
            DumpedPrivateKey pk = new DumpedPrivateKey(SamouraiWallet.getInstance().getCurrentNetworkParams(), strPrivKey);
            ecKey = pk.getKey();
        } else if (s.length == 2) {
            try {
                PaymentAddress address = BIP47Util.getInstance(activity).getReceiveAddress(new PaymentCode(s[0]), Integer.parseInt(s[1]));
                ecKey = address.getReceiveECKey();
            } catch (Exception e) {
                ;
            }
        } else {
            ;
        }
        Log.i("RBF", "outpoint:" + outpoint);
        Log.i("RBF", "path:" + keys.get(outpoint));
        if (ecKey != null) {
            if (s.length == 4) {
                if (s[3].equals("84")) {
                    keyBag84.put(outpoint, ecKey);
                } else {
                    keyBag49.put(outpoint, ecKey);
                }
            } else {
                keyBag.put(outpoint, ecKey);
            }
        } else {
            throw new RuntimeException("ECKey error: cannot process private key");
        // Log.i("ECKey error", "cannot process private key");
        }
    }
    List<TransactionInput> inputs = tx.getInputs();
    for (int i = 0; i < inputs.size(); i++) {
        ECKey ecKey = null;
        String address = null;
        if (inputs.get(i).getValue() != null || keyBag49.containsKey(inputs.get(i).getOutpoint().toString()) || keyBag84.containsKey(inputs.get(i).getOutpoint().toString())) {
            if (keyBag84.containsKey(inputs.get(i).getOutpoint().toString())) {
                ecKey = keyBag84.get(inputs.get(i).getOutpoint().toString());
                SegwitAddress segwitAddress = new SegwitAddress(ecKey.getPubKey(), SamouraiWallet.getInstance().getCurrentNetworkParams());
                address = segwitAddress.getBech32AsString();
            } else {
                ecKey = keyBag49.get(inputs.get(i).getOutpoint().toString());
                SegwitAddress segwitAddress = new SegwitAddress(ecKey.getPubKey(), SamouraiWallet.getInstance().getCurrentNetworkParams());
                address = segwitAddress.getAddressAsString();
            }
        } else {
            ecKey = keyBag.get(inputs.get(i).getOutpoint().toString());
            address = ecKey.toAddress(SamouraiWallet.getInstance().getCurrentNetworkParams()).toString();
        }
        Log.d("RBF", "pubKey:" + Hex.toHexString(ecKey.getPubKey()));
        Log.d("RBF", "address:" + address);
        if (inputs.get(i).getValue() != null || keyBag49.containsKey(inputs.get(i).getOutpoint().toString()) || keyBag84.containsKey(inputs.get(i).getOutpoint().toString())) {
            final SegwitAddress segwitAddress = new SegwitAddress(ecKey.getPubKey(), SamouraiWallet.getInstance().getCurrentNetworkParams());
            Script scriptPubKey = segwitAddress.segWitOutputScript();
            final Script redeemScript = segwitAddress.segWitRedeemScript();
            System.out.println("redeem script:" + Hex.toHexString(redeemScript.getProgram()));
            final Script scriptCode = redeemScript.scriptCode();
            System.out.println("script code:" + Hex.toHexString(scriptCode.getProgram()));
            TransactionSignature sig = tx.calculateWitnessSignature(i, ecKey, scriptCode, Coin.valueOf(input_values.get(inputs.get(i).getOutpoint().toString())), Transaction.SigHash.ALL, false);
            final TransactionWitness witness = new TransactionWitness(2);
            witness.setPush(0, sig.encodeToBitcoin());
            witness.setPush(1, ecKey.getPubKey());
            tx.setWitness(i, witness);
            if (!FormatsUtil.getInstance().isValidBech32(address) && Address.fromBase58(SamouraiWallet.getInstance().getCurrentNetworkParams(), address).isP2SHAddress()) {
                final ScriptBuilder sigScript = new ScriptBuilder();
                sigScript.data(redeemScript.getProgram());
                tx.getInput(i).setScriptSig(sigScript.build());
                tx.getInput(i).getScriptSig().correctlySpends(tx, i, scriptPubKey, Coin.valueOf(input_values.get(inputs.get(i).getOutpoint().toString())), Script.ALL_VERIFY_FLAGS);
            }
        } else {
            Log.i("RBF", "sign outpoint:" + inputs.get(i).getOutpoint().toString());
            Log.i("RBF", "ECKey address from keyBag:" + ecKey.toAddress(SamouraiWallet.getInstance().getCurrentNetworkParams()).toString());
            Log.i("RBF", "script:" + ScriptBuilder.createOutputScript(ecKey.toAddress(SamouraiWallet.getInstance().getCurrentNetworkParams())));
            Log.i("RBF", "script:" + Hex.toHexString(ScriptBuilder.createOutputScript(ecKey.toAddress(SamouraiWallet.getInstance().getCurrentNetworkParams())).getProgram()));
            TransactionSignature sig = tx.calculateSignature(i, ecKey, ScriptBuilder.createOutputScript(ecKey.toAddress(SamouraiWallet.getInstance().getCurrentNetworkParams())).getProgram(), Transaction.SigHash.ALL, false);
            tx.getInput(i).setScriptSig(ScriptBuilder.createInputScript(sig, ecKey));
        }
    }
    return tx;
}
Also used : Script(org.bitcoinj.script.Script) PaymentCode(com.samourai.wallet.bip47.rpc.PaymentCode) TransactionWitness(org.bitcoinj.core.TransactionWitness) HD_Address(com.samourai.wallet.hd.HD_Address) HashMap(java.util.HashMap) SegwitAddress(com.samourai.wallet.segwit.SegwitAddress) ECKey(org.bitcoinj.core.ECKey) TransactionSignature(org.bitcoinj.crypto.TransactionSignature) ScriptBuilder(org.bitcoinj.script.ScriptBuilder) PaymentAddress(com.samourai.wallet.bip47.rpc.PaymentAddress) JSONException(org.json.JSONException) DecoderException(org.bouncycastle.util.encoders.DecoderException) MnemonicException(org.bitcoinj.crypto.MnemonicException) IOException(java.io.IOException) MyTransactionInput(com.samourai.wallet.send.MyTransactionInput) TransactionInput(org.bitcoinj.core.TransactionInput) MyTransactionOutPoint(com.samourai.wallet.send.MyTransactionOutPoint) DumpedPrivateKey(org.bitcoinj.core.DumpedPrivateKey)

Example 3 with TransactionWitness

use of org.bitcoinj.core.TransactionWitness in project samourai-wallet-android by Samourai-Wallet.

the class SendFactory method signTransaction.

private synchronized Transaction signTransaction(Transaction transaction, HashMap<String, ECKey> keyBag) throws ScriptException {
    List<TransactionInput> inputs = transaction.getInputs();
    TransactionInput input = null;
    TransactionOutput connectedOutput = null;
    byte[] connectedPubKeyScript = null;
    TransactionSignature sig = null;
    Script scriptPubKey = null;
    ECKey key = null;
    for (int i = 0; i < inputs.size(); i++) {
        input = inputs.get(i);
        key = keyBag.get(input.getOutpoint().toString());
        connectedPubKeyScript = input.getOutpoint().getConnectedPubKeyScript();
        connectedOutput = input.getOutpoint().getConnectedOutput();
        scriptPubKey = connectedOutput.getScriptPubKey();
        String script = Hex.toHexString(connectedPubKeyScript);
        String address = null;
        if (Bech32Util.getInstance().isBech32Script(script)) {
            try {
                address = Bech32Util.getInstance().getAddressFromScript(script);
            } catch (Exception e) {
                ;
            }
        } else {
            address = new Script(connectedPubKeyScript).getToAddress(SamouraiWallet.getInstance().getCurrentNetworkParams()).toString();
        }
        if (FormatsUtil.getInstance().isValidBech32(address) || Address.fromBase58(SamouraiWallet.getInstance().getCurrentNetworkParams(), address).isP2SHAddress()) {
            final SegwitAddress segwitAddress = new SegwitAddress(key.getPubKey(), SamouraiWallet.getInstance().getCurrentNetworkParams());
            // System.out.println("pubKey:" + Hex.toHexString(key.getPubKey()));
            // final Script scriptPubKey = p2shp2wpkh.segWitOutputScript();
            // System.out.println("scriptPubKey:" + Hex.toHexString(scriptPubKey.getProgram()));
            // System.out.println("to address from script:" + scriptPubKey.getToAddress(SamouraiWallet.getInstance().getCurrentNetworkParams()).toString());
            final Script redeemScript = segwitAddress.segWitRedeemScript();
            // System.out.println("redeem script:" + Hex.toHexString(redeemScript.getProgram()));
            final Script scriptCode = redeemScript.scriptCode();
            // System.out.println("script code:" + Hex.toHexString(scriptCode.getProgram()));
            sig = transaction.calculateWitnessSignature(i, key, scriptCode, connectedOutput.getValue(), Transaction.SigHash.ALL, false);
            final TransactionWitness witness = new TransactionWitness(2);
            witness.setPush(0, sig.encodeToBitcoin());
            witness.setPush(1, key.getPubKey());
            transaction.setWitness(i, witness);
            if (!FormatsUtil.getInstance().isValidBech32(address) && Address.fromBase58(SamouraiWallet.getInstance().getCurrentNetworkParams(), address).isP2SHAddress()) {
                final ScriptBuilder sigScript = new ScriptBuilder();
                sigScript.data(redeemScript.getProgram());
                transaction.getInput(i).setScriptSig(sigScript.build());
                transaction.getInput(i).getScriptSig().correctlySpends(transaction, i, scriptPubKey, connectedOutput.getValue(), Script.ALL_VERIFY_FLAGS);
            }
        } else {
            if (key != null && key.hasPrivKey() || key.isEncrypted()) {
                sig = transaction.calculateSignature(i, key, connectedPubKeyScript, Transaction.SigHash.ALL, false);
            } else {
                // watch only ?
                sig = TransactionSignature.dummy();
            }
            if (scriptPubKey.isSentToAddress()) {
                input.setScriptSig(ScriptBuilder.createInputScript(sig, key));
            } else if (scriptPubKey.isSentToRawPubKey()) {
                input.setScriptSig(ScriptBuilder.createInputScript(sig));
            } else {
                throw new RuntimeException("Unknown script type: " + scriptPubKey);
            }
        }
    }
    return transaction;
}
Also used : Script(org.bitcoinj.script.Script) TransactionOutput(org.bitcoinj.core.TransactionOutput) TransactionWitness(org.bitcoinj.core.TransactionWitness) SegwitAddress(com.samourai.wallet.segwit.SegwitAddress) TransactionSignature(org.bitcoinj.crypto.TransactionSignature) ECKey(org.bitcoinj.core.ECKey) ScriptBuilder(org.bitcoinj.script.ScriptBuilder) TransactionInput(org.bitcoinj.core.TransactionInput) ScriptException(org.bitcoinj.script.ScriptException) AddressFormatException(org.bitcoinj.core.AddressFormatException) MnemonicException(org.bitcoinj.crypto.MnemonicException) IOException(java.io.IOException)

Example 4 with TransactionWitness

use of org.bitcoinj.core.TransactionWitness in project samourai-wallet-android by Samourai-Wallet.

the class RicochetMeta method getHopTx.

private Transaction getHopTx(String prevTxHash, int prevTxN, int prevIndex, long prevSpendAmount, long spendAmount, String destination, Pair<String, Long> samouraiFeePair, long nTimeLock) {
    TransactionOutput output = null;
    if (destination.toLowerCase().startsWith("tb") || destination.toLowerCase().startsWith("bc")) {
        byte[] bScriptPubKey = null;
        try {
            Pair<Byte, byte[]> pair = Bech32Segwit.decode(SamouraiWallet.getInstance().isTestNet() ? "tb" : "bc", destination);
            bScriptPubKey = Bech32Segwit.getScriptPubkey(pair.getLeft(), pair.getRight());
        } catch (Exception e) {
            return null;
        }
        output = new TransactionOutput(SamouraiWallet.getInstance().getCurrentNetworkParams(), null, Coin.valueOf(spendAmount), bScriptPubKey);
    } else {
        Script outputScript = ScriptBuilder.createOutputScript(org.bitcoinj.core.Address.fromBase58(SamouraiWallet.getInstance().getCurrentNetworkParams(), destination));
        output = new TransactionOutput(SamouraiWallet.getInstance().getCurrentNetworkParams(), null, Coin.valueOf(spendAmount), outputScript.getProgram());
    }
    HD_Address address = BIP84Util.getInstance(context).getWallet().getAccountAt(RICOCHET_ACCOUNT).getChain(AddressFactory.RECEIVE_CHAIN).getAddressAt(prevIndex);
    ECKey ecKey = address.getECKey();
    SegwitAddress p2wpkh = new SegwitAddress(ecKey.getPubKey(), SamouraiWallet.getInstance().getCurrentNetworkParams());
    Script redeemScript = p2wpkh.segWitRedeemScript();
    Transaction tx = new Transaction(SamouraiWallet.getInstance().getCurrentNetworkParams());
    if (nTimeLock > 0L) {
        tx.setLockTime(nTimeLock);
    }
    tx.addOutput(output);
    if (samouraiFeePair != null) {
        byte[] bScriptPubKey = null;
        try {
            Pair<Byte, byte[]> pair = Bech32Segwit.decode(SamouraiWallet.getInstance().isTestNet() ? "tb" : "bc", samouraiFeePair.getLeft());
            bScriptPubKey = Bech32Segwit.getScriptPubkey(pair.getLeft(), pair.getRight());
        } catch (Exception e) {
            return null;
        }
        TransactionOutput _output = new TransactionOutput(SamouraiWallet.getInstance().getCurrentNetworkParams(), null, Coin.valueOf(samouraiFeePair.getRight()), bScriptPubKey);
        tx.addOutput(_output);
    }
    // Log.d("RicochetMeta", "spending from:" + p2wpkh.getBech32AsString());
    // Log.d("RicochetMeta", "pubkey:" + Hex.toHexString(ecKey.getPubKey()));
    Sha256Hash txHash = Sha256Hash.wrap(prevTxHash);
    TransactionOutPoint outPoint = new TransactionOutPoint(SamouraiWallet.getInstance().getCurrentNetworkParams(), prevTxN, txHash, Coin.valueOf(prevSpendAmount));
    TransactionInput txInput = new TransactionInput(SamouraiWallet.getInstance().getCurrentNetworkParams(), null, new byte[] {}, outPoint, Coin.valueOf(prevSpendAmount));
    if (PrefsUtil.getInstance(context).getValue(PrefsUtil.RBF_OPT_IN, false) == true) {
        txInput.setSequenceNumber(SamouraiWallet.RBF_SEQUENCE_VAL.longValue());
    }
    tx.addInput(txInput);
    TransactionSignature sig = tx.calculateWitnessSignature(0, ecKey, redeemScript.scriptCode(), Coin.valueOf(prevSpendAmount), Transaction.SigHash.ALL, false);
    final TransactionWitness witness = new TransactionWitness(2);
    witness.setPush(0, sig.encodeToBitcoin());
    witness.setPush(1, ecKey.getPubKey());
    tx.setWitness(0, witness);
    assert (0 == tx.getInput(0).getScriptBytes().length);
    // Log.d("RicochetMeta", "script sig length:" + tx.getInput(0).getScriptBytes().length);
    tx.verify();
    return tx;
}
Also used : Script(org.bitcoinj.script.Script) TransactionOutput(org.bitcoinj.core.TransactionOutput) TransactionWitness(org.bitcoinj.core.TransactionWitness) HD_Address(com.samourai.wallet.hd.HD_Address) SegwitAddress(com.samourai.wallet.segwit.SegwitAddress) Sha256Hash(org.bitcoinj.core.Sha256Hash) ECKey(org.bitcoinj.core.ECKey) TransactionSignature(org.bitcoinj.crypto.TransactionSignature) JSONException(org.json.JSONException) ScriptException(org.bitcoinj.script.ScriptException) MnemonicException(org.bitcoinj.crypto.MnemonicException) IOException(java.io.IOException) MyTransactionInput(com.samourai.wallet.send.MyTransactionInput) TransactionInput(org.bitcoinj.core.TransactionInput) Transaction(org.bitcoinj.core.Transaction) MyTransactionOutPoint(com.samourai.wallet.send.MyTransactionOutPoint) TransactionOutPoint(org.bitcoinj.core.TransactionOutPoint)

Example 5 with TransactionWitness

use of org.bitcoinj.core.TransactionWitness in project samourai-wallet-android by Samourai-Wallet.

the class AndroidTx0Service method signTx0.

@Override
protected void signTx0(Transaction tx, Collection<UnspentOutputWithKey> inputs, NetworkParameters params) {
    int idx = 0;
    for (UnspentOutputWithKey input : inputs) {
        String address = input.addr;
        ECKey spendFromKey = ECKey.fromPrivate(input.getKey());
        // sign input
        if (FormatsUtil.getInstance().isValidBech32(address) || Address.fromBase58(params, address).isP2SHAddress()) {
            SegwitAddress segwitAddress = new SegwitAddress(spendFromKey.getPubKey(), params);
            final Script redeemScript = segwitAddress.segWitRedeemScript();
            final Script scriptCode = redeemScript.scriptCode();
            TransactionSignature sig = tx.calculateWitnessSignature(idx, spendFromKey, scriptCode, Coin.valueOf(input.value), Transaction.SigHash.ALL, false);
            final TransactionWitness witness = new TransactionWitness(2);
            witness.setPush(0, sig.encodeToBitcoin());
            witness.setPush(1, spendFromKey.getPubKey());
            tx.setWitness(idx, witness);
            if (!FormatsUtil.getInstance().isValidBech32(address) && Address.fromBase58(params, address).isP2SHAddress()) {
                final ScriptBuilder sigScript = new ScriptBuilder();
                sigScript.data(redeemScript.getProgram());
                tx.getInput(idx).setScriptSig(sigScript.build());
            // tx.getInput(idx).getScriptSig().correctlySpends(tx, idx, new Script(Hex.decode(input.script)), Coin.valueOf(input.value), Script.ALL_VERIFY_FLAGS);
            }
        } else {
            TransactionSignature sig = tx.calculateSignature(idx, spendFromKey, new Script(Hex.decode(input.script)), Transaction.SigHash.ALL, false);
            tx.getInput(idx).setScriptSig(ScriptBuilder.createInputScript(sig, spendFromKey));
        }
        idx++;
    }
    super.signTx0(tx, inputs, params);
}
Also used : Script(org.bitcoinj.script.Script) TransactionWitness(org.bitcoinj.core.TransactionWitness) SegwitAddress(com.samourai.wallet.segwit.SegwitAddress) ECKey(org.bitcoinj.core.ECKey) TransactionSignature(org.bitcoinj.crypto.TransactionSignature) ScriptBuilder(org.bitcoinj.script.ScriptBuilder) TransactionOutPoint(org.bitcoinj.core.TransactionOutPoint) MyTransactionOutPoint(com.samourai.wallet.send.MyTransactionOutPoint)

Aggregations

ECKey (org.bitcoinj.core.ECKey)5 TransactionWitness (org.bitcoinj.core.TransactionWitness)5 TransactionSignature (org.bitcoinj.crypto.TransactionSignature)5 Script (org.bitcoinj.script.Script)5 SegwitAddress (com.samourai.wallet.segwit.SegwitAddress)4 TransactionInput (org.bitcoinj.core.TransactionInput)4 ScriptBuilder (org.bitcoinj.script.ScriptBuilder)4 MyTransactionOutPoint (com.samourai.wallet.send.MyTransactionOutPoint)3 IOException (java.io.IOException)3 TransactionOutput (org.bitcoinj.core.TransactionOutput)3 MnemonicException (org.bitcoinj.crypto.MnemonicException)3 ScriptException (org.bitcoinj.script.ScriptException)3 HD_Address (com.samourai.wallet.hd.HD_Address)2 MyTransactionInput (com.samourai.wallet.send.MyTransactionInput)2 AddressFormatException (org.bitcoinj.core.AddressFormatException)2 TransactionOutPoint (org.bitcoinj.core.TransactionOutPoint)2 JSONException (org.json.JSONException)2 P2SH_P2WPKH (com.samourai.sentinel.segwit.P2SH_P2WPKH)1 PaymentAddress (com.samourai.wallet.bip47.rpc.PaymentAddress)1 PaymentCode (com.samourai.wallet.bip47.rpc.PaymentCode)1