I'm in the midst of working this github --> https://github.com/karask/python-bitcoin-utils/blob/master/examples/spend_p2sh_transaction.py

Sorry as I'm not that good in this. I would like to ask the following:

  1. Where can I create this "transaction input from tx id of UTXO"? This is for Bitcoin UTXO.

I mean is it using bitcoin node? vscode? python in Gitpods? I just want to know where I can run this and able to provide me the TXID along with the Transaction value in it. Like for example snapshot below:

enter image description here

Care to guide me? Please.. Thank you in advance.

  • 1
    You don't create it; you have it. It's the txid of the transaction that created the output you're trying to spend. Without it, you don't have any coins. Commented Jan 17, 2021 at 20:09

1 Answer 1


TxInput is a class used in this example to define the input used for creating a transaction.

You can download and install Atom Editor.
Install script package to run python code in atom.
Download and Install Python.

Install bitcoin-utils library:

$ pip install bitcoin-utils

  • Hi @Prayank. Thanks for your reply. I did follow your instructions. However, in the Atom Editor, I'm unable to install bitcoin-utils library and unable to run the script like what you did in your snapshot. It stated here as Traceback (most recent call last): File "C:\GitPod\python-bitcoin-utils-master\bitcoinutils\utils.py", line 13, in <module> from bitcoinutils.constants import SATOSHIS_PER_BITCOIN ModuleNotFoundError: No module named 'bitcoinutils' [Finished in 0.206s]
    – Jsim
    Commented Aug 21, 2020 at 14:50
  • Open "command prompt" as an administrator and run the command "pip install bitcoin-utils" Relaunch Atom Editor and try to run the python code
    – user103136
    Commented Aug 21, 2020 at 15:00
  • Hi @Prayank. Thanks so much for your prompt reply and good guidance. It really works except for the node_proxy.py --> due to I think this is under "Testnet" and if I change to "Mainnet" do you think, it will automatically connect? Actually, I wanted to create a (new) UTXO with (new) Transaction in order to the TXID Input. do you think I can get it here in the bitcoin-utils library? Or shall I make a new script for this? Please advise, thanks so much in advance.
    – Jsim
    Commented Aug 22, 2020 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.