0

I notice that vin has a value field denoting the amount of money being spent from the input transaction. Am I correct that this is here for convenience and must equal the value of the specified transaction output?

The only other case I can think of is splitting the same transaction output into two transaction inputs, but I don't see the point of this.

"vin": [{
  "txid":"672aeb1bc62b3941f2e9a530ff6d12e5e70c257632d536d5b0633e12b68a915d",
  "vout":1,
  "scriptSig":{
    "asm":"..."
  },
  "addr":"1HKqcNrf3NPuz4s2MdoAzpYYfjYvbbsxZf",
  "value":0.0468234
},
...]
0
1

That field in the RPC response is by definition just information about the output being spent, so yes, it is always going to be equal.

As for whether it's necessary - no, of course not. But the RPC in the first place exists because of convenience.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.