msteem - Multisignature transaction app

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

H2
H3
H4
3 columns
2 columns
1 column
14 Comments
Ecency