create account

Make Multisig transactions with Beem without spending all day in the transaction builder. by tcpolymath

View this thread on steemit.com
· @tcpolymath · (edited)
$77.42
Make Multisig transactions with Beem without spending all day in the transaction builder.
<div class="text-justify">

This is in response to @timcliff's <a href="https://steemit.com/steem/@timcliff/steem-developer-bounty-1500-steem-multisignature-transaction-guide-details-inside">bounty post</a> and @crokkon's <a href="https://steemit.com/utopian-io/@crokkon/steem-multi-signature-transaction-guide-for-beem-python-1546636997324">initial solution</a>. While Crokkon's solution is a good one and he got there first, I think it has some usability issues that are fairly easily resolved, so I thought I would write them up.

This tutorial requires the tools Beem and Beempy by @holger80, for which installation instructions can be found <a href="https://beem.readthedocs.io/en/latest/installation.html">here</a>.

<h2>Setting up our multiauth account</h2>

Beempy makes this surprisingly easy. We need to have the active key for the target account imported into the wallet, but then we can do this easily from the command line with the ```allow``` command, which takes several arguments. The generic form of the command is:

```allow -a [Target account] --permissions [Permission] --weight [Weight] --threshold [Threshold] [Authorized account or public key]```

I used the heron-themed accounts I have, with @green-heron the account being saddled with multi-sig permissions. The goal was to have two accounts with 25% weight, and five accounts with 10% weight, with a final required weight of 40%.

```
beempy allow -a green-heron --permission active --weight 25 tcpolymath
beempy allow -a green-heron --permission active --weight 25 herons-unlimited
beempy allow -a green-heron --permission active --weight 10 great-blue-heron
beempy allow -a green-heron --permission active --weight 10 night-heron
beempy allow -a green-heron --permission active --weight 10 goliath-heron
beempy allow -a green-heron --permission active --weight 10 snowy-egret
beempy allow -a green-heron --permission active --weight 10 --threshold 40 whistling-heron
```

Saving the threshold value for last is necessary because we're using the active key and also setting it to multi-auth; if we set the threshold beforehand we'll have to either import the owner key for the account or set up a multi-auth transaction in order to make the new authorizations.

This isn't necessary for setting up multi-auth on the posting key, which can be done simply by removing the "--permission active" option from the commands.

<h2>Using our multi-auth account to send transfers algorithmically</h2>

Here we do need Beem's transaction builder, but we can be fairly simple about it. First we load the required functions, initialize the Steem instance, and begin a transaction:

```
from beem import Steem
from beem.transactionbuilder import TransactionBuilder
from beembase.operations import Transfer

stm=Steem()
tx = TransactionBuilder(steem_instance=stm)
```

Then we build our basic transfer transaction and add it to the transaction object, which Beem makes very easy and self-explanatory:

```
transfer={"from": "green-heron", "to": "tcpolymath", "amount": "1 STEEM", "memo": "multisig transaction example"}
tx.appendOps(Transfer(transfer))
```

After this, we need to get the signatures, and sign the transaction. If we have them all available in our Beem wallet this is again very simple:

```
tx.appendSigner('herons-unlimited', 'active')
tx.appendSigner('great-blue-heron', 'active')
tx.appendSigner('night-heron', 'active')
```

As long as we're signing things algorithmically, where the same program would be attaching all of the signatures - say, for instance, we're a front end collecting signatures from the users - this method works well even when we pass the transaction object ```tx``` throughout our program and sign it at different times. It is possible to pass the transaction manually between humans in different locations extremely clumsily by exporting the signed transaction as a JSON and having each person sign it individually, but practically it's hard to see a real-life application for that process. It would be easier to spin up a simple web front end to get the necessary signatures than to do the manual process more than about three times.

However we've acquired the necessary signatures, once we have them we simply sign and broadcast the transaction:

```
tx.sign()
tx.broadcast()
```

And then we're done. It's actually surprisingly easy. You can see my example transaction <a href="https://steemd.com/tx/f23e160ab8596b1f7df7050d345fcb0cf6a58274">here</a>.

</div>

<center>![Steem.png](https://cdn.steemitimages.com/DQmVJ2rJuhqEmhknNUjqyTWJ6w7SRQoWekDZtJMzWym9u25/Steem.png)</center>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 950 others
properties (23)
post_id68,371,044
authortcpolymath
permlinkmake-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder
categorysteem
json_metadata{"community":"busy","image":["https:\/\/cdn.steemitimages.com\/DQmVJ2rJuhqEmhknNUjqyTWJ6w7SRQoWekDZtJMzWym9u25\/Steem.png"],"users":["timcliff","crokkon","holger80","green-heron"],"format":"markdown","tags":["steem","steemdev","multisig","busy"],"app":"steemit\/0.1","links":["https:\/\/steemit.com\/steem\/@timcliff\/steem-developer-bounty-1500-steem-multisignature-transaction-guide-details-inside","https:\/\/steemit.com\/utopian-io\/@crokkon\/steem-multi-signature-transaction-guide-for-beem-python-1546636997324","https:\/\/beem.readthedocs.io\/en\/latest\/installation.html","https:\/\/steemd.com\/tx\/f23e160ab8596b1f7df7050d345fcb0cf6a58274"]}
created2019-01-04 23:05:15
last_update2019-01-04 23:09:51
depth0
children10
net_rshares143,932,447,257,284
last_payout2019-01-11 23:05:15
cashout_time1969-12-31 23:59:59
total_payout_value58.382 SBD
curator_payout_value19.038 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length4,591
author_reputation66,408,278,506,348
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1014)
@crokkon ·
$0.02
You're absolutely right, the part of adding authorities is already handled by beempy. Even if it requires a few more commands, it comes with beem out-of-the-box. I see @holger80 is active on the repository this evening and I also tried to make a PR to get the full set of steps integrated into beempy. I'm pretty sure we will have this properly integrated very soon :)
👍  
properties (23)
post_id68,371,562
authorcrokkon
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190104t231902998z
categorysteem
json_metadata{"tags":["steem"],"app":"steemit\/0.1","users":["holger80"]}
created2019-01-04 23:19:03
last_update2019-01-04 23:19:03
depth1
children1
net_rshares44,270,731,242
last_payout2019-01-11 23:19:03
cashout_time1969-12-31 23:59:59
total_payout_value0.018 SBD
curator_payout_value0.005 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length368
author_reputation53,429,090,049,316
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@holger80 ·
I fixed the sign and broadcast operation of beempy now. It was some work, let's see what will happen with the bounty...
👍  ,
properties (23)
post_id68,373,117
authorholger80
permlinkre-crokkon-re-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190105t001618044z
categorysteem
json_metadata{"tags":["steem"],"app":"steemit\/0.1"}
created2019-01-05 00:16:18
last_update2019-01-05 00:16:18
depth2
children0
net_rshares969,891,509
last_payout2019-01-12 00:16:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length119
author_reputation74,893,554,750,345
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (2)
@tts ·
To listen to the audio version of this article click on the play image.
[![](https://s18.postimg.org/51o0kpijd/play200x46.png)](http://ec2-52-72-169-104.compute-1.amazonaws.com/tcpolymath__make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder.mp3)
Brought to you by [@tts](https://steemit.com/tts/@tts/introduction). If you find it useful please consider upvoting this reply.
properties (22)
post_id68,371,713
authortts
permlinkre-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190104t232252
categorysteem
json_metadata{}
created2019-01-04 23:22:54
last_update2019-01-04 23:22:54
depth1
children0
net_rshares0
last_payout2019-01-11 23:22:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length410
author_reputation6,118,805,757,518
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steem-ua ·
#### Hi @tcpolymath!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your **UA** account score is currently 4.725 which ranks you at **#1483** across all Steem accounts.
Your rank has dropped 2 places in the last three days (old rank 1481).

In our last Algorithmic Curation Round, consisting of 207 contributions, your post is ranked at **#17**.
##### Evaluation of your UA score:

* Some people are already following you, keep going!
* The readers appreciate your great work!
* Good user engagement!


**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
post_id68,391,100
authorsteem-ua
permlinkre-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190105t111121z
categorysteem
json_metadata{"app":"beem\/0.20.14"}
created2019-01-05 11:11:24
last_update2019-01-05 11:11:24
depth1
children0
net_rshares0
last_payout2019-01-12 11:11:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length640
author_reputation19,448,624,389,373
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@pennsif ·
This post has been included in today's  [**SOS Daily News**](https://steemit.com/steem/@pennsif/sosdailynewsnewsaboutthestateofsteem4january2019-r5y1nirbvb) - a digest of all you need to know about the State of Steem.

***

* *Editor of the [**The State of Steem SoS Daily News**](https://steemit.com/steem/@pennsif/sosdailynewsnewsaboutthestateofsteem4january2019-r5y1nirbvb).*

* *Promoter of [**The State of Steem SoS Weekly Forums**](https://steemit.com/dtube/@pennsif/amwntxt3).*

* *Editor of the [**weekly listing of steem radio shows, podcasts & social broadcasts**](https://steemit.com/mspwaves/@pennsif/schedule-of-radio-shows-podcasts-and-social-broadcasts-supported-by-dsound-week-beginning-31-december-2018).*

* *Founder of the [**A Dollar A Day**](https://steemit.com/adollaraday/@adollaraday/a-dollar-a-day-charitable-giving-project-ususd-5000-donated-in-8-months-we-made-it) charitable giving project.*

https://pennsif.com/wp-content/uploads/2018/08/adollaraday-linear-400x98.jpg

***
properties (22)
post_id68,395,949
authorpennsif
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190105t132047757z
categorysteem
json_metadata{"image":["https:\/\/pennsif.com\/wp-content\/uploads\/2018\/08\/adollaraday-linear-400x98.jpg"],"tags":["steem"],"app":"steemit\/0.1","links":["https:\/\/steemit.com\/steem\/@pennsif\/sosdailynewsnewsaboutthestateofsteem4january2019-r5y1nirbvb","https:\/\/steemit.com\/dtube\/@pennsif\/amwntxt3","https:\/\/steemit.com\/mspwaves\/@pennsif\/schedule-of-radio-shows-podcasts-and-social-broadcasts-supported-by-dsound-week-beginning-31-december-2018","https:\/\/steemit.com\/adollaraday\/@adollaraday\/a-dollar-a-day-charitable-giving-project-ususd-5000-donated-in-8-months-we-made-it"]}
created2019-01-05 13:20:48
last_update2019-01-05 13:20:48
depth1
children0
net_rshares0
last_payout2019-01-12 13:20:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,002
author_reputation117,189,550,617,766
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@ocdb ·
re-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190107t110803816z
You got a 52.34% upvote from @ocdb courtesy of @tcpolymath!

@ocdb is a non-profit bidbot for whitelisted Steemians, current max bid is 12 SBD and the respective amount in Steem.
Check our website https://thegoodwhales.io/ for the whitelist, queue and delegation info. Join our [Discord channel for more information.](https://discord.gg/k2Hu77b)

If you like what @ocd does, consider voting for [ocd-witness through SteemConnect](steemconnect.com/sign/account-witness-vote?witness=ocd-witness&approve=1) or on the [Steemit Witnesses page.](https://steemit.com/~witnesses) :)
properties (22)
post_id68,484,411
authorocdb
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190107t110803816z
categorysteem
json_metadata{"app":"postpromoter\/1.9.3"}
created2019-01-07 11:08:03
last_update2019-01-07 11:08:03
depth1
children0
net_rshares0
last_payout2019-01-14 11:08:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length574
author_reputation27,896,874,942
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@drotto ·
<p>This post has received a 1.56 % upvote from @drotto thanks to: @sbi-booster.</p>
properties (22)
post_id68,551,511
authordrotto
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190108t173347938z
categorysteem
json_metadata{"tags":["steem"],"app":"drotto\/0.0.5pre2"}
created2019-01-08 17:33:48
last_update2019-01-08 17:33:48
depth1
children0
net_rshares0
last_payout2019-01-15 17:33:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length84
author_reputation387,059,541,458
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@blissfish ·
<div class="pull-right"><img src='https://steemitimages.com/p/3jpR3paJ37V8JxyWvos7Po3CcsKfhvxkGk9C7hMZ8ZbCK1qDQAmGpBxKmZSbBFJn4XdxrGG4PVf8ZSGsDVQ6EHFUndnFsTWGvjKk6yBMna4egroJtLciGzQ1DDf7ePzDnjKHY?format=match&mode=fit&width=640'></div><div><center><h1>Congratulations!</h1><br>This post has been granted a 100% upvote, courtesy to @wokeprincess, from BlissFish!<br>Enjoy the Bliss!<br><hr><a href='https://discord.gg/gqWDz9U'> Join us on Discord!</a></center><blockquote>Upvote this post to help the minnows win a bigger upvote!</blockquote></div>
properties (22)
post_id68,591,742
authorblissfish
permlink20190109t132948943z
categorysteem
json_metadata{"tags":["blissfish","bot","lottery","yourewelcome"]}
created2019-01-09 13:29:51
last_update2019-01-09 13:29:51
depth1
children0
net_rshares0
last_payout1969-12-31 23:59:59
cashout_time2019-01-16 13:29:51
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length547
author_reputation2,684,657,507,526
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@thecryptodrive ·
Congrats @tcpolymath, you are one of the finalists for the Multisig bounty, BuildTeam will be sponsoring a Steemvoter Guild vote in addition to any other bounty you may receive. Incoming shortly.
properties (22)
post_id68,606,937
authorthecryptodrive
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190109t201943070z
categorysteem
json_metadata{"app":"steemit\/0.1","users":["tcpolymath"],"tags":["steem"]}
created2019-01-09 20:19:42
last_update2019-01-09 20:19:42
depth1
children0
net_rshares0
last_payout1969-12-31 23:59:59
cashout_time2019-01-16 20:19:42
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length195
author_reputation29,361,468,835,118
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steemvoter ·
$0.01
@buildteam and @steemvoter are proud to award you a Steemvoter Guild vote for your efforts in contributing to the multisig bounty.

<center>https://steemitimages.com/DQmQyUEXjJ16T7Gz76ZxrsykLPgrN2SYW26ike8kWpKJ3ea/image.png</center>
👍  
properties (23)
post_id68,606,973
authorsteemvoter
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190109t202101437z
categorysteem
json_metadata{"image":["https:\/\/steemitimages.com\/DQmQyUEXjJ16T7Gz76ZxrsykLPgrN2SYW26ike8kWpKJ3ea\/image.png"],"app":"steemit\/0.1","users":["buildteam","steemvoter"],"tags":["steem"]}
created2019-01-09 20:21:00
last_update2019-01-09 20:21:00
depth1
children0
net_rshares12,429,689,919
last_payout1969-12-31 23:59:59
cashout_time2019-01-16 20:21:00
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.006 SBD
promoted0.000 SBD
body_length232
author_reputation199,016,410,471,466
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)