create account

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

View this thread on: hive.blogpeakd.comecency.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 936 others
properties (23)
authortcpolymath
permlinkmake-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder
categorysteem
json_metadata{"community":"busy","app":"steemit/0.1","format":"markdown","tags":["steem","steemdev","multisig","busy"],"users":["timcliff","crokkon","holger80","green-heron"],"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"],"image":["https://cdn.steemitimages.com/DQmVJ2rJuhqEmhknNUjqyTWJ6w7SRQoWekDZtJMzWym9u25/Steem.png"]}
created2019-01-04 23:05:15
last_update2019-01-04 23:09:51
depth0
children10
last_payout2019-01-11 23:05:15
cashout_time1969-12-31 23:59:59
total_payout_value58.382 HBD
curator_payout_value19.038 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,591
author_reputation72,516,729,960,969
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,885,754
net_rshares143,932,447,257,284
author_curate_reward""
vote details (1000)
@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)
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
last_payout2019-01-16 13:29:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length547
author_reputation3,706,960,754,901
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,129,803
net_rshares0
@crokkon · (edited)
$0.02
.
.
👍  
properties (23)
authorcrokkon
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190104t231902998z
categorysteem
json_metadata"{"app": ""}"
created2019-01-04 23:19:03
last_update2022-09-18 10:01:18
depth1
children1
last_payout2019-01-11 23:19:03
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.005 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1
author_reputation81,214,366,861,104
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,886,327
net_rshares44,270,731,242
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)
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
last_payout2019-01-12 00:16:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length119
author_reputation358,857,509,568,825
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,888,068
net_rshares969,891,509
author_curate_reward""
vote details (2)
@drotto ·
<p>This post has received a 1.56 % upvote from @drotto thanks to: @sbi-booster.</p>
properties (22)
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
last_payout2019-01-15 17:33:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length84
author_reputation419,916,705,599
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,085,121
net_rshares0
@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)
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
last_payout2019-01-14 11:08:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length574
author_reputation748,408,332,061,583
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,011,336
net_rshares0
@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)
authorpennsif
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190105t132047757z
categorysteem
json_metadata{"tags":["steem"],"image":["https://pennsif.com/wp-content/uploads/2018/08/adollaraday-linear-400x98.jpg"],"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"],"app":"steemit/0.1"}
created2019-01-05 13:20:48
last_update2019-01-05 13:20:48
depth1
children0
last_payout2019-01-12 13:20:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,002
author_reputation636,410,097,572,565
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,913,317
net_rshares0
@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)
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
last_payout2019-01-12 11:11:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length640
author_reputation23,214,230,978,060
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,908,007
net_rshares0
@steemvoter ·
@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)
authorsteemvoter
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190109t202101437z
categorysteem
json_metadata{"tags":["steem"],"users":["buildteam","steemvoter"],"image":["https://steemitimages.com/DQmQyUEXjJ16T7Gz76ZxrsykLPgrN2SYW26ike8kWpKJ3ea/image.png"],"app":"steemit/0.1"}
created2019-01-09 20:21:00
last_update2019-01-09 20:21:00
depth1
children0
last_payout2019-01-16 20:21:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length232
author_reputation205,124,311,476,054
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,146,741
net_rshares12,429,689,919
author_curate_reward""
vote details (1)
@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)
authorthecryptodrive
permlinkre-tcpolymath-make-multisig-transactions-with-beem-without-spending-all-day-in-the-transaction-builder-20190109t201943070z
categorysteem
json_metadata{"tags":["steem"],"users":["tcpolymath"],"app":"steemit/0.1"}
created2019-01-09 20:19:42
last_update2019-01-09 20:19:42
depth1
children0
last_payout2019-01-16 20:19:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length195
author_reputation103,594,115,164,820
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id78,146,698
net_rshares0
@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)
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
last_payout2019-01-11 23:22:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length410
author_reputation-4,535,154,553,995
root_title"Make Multisig transactions with Beem without spending all day in the transaction builder."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id77,886,499
net_rshares0