Bitcoin Forum
May 25, 2024, 12:43:36 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: combining multiple prev_hash and prev_index in tx creation  (Read 63 times)
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1610
Merit: 6761


bitcoincleanup.com / bitmixlist.org


View Profile WWW
October 23, 2021, 12:53:29 PM
Last edit: October 23, 2021, 01:11:20 PM by NotATether
Merited by ABCbits (1)
 #1

Me and a friend are writing some code to programmatically create Trezor transactions (it's proprietary code). But we are not sure how to fill in the prev_hash field inside the Trezor API.

As you might know, when you create a transaction on Trezor, two of the parameters are prev_index and prev_hash.

But we are not sure if we should use the values from the previous transaction or combine them somehow.

Actually we are not even sure what these values are to be honest.

If someone could shed some light on these details I would really appreciate it.



We basically need to get all the UTXOs of an address. What is the most efficient way to do that?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3402
Merit: 6653


Just writing some code


View Profile WWW
October 23, 2021, 09:16:02 PM
Merited by ABCbits (2), PrimeNumber7 (1)
 #2

A UTXO is identified by the txid of the transaction it was created in, and the 0-based index of its position in the transaction's outputs array. That txid is prev_hash, and the position is prev_index. This applies to all Bitcoin transactions, it is not specific to trezor.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!