Skip to content

Change inputs and outputs of functions to align with the inputs and outputs on the MPC contract's sign function #14

@PiVortex

Description

@PiVortex

Because we migrated this library to use the updated arguments to the MPC contract (paylaod_v2) which we should encourage others to do, the outputs and inputs of our functions no longer align with the inputs and outputs on the MPC contract's sign function

If you are not using the the "sign" function provided by this library, because you are say calling a proxy contract, which we do in the case of the shade agent sandbox, then you will have to use the uint8ArrayToHex and toRSV util functions provided by this library. (Presuming your proxy contract takes the same args as the MPC contract does). Or maybe you want to sign the transaction to the MPC contract in a different way (delegate action).

It is nicer for:

  1. prepareTransactionForSigning to return the hashesToSign as a Hex String and sign to take a Hex String as the argument
  2. sign to not transform the signature in any way after getting the response from the MPC and for finalizeTransacitonSigning to take the same format for the input signatures.

There will be no differences for developers using the whole flow as show in near-multichain or this repo's examples but it will introduce breaking changes for those not using the whole flow.

The image below shows me having to use uint8ArraryToHex and toRSV as I am not using the sign function this library provides

Image

And here is an example for ed25519 signature which is different but a similar issue

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions