CodeChain-io/codechain-sdk-js

Change the interface of signature

Closed this issue · 2 comments

Currently, either string (r,s,v encoded) or interface { r: string, s: string, v: number } is used, including sign() in the keystore.

We need to sort this out.

primitives

interface EcdsaSignature {
    r: string;
    s: string;
    v: number;
}

signEcdsa()
verifyEcdsa()
recoverEcdsa()

interface SchnorrSignature {
    r: string;
    s: string;
}

signSchnorr()
verifySchnorr()
recoverSchnorr()

keystore

sign(...): string

SDK

SDK.Rpc.account.sign(...): string
SignedParcel.convertRsvToSignatureString()

I think it's good to remove the r,s,v interface because we don't need individual value and it more suits CodeChain RPC API.