Bitcoin Forum
May 11, 2024, 09:08:57 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How does signrawtransaction know which private key to use?  (Read 619 times)
ned.ryerson (OP)
Full Member
***
Offline Offline

Activity: 756
Merit: 101


Oikos.cash | Decentralized Finance on Tron


View Profile
June 03, 2014, 03:27:30 PM
 #1

It only has a previous output (hash and vout index) but nothing to tell it which address that output was for, so how can it choose the correct private key to sign the transaction?

OIKOS.CASH      Decentralized finance on Tron   ▬▬▬▬▬▬▬▬▬▬▬▬▬   Collateral-backed stable-coins
         github  telegram    twitter    discord           synthetic asset trading and trustless token exchange on TRON
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715418537
Hero Member
*
Offline Offline

Posts: 1715418537

View Profile Personal Message (Offline)

Ignore
1715418537
Reply with quote  #2

1715418537
Report to moderator
1715418537
Hero Member
*
Offline Offline

Posts: 1715418537

View Profile Personal Message (Offline)

Ignore
1715418537
Reply with quote  #2

1715418537
Report to moderator
1715418537
Hero Member
*
Offline Offline

Posts: 1715418537

View Profile Personal Message (Offline)

Ignore
1715418537
Reply with quote  #2

1715418537
Report to moderator
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
June 03, 2014, 03:39:48 PM
 #2

hash and vout index refer to a UTXO record containing a spend script. the spend script refers to a public address, upon which a private key can be matched.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
ned.ryerson (OP)
Full Member
***
Offline Offline

Activity: 756
Merit: 101


Oikos.cash | Decentralized Finance on Tron


View Profile
June 03, 2014, 03:43:14 PM
 #3

hash and vout index refer to a UTXO record containing a spend script. the spend script refers to a public address, upon which a private key can be matched.
But if you're offline (and no blockchain access), how can it get the UTXO?

OIKOS.CASH      Decentralized finance on Tron   ▬▬▬▬▬▬▬▬▬▬▬▬▬   Collateral-backed stable-coins
         github  telegram    twitter    discord           synthetic asset trading and trustless token exchange on TRON
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4172
Merit: 8419



View Profile WWW
June 03, 2014, 03:48:57 PM
 #4

But if you're offline (and no blockchain access), how can it get the UTXO?
It can't in that case, thats why it has an optional scriptpubkey argument.
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!