{"action":"created","issue":{"url":"https://api.github.com/repos/blockstack/blockstore/issues/201","labels_url":"https://api.github.com/repos/blockstack/blockstore/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/blockstack/blockstore/issues/201/comments","events_url":"https://api.github.com/repos/blockstack/blockstore/issues/201/events","html_url":"https://github.com/blockstack/blockstore/issues/201","id":127066995,"number":201,"title":"IndexError from bitcoin package","user":{"login":"muneeb-ali","id":669932,"avatar_url":"https://avatars.githubusercontent.com/u/669932?v=3","gravatar_id":"","url":"https://api.github.com/users/muneeb-ali","html_url":"https://github.com/muneeb-ali","followers_url":"https://api.github.com/users/muneeb-ali/followers","following_url":"https://api.github.com/users/muneeb-ali/following{/other_user}","gists_url":"https://api.github.com/users/muneeb-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/muneeb-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muneeb-ali/subscriptions","organizations_url":"https://api.github.com/users/muneeb-ali/orgs","repos_url":"https://api.github.com/users/muneeb-ali/repos","events_url":"https://api.github.com/users/muneeb-ali/events{/privacy}","received_events_url":"https://api.github.com/users/muneeb-ali/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/blockstack/blockstore/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-17T01:04:35Z","updated_at":"2016-02-01T16:04:06Z","closed_at":null,"body":"I'm getting an error from the bitcoin package's deserialize function. I can't reproduce this on all payment addresses I'm using, but only on some of them. I'll investigate further, but pasting the traceback for now: \r\n\r\n```\r\n{\r\n    \"error\": \"IndexError: string index out of range\",\r\n    \"traceback\": [\r\n        \"Traceback (most recent call last):\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/blockstore/blockstored.py\\\", line 436, in blockstore_name_preorder\",\r\n        \"    name_fee, testset=blockstore_opts['testset'], subsidy_public_key=public_key, tx_only=tx_only )\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/blockstore/lib/operations/preorder.py\\\", line 159, in broadcast\",\r\n        \"    outputs = make_outputs(nulldata, inputs, from_address, fee, format='hex')\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/blockstore/lib/operations/preorder.py\\\", line 112, in make_outputs\",\r\n        \"    dust_fee = tx_dust_fee_from_inputs_and_outputs( inputs, outputs )\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/blockstore/lib/scripts.py\\\", line 368, in tx_dust_fee_from_inputs_and_outputs\",\r\n        \"    serialized_tx = tx_serialize_and_sign( inputs, outputs, pk )\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/blockstore/lib/scripts.py\\\", line 267, in tx_serialize_and_sign\",\r\n        \"    return tx_serialize_and_sign_multi( inputs, outputs, [private_key] * len(inputs) )\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/blockstore/lib/scripts.py\\\", line 256, in tx_serialize_and_sign_multi\",\r\n        \"    signed_tx = bitcoin.sign( unsigned_tx, i, private_key_objs[i].to_hex() )\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/bitcoin/transaction.py\\\", line 369, in sign\",\r\n        \"    signing_tx = signature_form(tx, i, mk_pubkey_script(address), hashcode)\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/bitcoin/transaction.py\\\", line 132, in signature_form\",\r\n        \"    return serialize(signature_form(deserialize(tx), i, script, hashcode))\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/bitcoin/transaction.py\\\", line 48, in deserialize\",\r\n        \"    return json_changebase(deserialize(binascii.unhexlify(tx)),\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/bitcoin/transaction.py\\\", line 87, in deserialize\",\r\n        \"    outs = read_var_int()\",\r\n        \"  File \\\"/usr/local/lib/python2.7/dist-packages/bitcoin/transaction.py\\\", line 62, in read_var_int\",\r\n        \"    val = from_byte_to_int(tx[pos[0]-1])\",\r\n        \"IndexError: string index out of range\"\r\n }\r\n```"},"comment":{"url":"https://api.github.com/repos/blockstack/blockstore/issues/comments/178044734","html_url":"https://github.com/blockstack/blockstore/issues/201#issuecomment-178044734","issue_url":"https://api.github.com/repos/blockstack/blockstore/issues/201","id":178044734,"user":{"login":"jcnelson","id":459947,"avatar_url":"https://avatars.githubusercontent.com/u/459947?v=3","gravatar_id":"","url":"https://api.github.com/users/jcnelson","html_url":"https://github.com/jcnelson","followers_url":"https://api.github.com/users/jcnelson/followers","following_url":"https://api.github.com/users/jcnelson/following{/other_user}","gists_url":"https://api.github.com/users/jcnelson/gists{/gist_id}","starred_url":"https://api.github.com/users/jcnelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcnelson/subscriptions","organizations_url":"https://api.github.com/users/jcnelson/orgs","repos_url":"https://api.github.com/users/jcnelson/repos","events_url":"https://api.github.com/users/jcnelson/events{/privacy}","received_events_url":"https://api.github.com/users/jcnelson/received_events","type":"User","site_admin":false},"created_at":"2016-02-01T16:04:06Z","updated_at":"2016-02-01T16:04:06Z","body":"This turned out to be a bug from our UTXO provider sending back malformed outputs.  I'll add some checks in the code to catch this earlier."}}