{"action":"created","issue":{"url":"https://api.github.com/repos/Bit-Wasp/bitcoin-php/issues/169","labels_url":"https://api.github.com/repos/Bit-Wasp/bitcoin-php/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/Bit-Wasp/bitcoin-php/issues/169/comments","events_url":"https://api.github.com/repos/Bit-Wasp/bitcoin-php/issues/169/events","html_url":"https://github.com/Bit-Wasp/bitcoin-php/issues/169","id":115229748,"number":169,"title":"Sweeping Multisig Dust","user":{"login":"danielbanderson","id":8001717,"avatar_url":"https://avatars.githubusercontent.com/u/8001717?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbanderson","html_url":"https://github.com/danielbanderson","followers_url":"https://api.github.com/users/danielbanderson/followers","following_url":"https://api.github.com/users/danielbanderson/following{/other_user}","gists_url":"https://api.github.com/users/danielbanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbanderson/subscriptions","organizations_url":"https://api.github.com/users/danielbanderson/orgs","repos_url":"https://api.github.com/users/danielbanderson/repos","events_url":"https://api.github.com/users/danielbanderson/events{/privacy}","received_events_url":"https://api.github.com/users/danielbanderson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-11-05T08:06:59Z","updated_at":"2015-11-22T20:44:39Z","closed_at":null,"body":"Hey, very cool repo! I think I'm hitting a wall due to edge-case-y stuff.\r\n\r\nI'm trying to sweep utxo dust from an address that utilized the Counterparty protocol to make a lot of multisig outputs. Counterparty uses 1-of-3 multisig, so I should be able to sweep them up and send them back to myself, no?\r\n\r\nI am trying to create a tool like: http://redeem.bitwatch.co/ (which has ceased working).\r\n\r\nUsing your code, I have almost been able to get there, but both my code and redeem.bitwatch.co tool produce the same error which makes me think that perhaps it's not doable, but I'm told that redeem.bitwatch.co worked, in the past.\r\n\r\nWhen you decode the tx that either my code or redeem.bitwatch.co creates, the addresses of my input transactions look like:\r\n4RzbbApVjQzsiJsmPPVZXh4CGQ3um15wvY\r\n\r\nI'm not expert, but I'm pretty sure bitcoin addresses have to start with 1 or 3, no?\r\n\r\nWhat do you think would cause this / is there an obvious answer here? I know this is kind of out of left field.\r\n\r\nHere's the raw unsigned transaction I've created...\r\n\r\nIt's totally possible that the code that generated this still has issues in terms of generating the script, but I don't think that would be what causes the addresses to start with the number 4.\r\n\r\n```\r\n01000000250bb4117d530b5f12248acf6d93f4383479a2f004ff79e76296db42301ab4c8a6000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff9138746736c9f304ade0c34c2a5b634cb894bade6241c1373821f55a8037f97b000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff9138746736c9f304ade0c34c2a5b634cb894bade6241c1373821f55a8037f97b010000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffe77789fdbe4e1cd38eedc52e734b83804322b0e9899e385cd235734018ee248b000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff5805c11a4179556af56e0617a7cca78d66eb5d3d92ed8fa58e372f38ed1b839d000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff8f9e026b27b9eab5ba92f018fb3926b715a00c1e760965122a49dff4ea2457f2000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aefffffffff37f77e6de1c0cfd362515b4f0dee19c02138cae2ef012275876607443befada000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffcb81433f173b8bc1a3ccb9500b157b5fedcf678ef84bc33f757646b3626c1bfa000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff86f3d7d57acf31049d00fbebbe58debd551674005bff5115332ac06b64f6ebd2000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffdecdd4d1bce67e4ffb351ec10b07b2bb1250155e6775dc48ebd3bc8c36cc1888000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff4c1ffc5bfec5ab440b11a8824cc854db76014bf0e5d528339f2b329f75c764b5000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff1dacd0be7c12cac8b4ad932ec4b2d6d04558c34d1356c3d437430042c0e91e8b000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff70331fad48b71e2985430329dc3895898867a456029b8e0c38bfc056e80e5129000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffbe25a801da6868246d626a11abedb6bacc32ef62d5ca62fff19c65abe8c8bcf3000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff1e71260ef8bcc6c51f1c239787d064f7343ad6c13d46ae1f531b7e65e42d25f4000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffa33ce3c2bda5f1eb41021618d02220a4b53c9570af927110ad00b2ec1d181f3d000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffead1c45407f77d5be10162b250a766b78852a1e3a6dfeacaafa9ba71b952e8ca000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aefffffffff6524c85d2e46027150b96127618208f452aadb9280a151a3814e96cfe0eeda8000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff3272d32c6726c0d8e7832a81a45004963816fa766267bfbd8f2be3472be4eb87000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffd76804422b63634232bf6c9167332f624971266f0ba64f54f18a6e25387d1c05000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff61536042ba40f414d6bf37fd37bb2fb1fd113339fb8d3dc949f2ce81a24838cd000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff7b3adff7471a4b6cc20cc2c67d7d3641c081321bced12c2a38c964f5b5d36dd1000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffffc5ebc5f834164162a999b0f18634bd005b8eb8907b3797eb96bbfc3512ea96000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff7de78289699f2b0647782f975b0ca302d71b28c0cf1249e9fbb1333358c3df72000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffd6617ec0e8df31ca26f058cebc010d7fb51b1ec47dac512498579a68b95edcf2000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffbc16a04c0023c369dd6ea3ae05f39b0ac1b50f6a478b9f91fdc42e7a95a83968000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff88f35f104cf71296d2a00ec4c02c06ce17302c56ae343de01a079353850724c2000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffa74d0f1dbd3896bfa741c520440f1e4dfbdfffbf0543054139b86d363b2ae6b6000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffead56c54850af2593ff6622239141682495b0ecfd5badd4f1c0d7d3de33daf89000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffcc22fd95ff59ed6ce1718b2339cd54651d8db4c606dbab72da5ca4b30356d6cd000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffba8753fc928f053eacf65c87166c39347dfac8db948889327ed68199327cb246000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff5a6c597e05330826480f8a3ebbe6133a1ec1faa39b23092c0e217f8ed03fe45e010000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffad8c1807b590febf2cd50b91200512c2b69a7856f6e6de0c2108500ee92d0e3c010000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff188e63b2a1759250b5e96dd65ba9d026ee211df0e88d85373fd93796abecc79f010000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff9486fad379c167671e8dc3ffacfa303b7671cd785cf7ffb664a76e9a0657a993010000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff7289de75d9c8fec95493a62e2d5784bb3ee67b448b82cbfa4cc82ee54eb38b42010000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffffcb8d86d1183a36d3db6d48abcaf3dc8f1028e75f8e13cc089eec78769aa107c2000000002551210212fcb1d3a0ffec857b35fac8e5c63df72d626d66d7484e6c3e857edd0df52a9c51aeffffffff01b54a0400000000001976a914bc55167fcf51cef5d1a9cbddf09919db97ddc4e388ac00000000\r\n```"},"comment":{"url":"https://api.github.com/repos/Bit-Wasp/bitcoin-php/issues/comments/158798305","html_url":"https://github.com/Bit-Wasp/bitcoin-php/issues/169#issuecomment-158798305","issue_url":"https://api.github.com/repos/Bit-Wasp/bitcoin-php/issues/169","id":158798305,"user":{"login":"afk11","id":5617245,"avatar_url":"https://avatars.githubusercontent.com/u/5617245?v=3","gravatar_id":"","url":"https://api.github.com/users/afk11","html_url":"https://github.com/afk11","followers_url":"https://api.github.com/users/afk11/followers","following_url":"https://api.github.com/users/afk11/following{/other_user}","gists_url":"https://api.github.com/users/afk11/gists{/gist_id}","starred_url":"https://api.github.com/users/afk11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afk11/subscriptions","organizations_url":"https://api.github.com/users/afk11/orgs","repos_url":"https://api.github.com/users/afk11/repos","events_url":"https://api.github.com/users/afk11/events{/privacy}","received_events_url":"https://api.github.com/users/afk11/received_events","type":"User","site_admin":false},"created_at":"2015-11-22T20:44:39Z","updated_at":"2015-11-22T20:44:39Z","body":"Weird. Let me know what API you're broadcasting against, and the exact error. \r\n\r\nInputs don't have _technically_ have addresses, what are you referring to here? It sure looks unfamiliar to me! I don't see code addressing this, but are you signing the transaction somewhere?\r\n\r\n```php\r\n$unsigned = $builder->get();\r\n$p2shOutScript = ScriptFactory::scriptPubKey()->payToScriptHash($redeemScript);\r\n\r\n$signed = TransactionFactory::sign($unsigned);\r\nfor($i = 0; $i < count($unsigned->getInputs()); $i++) {\r\n  $signed->sign($i, $privateKey, $p2shOutScript, $redeemScript);\r\n}\r\n\r\n$signedTx = $signed->get();\r\necho $signedTx->getHex() . PHP_EOL;\r\n```\r\n"}}