lian / bitcoin-ruby

bitcoin utils and protocol in ruby.
Other
922 stars 322 forks source link

How do you get "the key needed to sign an input that spends the previous output"? #258

Closed glaksmono closed 6 years ago

glaksmono commented 6 years ago

I don't really understand this part, can someone help me out here?

# the key needed to sign an input that spends the previous output
key = Bitcoin::Key.from_base58("92ZRu28m2GHSKaaF2W7RswJ2iJYpTzVhBaN6ZLs7TENCs4b7ML8")
kento1218 commented 6 years ago

First of all, you have to generate your private key at your end first and generate an address from the key, then send (deposit) some money to the address from somewhere (another wallet you have, some exchange, or whatever). After that, you can spend previous given money (txout) to send to somewhere else.

You may mentioned about instructions on README. Those instructions assume that, you already have private key 92ZRu28m... and incoming tx 6c44b284..., and show how to spent that txout.