ECDSAP1KeyshareV2 class
This class contains the ECDSA cryptographic information in low-level APIs for the two-party MPC, and high-level JS APIs for the mobile application to consume.
Import
import { ECDSAP1KeyshareV2 } from '@silencelaboratories/react-native-two-party-ecdsa';
Methods
The all methods are interacted with React-Native
's NativeModules
and return a Promise
that resolves to the result of the operation.
The most string parameters and return values are
base64
encoded and prefixed.
Get public key of the key share in base64 string
async getPublicKey(): Promise<string>;
// Example usage
const publicKey = await keyshare.getPublicKey();
Get key id of the key share in base64 string
async getKeyId(): Promise<string>
// Example usage
const keyId = await keyshare.getKeyId();
Get base64 string representation of the key share
async toBase64String(): Promise<string>;
// Example usage
const base64Keyshare = await keyshare.toBase64String();
Create a key share from base64 string
static async fromBase64String(base64Keyshare: string): Promise<ECDSAP1KeyshareV2>;
// Example usage
const keyshare = await ECDSAP1KeyshareV2.fromBase64String(base64Keyshare);
Get the bytes representation of the key pair
async toBytes(): Promise<Uint8Array>;
// Example usage
const bytes = await keyshare.toBytes();
Create a key share from bytes
static async fromBytes(bytes: Uint8Array): Promise<ECDSAP1KeyshareV2>;
// Example usage
const keyshare = await ECDSAP1KeyshareV2.fromBytes(bytes);
Last updated