Skip to content

bug(rs-dpp): cannot sign token transfer with AUTHENTICATION HIGH and MEDIUM security level keys #3221

@pshenmic

Description

@pshenmic

Issue

TokenTransfer transition (Batch) let you make a transaction signed with two possible purpose types: Transfer and Authentication.
With transfers, everything works perfectly, but there are some inconsistencies in with Authentication security level keys.

Rust DPP's state_transition.getPurpose() correctly return a list of possible key purposes (Authentication, Transfer)
Rust DPP's state_transition.getSecurityLevel(purpose) correctly return a list possible security levels for authentication purpose keys (Critical, High, Medium)

However, when you try to sign the transaction with Rust DPP with Authentication High or Authentication Medium key, .sign() method throw such error:

Invalid public key security level HIGH. The state transition requires one of CRITICAL

It looks like there is a bug in rs-dpp which prevents user to sign such transactions, although they could be accepted by the network.

Possible Solution

Correct .sign() to allow such keys

Steps to Reproduce (for bugs)

  1. Create token transfer transition
  2. Try to sign such transaction with authentication high key
  3. The error will be thrown

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop, server, or mobile):
  • Link to your project:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeffort: SSmall effort — a few hours or lesspriority: mediumMedium priorityrs-sdk

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions