@xchainjs/xchain-crypto
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

XCHAIN-CRYPTO

The XCHAIN CRYPTO package is a crypto package used by all XCHAIN clients.

XCHAIN-CRYPTO encrypts a master phrase to a keystore. This keystore can then be exported to other XCHAIN wallets or stored securely.

Users can export their phrase and import them into other wallets since it is a BIP39 compatible phrase.

Installation

  • Install @xchainjs/xchain-crypto from npm
yarn add @xchainjs/xchain-crypto

Documentation

How xchain-crypto works
How to use xchain-crypto

Build

yarn build

Tests

yarn test

Constants

// Crypto Constants for xchain
const cipher = 'aes-128-ctr'
const kdf = 'pbkdf2'
const prf = 'hmac-sha256'
const dklen = 32
const c = 262144
const hashFunction = 'sha256'
const meta = 'xchain-keystore'

Keystore Type

export type Keystore = {
  address: string
  crypto: {
    cipher: string
    ciphertext: string
    cipherparams: {
      iv: string
    }
    kdf: string
    kdfparams: {
      prf: string
      dklen: number
      salt: string
      c: number
    }
    mac: string
  }
  id: string
  version: number
  meta: string
}

Readme

Keywords

none

Package Sidebar

Install

npm i @xchainjs/xchain-crypto

Weekly Downloads

1,061

Version

0.3.2

License

MIT

Unpacked Size

291 kB

Total Files

11

Last publish

Collaborators

  • thorianite
  • polaris_9r
  • thorchain_org
  • _stu
  • veado
  • thatstrangeguy
  • junkai121
  • sarawut11
  • thorswap
  • hodrthemediocre