Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.2 #8

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Version 1.2 #8

wants to merge 8 commits into from

Conversation

bgornicki
Copy link

[1.2.0] - 2023-02-16

Feature

  • Message signing command

Fixed

  • use varint when necessary
  • add empty extensions encoders for some operation types

Features

This version introduces a new feature called signMessage. The intention of this feature is to get the possibility to sign a human-readable buffer that could be used to verify if the user has access to the private key for the specified public key.

This method is widely used within the Hive ecosystem to log in to multiple decentralized applications. Those apps can read the account's posting public key from the blockchain, ask the user to sign the message, and verify the signature against the public key.

An example implementation of such a mechanism can be found in a test file: test/tests/signMessage.test.ts.

Fixes

Some serializers were wrongly implemented. For example, a string serializer uses a variable-length encoding which means that the size of the "length" property can vary from 1 up to 4 bytes. The previous implementation incorrectly assumed that the length of the string cannot take more than one byte (uint8_t). A new method for buffer operation was introduced to read a varint, therefore fixing some serializers (like string and array).

Appropriate unit tests were updated and added if necessary.

Moreover, some operation decoders were missing additional extension properties which resulted in a wrong signature for such operation types. This is fixed now. One example is the recurrent_transfer operation which was impossible to broadcast as the ledger application generated an incorrect signature for a transaction with such an operation.

To test this fix, it is recommended to use hive-ledger-cli application and broadcast the recurrent transfer. Example: hive-ledger-cli recurrent-transfer "m/48'/13'/0'/1'/0'" "engrave" "engrave.cold" "0.001 HIVE" 30 3

Improvements

Some additional global variables were introduced to share between different signing methods, resulting in lower RAM consumption which allowed me to increase the maximum string length that can be handled by the application. This makes it possible to sign more operations without using the blind signing method, increasing the overall security of the Hive application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants