# Public Passphrase & Sweepable Multisig

**URL:** <https://forums.counterparty.io/t/public-passphrase-sweepable-multisig/1535>\
**Category:** Watercooler\
**Created:** [September 22, 2015, 11:04am UTC](https://forums.counterparty.io/t/public-passphrase-sweepable-multisig/1535 "2015-09-22T11:04:54Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![ebx](https://yyz2.discourse-cdn.com/flex004/user_avatar/forums.counterparty.io/ebx/32/683_2.png) [@ebx](https://forums.counterparty.io/u/ebx)\
**Post date:** [April 12, 2017, 4:12am UTC](https://forums.counterparty.io/t/public-passphrase-sweepable-multisig/1535/14 "2017-04-12T04:12:36Z")

</div>

Here’s some (updated) code that I used to sweep those last two addresses last night.

It requires access to a bitcoin RPC interface with searchrawtransactions, or you can change GET\_UTXOS\_FROM\_BITWATCH to True to get utxos from the bitwatch API and just ignore pubkeyhash txouts (which they will mistakenly list as unspent). You should configure lines 21-31 to your specific environment/need.

Note that a limit of 3000 is also used for the searchrawtransactions call, if your address has more transactions than that just increase the number for SEARCHTX\_MAX\_TX\_COUNT.

[https://gist.github.com/sorce/c60dfaac06d19842edfd5b7e2804ddc5](https://gist.github.com/sorce/c60dfaac06d19842edfd5b7e2804ddc5)

Also, if you’d like me to send the swept funds back to you just drop me an address and I’ll be happy to oblige 🙂

edit: the code itself is simple and makes some assumptions, I recommend decoding the transactions that are output _before_ broadcasting it to ensure that it looks correct and that the fee you set is as sufficient as you thought.

edit 2: updated information because code was updated and advice relating to specific lines of code no longer made sense.

---

_[View the full topic](https://forums.counterparty.io/t/public-passphrase-sweepable-multisig/1535)._
