How to do tx.addInput without tx_hash if sending from address for the first time? Iam using the bitcoinjs-lib library and trying to do a transaction. Iam doing the tx.addInput method before building but running into a build issue. I assume an error is thrown if blockchainScripthash_listunspent cannot retrieve the previous tx_hash.
If not a coinbase transaction, you have to spend from an existing output. Thus the input must reference an existing transaction.


  cannot retrieve the previous tx_hash


Maybe the library you are using is the following common semantic:


txid for the transaction id (hash without the witness data)
tx_hash for the transaction hash (hash with the witness data)


You want the txid to reference a previous transaction in an input.