Bitcoin Forum
May 09, 2024, 01:28:54 PM *
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
*
Online Online

Activity: 1596
Merit: 6732


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
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715261334
Hero Member
*
Offline Offline

Posts: 1715261334

View Profile Personal Message (Offline)

Ignore
1715261334
Reply with quote  #2

1715261334
Report to moderator
1715261334
Hero Member
*
Offline Offline

Posts: 1715261334

View Profile Personal Message (Offline)

Ignore
1715261334
Reply with quote  #2

1715261334
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


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!