Bitcoin Forum
May 12, 2024, 12:27:22 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: 1596
Merit: 6735


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
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
1715473642
Hero Member
*
Offline Offline

Posts: 1715473642

View Profile Personal Message (Offline)

Ignore
1715473642
Reply with quote  #2

1715473642
Report to moderator
BitcoinCleanup.com: Learn why Bitcoin isn't bad for the environment
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715473642
Hero Member
*
Offline Offline

Posts: 1715473642

View Profile Personal Message (Offline)

Ignore
1715473642
Reply with quote  #2

1715473642
Report to moderator
1715473642
Hero Member
*
Offline Offline

Posts: 1715473642

View Profile Personal Message (Offline)

Ignore
1715473642
Reply with quote  #2

1715473642
Report to moderator
1715473642
Hero Member
*
Offline Offline

Posts: 1715473642

View Profile Personal Message (Offline)

Ignore
1715473642
Reply with quote  #2

1715473642
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


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!