msteem - Multisignature transaction app

10개월 전
in steem

Repository

https://github.com/joticajulian/msteem

Webpage

https://joticajulian.github.io/msteem/

msteem

msteem is a webpage to modify the authorities of an account (owner, active, and posting keys) in order to support multisignatures. It also includes a page to sign any type of operation using multisignatures and broadcast it to the blockchain. This app has been developed to participate in the Steem developer bounty - 1500 STEEM - Multisignature Transaction Guide.

Part 1. Setting up multisignature authority

Step 1 - Load account

Open msteem and enter the account you want to modify. It will display the actual authorities (owner, active, posting) including weights and threshold.

1.png

Step 2 - Generate Keys if needed

If you want to generate new keys use the link at the top called Generate Keys. Over there put the account and the password of your preference.

2.png

Step 3 - Modify authorities

The website is very intuitive. You can:

  • Remove keys or accounts by clicking in the “X”
  • Add new keys or accounts specifying the public key and weight
  • Modify the threshold

Threshold: Every key or account has a weight associated. The threshold represents the total weight necessary for a transaction to be valid. For instance, 5 keys with a weight of 1 each one in the posting role, and a threshold of 3 means that a transaction needs at least 3 signatures to be valid.

Following the request of the task:

include an example that walks through the steps for this scenario: A user wants to have their active authority setup with seven keys. Keys one and two each have a weight of 25%. Keys three, four, five, six, and seven each have a weight of 10%. In order for a transaction to be valid, it must have at least 40% weighted signatures.

Generate different private and public keys as mentioned before. Save the private keys in a safe place, and only insert the public keys.

key/accountweight
STM6qcCgixB2VHbr6Pq2tDPSUY7u5sPvYbQsRQnn7PDd6SQkSsTq925
STM7B4ZB6g6aT9fWcFb6YgssjZcusH97rPcSzmFEru2b8Le36SkvD25
STM8dDCS2bAEpUPRxS7kGrfPE8kQ7FW4ZZLyJjhmbX6Jvieof3JfZ10
jga10
timcliff10
utopian-io10
ydavgonzalez10
Threshold40

In this example, I have included 3 keys and 4 accounts. The first two have a weight of 25, and the rest each have a weight of 10. The threshold is 40. This means that a transaction could be valid with the signature of the first two keys, or be valid with the signature of 4 keys with weight 10.

3.png

Step 3 - Generate operation

Go to the bottom and click on “Generate Operation”. It will create an operation for account_update and includes the role (or roles) modified. It also includes the actual json_metadata and memo_key of the account (needed values in the operation).

[
  "account_update",
  {
    "account": "fulanitodetal",
    "memo_key": "STM8Ls8rZTJGh2L9mkfrcH9cpXpz1uyoAwuNj5kUg6WGUXvBxQTeB",
    "json_metadata": "{}",
    "active": {
      "key_auths": [
        [
          "STM6qcCgixB2VHbr6Pq2tDPSUY7u5sPvYbQsRQnn7PDd6SQkSsTq9",
          25
        ],
        [
          "STM7B4ZB6g6aT9fWcFb6YgssjZcusH97rPcSzmFEru2b8Le36SkvD",
          25
        ],
        [
          "STM8dDCS2bAEpUPRxS7kGrfPE8kQ7FW4ZZLyJjhmbX6Jvieof3JfZ",
          10
        ]
      ],
      "account_auths": [
        [
          "jga",
          10
        ],
        [
          "timcliff",
          10
        ],
        [
          "utopian-io",
          10
        ],
        [
          "ydavgonzalez",
          10
        ]
      ],
      "weight_threshold": 40
    }
  }
]

Click on “Copy” or just select and copy the operation.

Step 4 - Sign and broadcast transaction

  • Click on "Sign Transaction" to open the page for signing operations
  • Paste the operation in the text area
  • Click on “Add headers” to include the operation in a transaction
  • Insert your private key and click sign. (your private key is not sent to any server or stored in the browser)

4.png

Finally click on “Broadcast Transaction” to send it to the blockchain. A message will appear telling if it was successful (including a link to the transaction) or if there is an error in the transaction.

5.png
Transaction on https://steemd.com/@fulanitodetal

Part 2. Sign any type of transaction

Step 1 - Write the operation

As you will realize, the sign page could be used to sign any type of transaction. To see a complete list of operations visit https://developers.steem.io/apidefinitions/#apidefinitions-broadcast-ops.

Following the request of the task:

example that walks through the steps for this scenario: One of the key holders of the account wants to transfer 5.0 STEEM tokens to another user. The transaction should be signed with keys one, four, and five (which would exceed the 40% threshold).

In this case the operation is

[
  "transfer",
  {
    "from": "fulanitodetal",
    "to": "jga",
    "amount": "5.000 STEEM",
    "memo": "test using multisignatures"
  }
]

Click on “Add headers” to include the operation in a transaction

Step 2 - Signatures

Now the transaction is ready to be signed. If you have all private keys insert one by one and click Sign. Following the example, when I put the private keys of:

key/accountweight
STM6qcCgixB2VHbr6Pq2tDPSUY7u5sPvYbQsRQnn7PDd6SQkSsTq925
STM8dDCS2bAEpUPRxS7kGrfPE8kQ7FW4ZZLyJjhmbX6Jvieof3JfZ10
jga10
Total weight45

Then these signatures are added to the transaction:

"signatures": [
"203b83b9bc0bcd4f043e506224dde9a45b3f6f6d949ef4f59a53e7651a8dab19c75a70d51c3ffe780c9e580cc51df8cd0e5547c5de17252bd66831b9b4a4293445",

"1f61514c26d10c4820d56a27d9d400867a018947533762091474b338be2bff68af4e1e8a228ff8a181899e74f9a8f4d9b2a45085390b45ac84357f8ce990c83d8c",

"2040e154eb8b3023c23275698ce165613d786fa50b433be4aa87e67dc39712cc99584418d67809b9ea24e2ad9cde54a0daf4aacfc54ac20507d0ab5139cd6543cc"
]

If instead, you don’t have the required private keys, send the transaction to the authorized people, ask them to sign and send back to you the signatures. At the end just append all signatures as shown above.

Step 3 - Broadcast transaction

Now the transaction is ready to be broadcasted to the blockchain. Click on “Broadcast Transaction”. A message will appear telling if it was successful (including a link to the transaction) or if there is an error in the transaction.

6.png
Transaction 8330650be8d363c9f0a27d18508dc0493df1a75b

Technology Stack

This page was developed in vue.js and uses the dsteem library to query, sign and broadcast transactions to the blockchain.
Although it asks for the user’s private keys, these are never sent to any server or stored in the browser. It only uses them to sign the transaction. I would have liked to use steemconnect, however at present, steemconnect do not support updates to authorities.

Relevant commits

GitHub Account

https://github.com/joticajulian

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
STEEMKR.COM IS SPONSORED BY
ADVERTISEMENT
Sort Order:  trending
  • Good article that feels like something between an announcement post and a tutorial.
  • Think about adding code samples to your next posts as this should
    be development article
  • The code looks good, and the demo site is a nice touch.
  • Perhaps this is not needed:

    or this: msteem/src/components/HelloWorld.vue

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

·

Thank you for your review, @helo! Keep up the good work!

Hey @jga,

I'd really like the chance to chat with you about this site you have. It is a great site and I look forward to seeing your updates on it.

I have an offer for you. The HoboDAO is a concept of creating a federation of multisig accounts formed like DAOs for the creation of a decentralized curation community empowered by its own token.

Your site helps non-techies navigate multisig operations. This is perfect for the HoboDAO project. We're a small project, but we're really picking up steam. We now have 17,500 SP delegations and we're gaining delegations by the day.

The Hobo token is selling at low volume but there is daily liquidity on the SE market and we're not even running our curation program yet. We have many delegators delegating to earn tokens on a monthly basis and several people have enrolled in our Ambassador program to translate our announcements to local language communities.

I would very much like to coordinate with you to see if you would agree to support our project by managing your own msteem site for our community.

If you agreed to join our discord server and act as tech support to our members when they have difficulty using your site, we would reward you in 100,000 Hobo tokens per month.

This is a negotiable point, but if you would make your site available via IPFS it is something our project very much wants for decentralization.

Please accept an invitation to join the HoboDAO project as a member in this decentralized community and join our discord server here: https://discord.gg/TFzSuYE

·

ok, interesting, let's talk about the project!

Thanks for your entry @jga, your submission is a good one for the Multisig bounty, however winners were already finalised on a first acceptable entry basis; @BuildTeam will still be sponsoring you a Steemvoter Guild vote for your great efforts, incoming shortly.

This story was recommended by Steeve to its users and upvoted by one or more of them.

Check @steeveapp to learn more about Steeve, an AI-powered Steem interface.

@buildteam and @steemvoter are proud to award you a Steemvoter Guild vote for your efforts in contributing to the multisig bounty.

Thanks for your work.
Really excited about multi signature

Posted using Partiko Android

This post has been included in the latest edition of SOS Daily News - a digest of all you need to know about the State of Steem.



Hi @jga!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Congratulations @jga! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 5000 upvotes. Your next target is to reach 6000 upvotes.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

SteemWhales has officially moved to SteemitBoard Ranking
SteemitBoard - Witness Update

Support SteemitBoard's project! Vote for its witness and get one more award!

Hey, @jga!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Dear @jga

Are you still visiting Steemit sometimes? I would like to get in touch with you if you don't mind.

Would you be kind and tell me what language did you use to create your site?

https://joticajulian.github.io/check-votes/

Yours
Piotr

·

hi @crypto.piotr. Yes, you can contact me here, or in discord #jga0699.
In check votes I use javascript and jquery, and the steem-js library to interact with the blockchain. But in my recent contributions I use vue-js instead of jquery.