I'm working on a couple of projects related to Bitcoin and came across the blockchain.info My Wallet service and its instant payment notification option. I've tried using it several times, but the information I'm trying to receive never is in the same location of the returned JSON object.
Using the example they provide, added below:
{
"hash": "bf8648b06160ded3274d6054cfeadd95f762271170070429ef40d62ac5452c4b",
"ver": 1,
"vin_sz": 1,
"vout_sz": 2,
"lock_time": "Unavailable",
"size": 258,
"relayed_by": "71.238.174.98",
"tx_index": 13903761,
"time": 1325700693,
"inputs": [
{
"prev_out": {
"hash": "e417eb0889a1870e6b500ad8769cb7110739749e",
"addr": "1Mo3ibZuqZpsBGimyfmUnYDiZoU44VbAJV",
"value": 438000000,
"tx_index": 13902462,
"n": 1
}
}
],
"out": [
{
"value": 215000000,
"hash": "6c835372a306b2e253f896801cb0b5703d60114c",
"addr": "1AtmJQYUCVZSwoLkQvEvFhtoRfwn4Eumuu"
},
{
"value": 222000000,
"hash": "60ce49cd97aa152e1db8a76c1b62c55ae3b059d3",
"addr": "19przaW7NeE96SEVtKGWdGM3CuKVaSYhrS"
}
]
}
I figured the inputs were what was sent from who and the outputs specify who received the coins, correct? If this is not the case, can someone please break it down for me so I may get a better understanding? Also, if there are multiple inputs and outputs, how can you determine that it's for the specific address you're interested in handling? Also, how are deposits into your wallet structured, and is there any easy way to grab the data from that JSON object just as easily?
Sorry for the questions, it's just that I never messed with JSON before now. Can be a bit confusing at times, and their documentation for the responses aren't all that great. :p