Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neon-exchange/nash-protocol

Package Overview
Dependencies
Maintainers
11
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neon-exchange/nash-protocol - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

docs/assets/css/main.css

6

build/main/bufferize/bufferize.d.ts
/// <reference types="node" />
/**
* Converts a hex string to a buffer. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
export default function bufferize(str: string): Buffer;

8

build/main/bufferize/bufferize.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Converts a hex string to a buffer. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
function bufferize(str) {

@@ -7,2 +13,2 @@ return Buffer.from(str, 'hex');

exports.default = bufferize;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVyaXplLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2J1ZmZlcml6ZS9idWZmZXJpemUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxTQUF3QixTQUFTLENBQUMsR0FBVztJQUMzQyxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFBO0FBQ2hDLENBQUM7QUFGRCw0QkFFQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVyaXplLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2J1ZmZlcml6ZS9idWZmZXJpemUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7R0FLRztBQUNILFNBQXdCLFNBQVMsQ0FBQyxHQUFXO0lBQzNDLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUE7QUFDaEMsQ0FBQztBQUZELDRCQUVDIn0=
/// <reference types="node" />
import AEAD from '../types/AEAD';
/**
* Decrypts an encrypted secret key via AEAD. Takes an `AEAD` object.
*
* See `encryptSecretKey.ts`.
*/
export default function decryptSecretKey(encryptionKey: Buffer, aead: AEAD): Promise<Buffer>;

8

build/main/decryptSecretKey/decryptSecretKey.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const browserify_aes_1 = require("browserify-aes");
// tslint:disable:no-expression-statement
/**
* Decrypts an encrypted secret key via AEAD. Takes an `AEAD` object.
*
* See `encryptSecretKey.ts`.
*/
function decryptSecretKey(encryptionKey, aead) {

@@ -21,2 +25,2 @@ const { encryptedSecretKey, nonce, tag } = aead;

exports.default = decryptSecretKey;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjcnlwdFNlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9kZWNyeXB0U2VjcmV0S2V5L2RlY3J5cHRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtREFBaUQ7QUFJakQseUNBQXlDO0FBQ3pDLFNBQXdCLGdCQUFnQixDQUFDLGFBQXFCLEVBQUUsSUFBVTtJQUN4RSxNQUFNLEVBQUUsa0JBQWtCLEVBQUUsS0FBSyxFQUFFLEdBQUcsRUFBRSxHQUFHLElBQUksQ0FBQTtJQUMvQyxNQUFNLFFBQVEsR0FBRyxpQ0FBZ0IsQ0FBQyxhQUFhLEVBQUUsYUFBYSxFQUFFLEtBQUssRUFBRTtRQUNyRSxhQUFhLEVBQUUsRUFBRTtLQUNsQixDQUFDLENBQUE7SUFFRixRQUFRLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQy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QUMsQ0FBQTtJQUV4RCxJQUFJO1FBQ0YsT0FBTyxPQUFPLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQyxZQUFZLEVBQUUsUUFBUSxDQUFDLEtBQUssRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFBO0tBQ3hFO0lBQUMsT0FBTyxDQUFDLEVBQUU7UUFDVix3QkFBd0I7UUFDeEIsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFBO0tBQ3pCO0FBQ0gsQ0FBQztBQWZELG1DQWVDIn0=
/// <reference types="node" />
import AEAD from '../types/AEAD';
/**
* Encrypts a secret key via AEAD. Returns an `AEAD` object. This object is
* stored server-side, while the encryption key is never stored. When
* authenticating, the server returns the `AEAD` object while the client must
* generate the encryption key on the fly from the user's password using
* `getHKDFKeyFromPassword.ts`.
*
* Uses [`aes-256-gcm`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* See `decryptSecretKey.ts`.
*/
export default function encryptSecretKey(encryptionKey: Buffer, secretKey: Buffer): AEAD;

@@ -9,4 +9,13 @@ "use strict";

const NONCE_SIZE = 12;
// Reference: https://nodejs.org/api/crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options
// tslint:disable:no-expression-statement
/**
* Encrypts a secret key via AEAD. Returns an `AEAD` object. This object is
* stored server-side, while the encryption key is never stored. When
* authenticating, the server returns the `AEAD` object while the client must
* generate the encryption key on the fly from the user's password using
* `getHKDFKeyFromPassword.ts`.
*
* Uses [`aes-256-gcm`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* See `decryptSecretKey.ts`.
*/
function encryptSecretKey(encryptionKey, secretKey) {

@@ -17,4 +26,2 @@ const nonce = randomBytes_1.default(NONCE_SIZE);

});
// do we need additional authenticated data? what data should be used here?
// cipher.setAAD(some known)
const encryptedSecretKey = Buffer.concat([cipher.update(secretKey), cipher.final()]);

@@ -29,2 +36,2 @@ const tag = cipher.getAuthTag();

exports.default = encryptSecretKey;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jcnlwdFNlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbmNyeXB0U2VjcmV0S2V5L2VuY3J5cHRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxtREFBK0M7QUFFL0MsaUVBQXdDO0FBR3hDLE1BQU0sVUFBVSxHQUFHLEVBQUUsQ0FBQTtBQUVyQixzR0FBc0c7QUFDdEcseUNBQXlDO0FBQ3pDLFNBQXdCLGdCQUFnQixDQUFDLGFBQXFCLEVBQUUsU0FBaUI7SUFDL0UsTUFBTSxLQUFLLEdBQUcscUJBQVcsQ0FBQyxVQUFVLENBQUMsQ0FBQTtJQUVyQyxNQUFNLE1BQU0sR0FBRywrQkFBYyxDQUFDLGFBQWEsRUFBRSxhQUFhLEVBQUUsS0FBSyxFQUFFO1FBQ2pFLGFBQWEsRUFBRSxFQUFFO0tBQ2xCLENBQUMsQ0FBQTtJQUVGLDJFQUEyRTtJQUMzRSw0QkFBNEI7SUFFNUIsTUFBTSxrQkFBa0IsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsRUFBRSxNQUFNLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFBO0lBRXBGLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxVQUFVLEVBQUUsQ0FBQTtJQUUvQixPQUFPO1FBQ0wsa0JBQWtCO1FBQ2xCLEtBQUs7UUFDTCxHQUFHO0tBQ0osQ0FBQTtBQUNILENBQUM7QUFuQkQsbUNBbUJDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jcnlwdFNlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbmNyeXB0U2VjcmV0S2V5L2VuY3J5cHRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxtREFBK0M7QUFFL0MsaUVBQXdDO0FBR3hDLE1BQU0sVUFBVSxHQUFHLEVBQUUsQ0FBQTtBQUVyQjs7Ozs7Ozs7OztHQVVHO0FBQ0gsU0FBd0IsZ0JBQWdCLENBQUMsYUFBcUIsRUFBRSxTQUFpQjtJQUMvRSxNQUFNLEtBQUssR0FBRyxxQkFBVyxDQUFDLFVBQVUsQ0FBQyxDQUFBO0lBRXJDLE1BQU0sTUFBTSxHQUFHLCtCQUFjLENBQUMsYUFBYSxFQUFFLGFBQWEsRUFBRSxLQUFLLEVBQUU7UUFDakUsYUFBYSxFQUFFLEVBQUU7S0FDbEIsQ0FBQyxDQUFBO0lBRUYsTUFBTSxrQkFBa0IsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsRUFBRSxNQUFNLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFBO0lBRXBGLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxVQUFVLEVBQUUsQ0FBQTtJQUUvQixPQUFPO1FBQ0wsa0JBQWtCO1FBQ2xCLEtBQUs7UUFDTCxHQUFHO0tBQ0osQ0FBQTtBQUNILENBQUM7QUFoQkQsbUNBZ0JDIn0=

@@ -9,6 +9,25 @@ /// <reference types="node" />

}
/**
* Creates a wallet for a given token via the
* [BIP-44 protocol]((https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* Requires the user's master seed.
*/
export declare function generateWallet(masterSeed: Buffer, coinType: CoinType, index: number, net?: string): Wallet;
/**
* Creates the keypair used for signing payloads. Used during Nash Protocol
* initialization.
*/
export declare function generateNashPayloadSigningKey(masterSeed: Buffer, index: number): Wallet;
/**
* Generates a deterministic key according to the BIP-44 spec.
*
* `M' / purpose' / coin' / account' / change / index`
* `M' / 44' / coin' / 0' / 0`
*/
export declare function generateBIP44Key(masterSeed: Buffer, coinType: CoinType, index: number): bip32.BIP32Interface;
/**
* Derives a new key from the extended key for the given index.
*/
export declare function deriveIndex(extendedKey: bip32.BIP32Interface, index: number): bip32.BIP32Interface;
export declare const coinTypeFromString: (s: string) => CoinType;

@@ -26,2 +26,8 @@ "use strict";

})(CoinType = exports.CoinType || (exports.CoinType = {}));
/**
* Creates a wallet for a given token via the
* [BIP-44 protocol]((https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* Requires the user's master seed.
*/
function generateWallet(masterSeed, coinType, index, net) {

@@ -33,2 +39,6 @@ const key = derivePath(masterSeed, bip44Purpose, coinType, 0, 0);

exports.generateWallet = generateWallet;
/**
* Creates the keypair used for signing payloads. Used during Nash Protocol
* initialization.
*/
function generateNashPayloadSigningKey(masterSeed, index) {

@@ -48,5 +58,8 @@ const extendedKey = derivePath(masterSeed, nashPurpose, 0, 0, 0);

exports.generateNashPayloadSigningKey = generateNashPayloadSigningKey;
// Generates a deterministic key according to the BIP44 spec.
// M' / purpose' / coin' / account' / change / index
// M' / 44' / coin' / 0' / 0
/**
* Generates a deterministic key according to the BIP-44 spec.
*
* `M' / purpose' / coin' / account' / change / index`
* `M' / 44' / coin' / 0' / 0`
*/
function generateBIP44Key(masterSeed, coinType, index) {

@@ -58,3 +71,5 @@ const extendedKey = derivePath(masterSeed, bip44Purpose, coinType, 0, 0);

exports.generateBIP44Key = generateBIP44Key;
// Derives a new key from the extended key for the given index.
/**
* Derives a new key from the extended key for the given index.
*/
function deriveIndex(extendedKey, index) {

@@ -90,2 +105,4 @@ return extendedKey.derive(index);

case CoinType.ETH:
// TODO: can we replace this with the elliptic package which we already
// use to trim bundle size?
const pubkey = tiny.pointFromScalar(key.privateKey, false);

@@ -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Q0FBQyxDQUFBO0FBRUQsTUFBTSx3QkFBd0IsR0FBRyxDQUFDLEdBQXVCLEVBQW1CLEVBQUU7SUFDNUUsUUFBUSxHQUFHLEVBQUU7UUFDWCxLQUFLLFNBQVM7WUFDWixPQUFPLE9BQU8sQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFBO1FBQ2pDLEtBQUssU0FBUztZQUNaLE9BQU8sT0FBTyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUE7UUFDakMsS0FBSyxVQUFVO1lBQ2IsT0FBTyxPQUFPLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQTtRQUNqQztZQUNFLE9BQU8sT0FBTyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUE7S0FDbEM7QUFDSCxDQUFDLENBQUE7QUFFRCxTQUFTLFVBQVUsQ0FDakIsVUFBa0IsRUFDbEIsT0FBZSxFQUNmLFFBQWtCLEVBQ2xCLE9BQWUsRUFDZixNQUFjO0lBRWQsTUFBTSxTQUFTLEdBQUcsS0FBSyxDQUFDLFFBQVEsQ0FBQyxVQUFVLENBQUMsQ0FBQTtJQUM1QyxPQUFPLFNBQVM7U0FDYixjQUFjLENBQUMsT0FBTyxDQUFDO1NBQ3ZCLGNBQWMsQ0FBQyxRQUFRLENBQUM7U0FDeEIsY0FBYyxDQUFDLE9BQU8sQ0FBQztTQUN2QixNQUFNLENBQUMsTUFBTSxDQUFDLENBQUE7QUFDbkIsQ0FBQyJ9
import HKDFKeys from '../types/HKDFKeys';
/**
* Derives two keys from a given input key via
* [HKDF](https://en.wikipedia.org/wiki/HKDF).
*
* Specifically, we use this to derive keys from a user's hashed password and
* never use the hashed password directly. Thus, if one derived key is
* compromised, other keys are not affected.
*
* See the `HKDFKeys` interface for information on how Nash uses these keys.
*/
export default function getHKDFKeysFromPassword(password: string, salt: string): Promise<HKDFKeys>;

@@ -7,7 +7,2 @@ "use strict";

const futoin_hkdf_1 = __importDefault(require("futoin-hkdf"));
/*
HKDF seems easy enough to implement on top of crypto.createHmac which would
allow us to reduce external dependencies.
https://en.wikipedia.org/wiki/HKDF#Example:_Python_implementation
*/
const hashPassword_1 = __importDefault(require("../hashPassword"));

@@ -17,9 +12,16 @@ /*

*/
// TODO: We're expanding the key here right? The scrypted key is already len=32. Do we want this to be longer?
const length = 32;
const hash = 'SHA-256';
/**
* Derives two keys from a given input key via
* [HKDF](https://en.wikipedia.org/wiki/HKDF).
*
* Specifically, we use this to derive keys from a user's hashed password and
* never use the hashed password directly. Thus, if one derived key is
* compromised, other keys are not affected.
*
* See the `HKDFKeys` interface for information on how Nash uses these keys.
*/
async function getHKDFKeysFromPassword(password, salt) {
const hashed = await hashPassword_1.default(password, salt);
// TODO: do we need to salt here again? If the original input is already hashed we shouldn't need to salt again right?
// Does it matter?
return {

@@ -31,2 +33,2 @@ authKey: futoin_hkdf_1.default(hashed, length, { hash, info: 'auth', salt }),

exports.default = getHKDFKeysFromPassword;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0SEtERktleXNGcm9tUGFzc3dvcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZ2V0SEtERktleXNGcm9tUGFzc3dvcmQvZ2V0SEtERktleXNGcm9tUGFzc3dvcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw4REFBOEI7QUFDOUI7Ozs7R0FJRztBQUNILG1FQUEwQztBQUcxQzs7R0FFRztBQUNILDhHQUE4RztBQUM5RyxNQUFNLE1BQU0sR0FBRyxFQUFFLENBQUE7QUFDakIsTUFBTSxJQUFJLEdBQUcsU0FBUyxDQUFBO0FBRVAsS0FBSyxVQUFVLHVCQUF1QixDQUFDLFFBQWdCLEVBQUUsSUFBWTtJQUNsRixNQUFNLE1BQU0sR0FBRyxNQUFNLHNCQUFZLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxDQUFBO0lBRWpELHN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UFhLEVBQUUscUJBQUksQ0FBQyxNQUFNLEVBQUUsTUFBTSxFQUFFLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxZQUFZLEVBQUUsSUFBSSxFQUFFLENBQUM7S0FDeEUsQ0FBQTtBQUNILENBQUM7QUFQRCwwQ0FPQyJ9
/// <reference types="node" />
/**
* Generates a secret key of Nash's desired length from a random entropy.
*
* This secret key is ultimately the foundation of a user's wallets, so should
* be treated with extreme care.
*/
export default function getSecretKey(): Buffer;

@@ -10,2 +10,8 @@ "use strict";

const SECRET_KEY_SIZE_BYTES = 16;
/**
* Generates a secret key of Nash's desired length from a random entropy.
*
* This secret key is ultimately the foundation of a user's wallets, so should
* be treated with extreme care.
*/
function getSecretKey() {

@@ -15,2 +21,2 @@ return randomBytes_1.default(SECRET_KEY_SIZE_BYTES);

exports.default = getSecretKey;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U2VjcmV0S2V5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2dldFNlY3JldEtleS9nZXRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxpRUFBd0M7QUFFeEMsOERBQThEO0FBQzlELHFCQUFxQjtBQUNyQixNQUFNLHFCQUFxQixHQUFHLEVBQUUsQ0FBQTtBQUVoQyxTQUF3QixZQUFZO0lBQ2xDLE9BQU8scUJBQVcsQ0FBQyxxQkFBcUIsQ0FBQyxDQUFBO0FBQzNDLENBQUM7QUFGRCwrQkFFQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U2VjcmV0S2V5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2dldFNlY3JldEtleS9nZXRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxpRUFBd0M7QUFFeEMsOERBQThEO0FBQzlELHFCQUFxQjtBQUNyQixNQUFNLHFCQUFxQixHQUFHLEVBQUUsQ0FBQTtBQUVoQzs7Ozs7R0FLRztBQUNILFNBQXdCLFlBQVk7SUFDbEMsT0FBTyxxQkFBVyxDQUFDLHFCQUFxQixDQUFDLENBQUE7QUFDM0MsQ0FBQztBQUZELCtCQUVDIn0=
/// <reference types="node" />
/**
* Hashes a plaintext password via the
* [scrypt key derivation function](https://en.wikipedia.org/wiki/Scrypt).
*/
export default function hashPassword(password: string, salt: string): Promise<Buffer>;

@@ -9,8 +9,6 @@ "use strict";

/*
scrypt parameters recommended by spec document.
Scrypt parameters
N given by Cure53; 2^20 === 1048576. However this takes unacceptably long; using
2^16 === 65536 for now.
The salt should be the user email.
Suggested N is 2^20 === 1048576. However this takes unacceptably long; using
2^16 === 65536 is acceptable.
*/

@@ -21,2 +19,6 @@ const N = 2 ** 16;

const dkLen = 32;
/**
* Hashes a plaintext password via the
* [scrypt key derivation function](https://en.wikipedia.org/wiki/Scrypt).
*/
function hashPassword(password, salt) {

@@ -35,2 +37,2 @@ return new Promise(res => scrypt_js_1.default(normalizeString_1.default(password), normalizeString_1.default(salt), N, r, p, dkLen, (error, _, key) => {

exports.default = hashPassword;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFzaFBhc3N3b3JkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2hhc2hQYXNzd29yZC9oYXNoUGFzc3dvcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSwwREFBOEI7QUFFOUIsK0VBQXNEO0FBRXREOzs7Ozs7O0dBT0c7QUFDSCxNQUFNLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxDQUFBO0FBQ2pCLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQTtBQU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xDQUFDLENBQUE7QUFDWCxNQUFNLEtBQUssR0FBRyxFQUFFLENBQUE7QUFFaEI7OztHQUdHO0FBQ0gsU0FBd0IsWUFBWSxDQUFDLFFBQWdCLEVBQUUsSUFBWTtJQUNqRSxPQUFPLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQ3ZCLG1CQUFNLENBQUMseUJBQWUsQ0FBQyxRQUFRLENBQUMsRUFBRSx5QkFBZSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLEtBQUssRUFBRSxDQUFDLEtBQVksRUFBRSxDQUFTLEVBQUUsR0FBVyxFQUFFLEVBQUU7UUFDaEgsc0VBQXNFO1FBQ3RFLElBQUksS0FBSyxFQUFFO1lBQ1QsTUFBTSxLQUFLLENBQUE7U0FDWjtRQUVELG9FQUFvRTtRQUNwRSxJQUFJLEdBQUcsRUFBRTtZQUNQLE9BQU8sR0FBRyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtTQUM3QjtJQUNILENBQUMsQ0FBQyxDQUNILENBQUE7QUFDSCxDQUFDO0FBZEQsK0JBY0MifQ==
/// <reference types="node" />
/**
* Converts a BIP-39 mnemonic to its master seed representation. This
* representation is used to generate blockchain wallets.
*/
export default function mnemonicToMasterSeed(mnemonic: ReadonlyArray<string>): Buffer;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bip39_1 = require("bip39");
// We might want to customize this down the line but this works out of the box for now.
/**
* Converts a BIP-39 mnemonic to its master seed representation. This
* representation is used to generate blockchain wallets.
*/
function mnemonicToMasterSeed(mnemonic) {

@@ -9,2 +12,2 @@ return bip39_1.mnemonicToSeed(mnemonic.join(' '));

exports.default = mnemonicToMasterSeed;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb01hc3RlclNlZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbW5lbW9uaWNUb01hc3RlclNlZWQvbW5lbW9uaWNUb01hc3RlclNlZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxpQ0FBc0M7QUFFdEMsdUZBQXVGO0FBQ3ZGLFNBQXdCLG9CQUFvQixDQUFDLFFBQStCO0lBQzFFLE9BQU8sc0JBQWMsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUE7QUFDM0MsQ0FBQztBQUZELHVDQUVDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb01hc3RlclNlZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbW5lbW9uaWNUb01hc3RlclNlZWQvbW5lbW9uaWNUb01hc3RlclNlZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxpQ0FBc0M7QUFFdEM7OztHQUdHO0FBQ0gsU0FBd0Isb0JBQW9CLENBQUMsUUFBK0I7SUFDMUUsT0FBTyxzQkFBYyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtBQUMzQyxDQUFDO0FBRkQsdUNBRUMifQ==
/// <reference types="node" />
/**
* Converts a BIP-39 mnemonic to its secret key representation.
*
* See `secretKeyToMnemonic.ts`.
*/
export default function mnemonicToSecretKey(mnemonic: ReadonlyArray<string>): Buffer;

@@ -8,2 +8,7 @@ "use strict";

const bufferize_1 = __importDefault(require("../bufferize"));
/**
* Converts a BIP-39 mnemonic to its secret key representation.
*
* See `secretKeyToMnemonic.ts`.
*/
function mnemonicToSecretKey(mnemonic) {

@@ -13,2 +18,2 @@ return bufferize_1.default(bip39_1.mnemonicToEntropy(mnemonic.join(' ')));

exports.default = mnemonicToSecretKey;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb1NlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tbmVtb25pY1RvU2VjcmV0S2V5L21uZW1vbmljVG9TZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxpQ0FBeUM7QUFFekMsNkRBQW9DO0FBRXBDLFNBQXdCLG1CQUFtQixDQUFDLFFBQStCO0lBQ3pFLE9BQU8sbUJBQVMsQ0FBQyx5QkFBaUIsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQTtBQUN6RCxDQUFDO0FBRkQsc0NBRUMifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb1NlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tbmVtb25pY1RvU2VjcmV0S2V5L21uZW1vbmljVG9TZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxpQ0FBeUM7QUFFekMsNkRBQW9DO0FBRXBDOzs7O0dBSUc7QUFDSCxTQUF3QixtQkFBbUIsQ0FBQyxRQUErQjtJQUN6RSxPQUFPLG1CQUFTLENBQUMseUJBQWlCLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUE7QUFDekQsQ0FBQztBQUZELHNDQUVDIn0=

@@ -0,1 +1,4 @@

/**
* IDs mapping Nash Matching Engine operations with handling strategies.
*/
export declare enum SigningPayloadID {

@@ -2,0 +5,0 @@ listOrderPayload = 0,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const payload_1 = require("./payload");
// This is currently the same as api-client-ts/constants/PayloadID
/**
* IDs mapping Nash Matching Engine operations with handling strategies.
*/
var SigningPayloadID;

@@ -114,2 +116,2 @@ (function (SigningPayloadID) {

exports.kindToOrderPrefix = kindToOrderPrefix;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmluZ1BheWxvYWRJRC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYXlsb2FkL3NpZ25pbmdQYXlsb2FkSUQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx1Q0FBdUU7QUFFdkUsa0VBQWtFO0FBQ2xFLElBQVksZ0JBZ0NYO0FBaENELFdBQVksZ0JBQWdCO0lBQzFCLCtFQUFvQixDQUFBO0lBQ3BCLG1GQUFzQixDQUFBO0lBQ3RCLGlHQUE2QixDQUFBO0lBQzdCLCtGQUE0QixDQUFBO0lBQzVCLHVGQUF3QixDQUFBO0lBQ3hCLCtGQUE0QixDQUFBO0lBQzVCLCtGQUE0QixDQUFBO0lBQzVCLG1GQUFzQixDQUFBO0lBQ3RCLDZFQUFtQixDQUFBO0lBRW5CLGlFQUFpRTtJQUNqRSwyRkFBMEIsQ0FBQTtJQUMxQixvR0FBK0IsQ0FBQTtJQUMvQixzR0FBZ0MsQ0FBQTtJQUNoQyw4RkFBNEIsQ0FBQTtJQUM1QixvRkFBdUIsQ0FBQTtJQUN2QixnRkFBcUIsQ0FBQTtJQUVyQiw0RkFBMkIsQ0FBQTtJQUMzQiw0R0FBbUMsQ0FBQTtJQUNuQyxvR0FBK0IsQ0FBQTtJQUUvQixnRkFBcUIsQ0FBQTtJQUNyQixrRkFBc0IsQ0FBQTtJQUN0QiwwRkFBMEIsQ0FBQTtJQUMxQixnR0FBNkIsQ0FBQTtJQUM3QixzSEFBd0MsQ0FBQTtJQUN4QyxvSEFBdUMsQ0FBQTtJQUV2QyxzR0FBZ0MsQ0FBQTt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0FBQyxrQkFBa0IsQ0FBQTtBQUM5RixDQUFDO0FBRkQsd0NBRUM7QUFFRCxTQUFnQixtQkFBbUIsQ0FBQyxJQUFzQjtJQUN4RCxPQUFPLElBQUksS0FBSyxnQkFBZ0IsQ0FBQyxzQkFBc0IsSUFBSSxJQUFJLEtBQUssZ0JBQWdCLENBQUMsMEJBQTBCLENBQUE7QUFDakgsQ0FBQztBQUZELGtEQUVDO0FBRUQsNkVBQTZFO0FBQzdFLFNBQWdCLGlCQUFpQixDQUFDLElBQXNCLEVBQUUsT0FBYTtJQUNyRSxJQUFJLElBQUksS0FBSyxnQkFBZ0IsQ0FBQyxnQkFBZ0IsRUFBRTtRQUM5QyxPQUFPLElBQUksQ0FBQTtLQUNaO0lBQ0QsSUFBSSxjQUFjLENBQUMsSUFBSSxDQUFDLEVBQUU7UUFDeEIsT0FBTyxJQUFJLENBQUE7S0FDWjtJQUNELElBQUksSUFBSSxLQUFLLGdCQUFnQixDQUFDLGtCQUFrQixJQUFJLE9BQU8sQ0FBQyxJQUFJLEtBQUssNkJBQW1CLEVBQUU7UUFDeEYsT0FBTyxJQUFJLENBQUE7S0FDWjtJQUNELElBQUksSUFBSSxLQUFLLGdCQUFnQixDQUFDLGtCQUFrQixJQUFJLE9BQU8sQ0FBQyxJQUFJLEtBQUssZ0NBQXNCLEVBQUU7UUFDM0YsT0FBTyxJQUFJLENBQUE7S0FDWjtJQUVELE1BQU0sSUFBSSxLQUFLLENBQUMsc0JBQXNCLFVBQVUsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUE7QUFDM0QsQ0FBQztBQWZELDhDQWVDIn0=
/// <reference types="node" />
/**
* Returns an entropy with the given number of bytes. Works in both Node and
* the browser.
*/
export default function randomBytes(bytes: number): Buffer;

@@ -7,2 +7,6 @@ "use strict";

const randombytes_1 = __importDefault(require("randombytes"));
/**
* Returns an entropy with the given number of bytes. Works in both Node and
* the browser.
*/
function randomBytes(bytes) {

@@ -12,2 +16,2 @@ return randombytes_1.default(bytes);

exports.default = randomBytes;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZG9tQnl0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcmFuZG9tQnl0ZXMvcmFuZG9tQnl0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw4REFBZ0M7QUFFaEMsU0FBd0IsV0FBVyxDQUFDLEtBQWE7SUFDL0MsT0FBTyxxQkFBTSxDQUFDLEtBQUssQ0FBQyxDQUFBO0FBQ3RCLENBQUM7QUFGRCw4QkFFQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZG9tQnl0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcmFuZG9tQnl0ZXMvcmFuZG9tQnl0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw4REFBZ0M7QUFFaEM7OztHQUdHO0FBQ0gsU0FBd0IsV0FBVyxDQUFDLEtBQWE7SUFDL0MsT0FBTyxxQkFBTSxDQUFDLEtBQUssQ0FBQyxDQUFBO0FBQ3RCLENBQUM7QUFGRCw4QkFFQyJ9
import AEAD from '../types/AEAD';
/**
* Convenience function for retrieving a mnemonic from a user's password and
* `AEAD`. Simply derives the encryption key from the password, and uses that
* to decrypt the encrypted secret key, then derives the mnemonic from the key.
*/
export default function regenerateMnemonic(aead: AEAD, password: string, salt: string): Promise<ReadonlyArray<string>>;

@@ -9,2 +9,7 @@ "use strict";

const secretKeyToMnemonic_1 = __importDefault(require("../secretKeyToMnemonic"));
/**
* Convenience function for retrieving a mnemonic from a user's password and
* `AEAD`. Simply derives the encryption key from the password, and uses that
* to decrypt the encrypted secret key, then derives the mnemonic from the key.
*/
async function regenerateMnemonic(aead, password, salt) {

@@ -16,2 +21,2 @@ const { encryptionKey } = await getHKDFKeysFromPassword_1.default(password, salt);

exports.default = regenerateMnemonic;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnZW5lcmF0ZU1uZW1vbmljLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3JlZ2VuZXJhdGVNbmVtb25pYy9yZWdlbmVyYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSwyRUFBa0Q7QUFDbEQseUZBQWdFO0FBQ2hFLGlGQUF3RDtBQUl6QyxLQUFLLFVBQVUsa0JBQWtCLENBQzlDLElBQVUsRUFDVixRQUFnQixFQUNoQixJQUFZO0lBRVosTUFBTSxFQUFFLGFBQWEsRUFBRSxHQUFHLE1BQU0saUNBQXVCLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxDQUFBO0lBQ3ZFLE1BQU0sa0JBQWtCLEdBQUcsTUFBTSwwQkFBZ0IsQ0FBQyxhQUFhLEVBQUUsSUFBSSxDQUFDLENBQUE7SUFDdEUsT0FBTyw2QkFBbUIsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFBO0FBQ2hELENBQUM7QUFSRCxxQ0FRQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnZW5lcmF0ZU1uZW1vbmljLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3JlZ2VuZXJhdGVNbmVtb25pYy9yZWdlbmVyYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSwyRUFBa0Q7QUFDbEQseUZBQWdFO0FBQ2hFLGlGQUF3RDtBQUl4RDs7OztHQUlHO0FBQ1ksS0FBSyxVQUFVLGtCQUFrQixDQUM5QyxJQUFVLEVBQ1YsUUFBZ0IsRUFDaEIsSUFBWTtJQUVaLE1BQU0sRUFBRSxhQUFhLEVBQUUsR0FBRyxNQUFNLGlDQUF1QixDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsQ0FBQTtJQUN2RSxNQUFNLGtCQUFrQixHQUFHLE1BQU0sMEJBQWdCLENBQUMsYUFBYSxFQUFFLElBQUksQ0FBQyxDQUFBO0lBQ3RFLE9BQU8sNkJBQW1CLENBQUMsa0JBQWtCLENBQUMsQ0FBQTtBQUNoRCxDQUFDO0FBUkQscUNBUUMifQ==
/// <reference types="node" />
/**
* Converts a given secret key to its BIP-39 mnemonic representation.
*
* Returns the mnemonic as an array of words.
*
* See `mnemonicToSecretKey.ts`.
*/
export default function secretKeyToMnemonic(secretKey: Buffer): ReadonlyArray<string>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bip39_1 = require("bip39");
/**
* Converts a given secret key to its BIP-39 mnemonic representation.
*
* Returns the mnemonic as an array of words.
*
* See `mnemonicToSecretKey.ts`.
*/
function secretKeyToMnemonic(secretKey) {

@@ -9,2 +16,2 @@ // library returns wordlist as space-delimited string. Arrays should be easier to handle.

exports.default = secretKeyToMnemonic;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VjcmV0S2V5VG9NbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZWNyZXRLZXlUb01uZW1vbmljL3NlY3JldEtleVRvTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxpQ0FBeUM7QUFFekMsU0FBd0IsbUJBQW1CLENBQUMsU0FBaUI7SUFDM0QseUZBQXlGO0lBQ3pGLE9BQU8seUJBQWlCLENBQUMsU0FBUyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFBO0FBQ2hELENBQUM7QUFIRCxzQ0FHQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VjcmV0S2V5VG9NbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZWNyZXRLZXlUb01uZW1vbmljL3NlY3JldEtleVRvTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxpQ0FBeUM7QUFFekM7Ozs7OztHQU1HO0FBQ0gsU0FBd0IsbUJBQW1CLENBQUMsU0FBaUI7SUFDM0QseUZBQXlGO0lBQ3pGLE9BQU8seUJBQWlCLENBQUMsU0FBUyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFBO0FBQ2hELENBQUM7QUFIRCxzQ0FHQyJ9

@@ -5,7 +5,44 @@ /// <reference types="node" />

import { PayloadAndKind, ClientSignedState, SignStatesRequestPayload, AddMovementPayload } from '../payload';
/**
* Generates the canonical string for a given payload.
*
* The canonical string is a human-readable JSON representation of the payload
* parameters. The keys are alphabetized, and are represented in snake case.
*/
export declare const canonicalString: (a1: object) => string;
/**
* Different payload types have different preprocessing strategies. This is a
* convenience function to properly process various payloads.
*/
export declare const canonicalizePayload: (kind: SigningPayloadID, payload: object) => string;
/**
* Signs a payload using a private key. The private key should be the key
* created by initialization of the Nash Protocol. Payloads are signed via
* [ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm)
* using [secp256k1](https://en.bitcoin.it/wiki/Secp256k1).
*
* If the payload to be signed is for a blockchain operation, the `Config`
* object must be passed as well to create the blockchain signatures.
*
* Refer to the documentation for the `Config` interface and to `initialize.ts`.
*/
export default function signPayload(privateKey: Buffer, payloadAndKind: PayloadAndKind, config?: Config): PayloadSignature;
/**
* Signs blockchain data. Returns an array of signatures. Needed for operations
* such as order placement.
*
* If the operation occurs within the same blockchain origin, 1 signature is
* returned. For example, 1 signature is returned when trading NEO for GAS.
*
* If the operation is cross-chain, 2 signatures are returned. For example, two
* signatures are returned for a BTC-ETH trade.
*/
export declare function signBlockchainData(config: Config, payloadAndKind: PayloadAndKind): ReadonlyArray<BlockchainSignature>;
/**
* @TODO Add documentation.
*/
export declare function determineSignatureNonceTuplesNeeded(config: Config, blockchainData: BlockchainData): ChainNoncePair[];
/**
* @TODO Add documentation.
*/
export declare function addRawBlockchainOrderData(config: Config, payloadAndKind: PayloadAndKind): object;

@@ -12,0 +49,0 @@ export declare function signStateListAndRecycledOrders(config: Config, payload: any): SignStatesRequestPayload;

@@ -24,6 +24,15 @@ "use strict";

const ORDER_NONCE_IGNORE = 4294967295;
// Generates the canonical string for the given arbitrary payload.
/**
* Generates the canonical string for a given payload.
*
* The canonical string is a human-readable JSON representation of the payload
* parameters. The keys are alphabetized, and are represented in snake case.
*/
exports.canonicalString = compose_1.default(toLower_1.default, JSON.stringify, o => Object.keys(o)
.sort()
.reduce((acc, el) => (Object.assign({}, acc, { [el]: o[el] })), {}), deep_1.default(mapKeys_1.default(snakeCase_1.default)));
/**
* Different payload types have different preprocessing strategies. This is a
* convenience function to properly process various payloads.
*/
exports.canonicalizePayload = (kind, payload) => {

@@ -51,3 +60,13 @@ switch (kind) {

};
// Signs the given payload with the given private key.
/**
* Signs a payload using a private key. The private key should be the key
* created by initialization of the Nash Protocol. Payloads are signed via
* [ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm)
* using [secp256k1](https://en.bitcoin.it/wiki/Secp256k1).
*
* If the payload to be signed is for a blockchain operation, the `Config`
* object must be passed as well to create the blockchain signatures.
*
* Refer to the documentation for the `Config` interface and to `initialize.ts`.
*/
function signPayload(privateKey, payloadAndKind, config) {

@@ -101,6 +120,12 @@ let blockchainRaw;

exports.default = signPayload;
// If we are trading within the same blockchain origin we only need 1 signature,
// neo_gas, nos_neo, etc..
// Otherwise we are trading cross chain, hence need signatures for both blockchains,
// neo_eth, eth_btc, etc..
/**
* Signs blockchain data. Returns an array of signatures. Needed for operations
* such as order placement.
*
* If the operation occurs within the same blockchain origin, 1 signature is
* returned. For example, 1 signature is returned when trading NEO for GAS.
*
* If the operation is cross-chain, 2 signatures are returned. For example, two
* signatures are returned for a BTC-ETH trade.
*/
function signBlockchainData(config, payloadAndKind) {

@@ -139,2 +164,5 @@ // if this is a movement we don't want to do all the stuff below

exports.signBlockchainData = signBlockchainData;
/**
* @TODO Add documentation.
*/
function determineSignatureNonceTuplesNeeded(config, blockchainData) {

@@ -164,2 +192,5 @@ const { unitA, unitB } = blockchain_1.getUnitPairs(blockchainData.marketName);

exports.determineSignatureNonceTuplesNeeded = determineSignatureNonceTuplesNeeded;
/**
* @TODO Add documentation.
*/
function addRawBlockchainOrderData(config, payloadAndKind) {

@@ -187,2 +218,5 @@ const blockchainData = blockchain_1.inferBlockchainData(payloadAndKind);

exports.addRawBlockchainOrderData = addRawBlockchainOrderData;
/*
* @TODO Add documentation.
*/
function signStateListAndRecycledOrders(config, payload) {

@@ -196,2 +230,5 @@ return {

exports.signStateListAndRecycledOrders = signStateListAndRecycledOrders;
/*
* @TODO Add documentation.
*/
function signRecycledOrdersForAddMovement(config, payload) {

@@ -204,2 +241,5 @@ if (payload.recycled_orders !== undefined) {

exports.signRecycledOrdersForAddMovement = signRecycledOrdersForAddMovement;
/*
* @TODO Add documentation.
*/
function signStateList(config, items) {

@@ -221,2 +261,5 @@ const result = items.map((item) => {

exports.signStateList = signStateList;
/*
* @TODO Add documentation.
*/
function alterOrderPayloadForGraphql(payload) {

@@ -235,2 +278,2 @@ // for order nonce_from/nonce_to, this is actually tracked from within the payload blockchain signatures object

exports.alterOrderPayloadForGraphql = alterOrderPayloadForGraphql;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnblBheWxvYWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2lnblBheWxvYWQvc2lnblBheWxvYWQudHMiXSwibmFtZXMiOltdLCJ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UMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxTQUFTLENBQUE7Z0JBQzdGLE9BQU8sSUFBSSxDQUFBO1lBQ2I7Z0JBQ0UsTUFBTSxJQUFJLEtBQUssQ0FBQyxxQ0FBcUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUE7U0FDMUU7SUFDSCxDQUFDLENBQUMsQ0FBQTtJQUNGLE9BQU8sTUFBTSxDQUFBO0FBQ2YsQ0FBQztBQWRELHNDQWNDO0FBRUQ7O0dBRUc7QUFDSCxTQUFnQiwyQkFBMkIsQ0FBQyxPQUFZO0lBQ3RELCtHQUErRztJQUMvRywrQ0FBK0M7SUFDL0MsMEZBQTBGO0lBQzFGLGtGQUFrRjtJQUNsRixNQUFNLFdBQVcscUJBQWEsT0FBTyxDQUFFLENBQUE7SUFDdkMsT0FBTyxXQUFXLENBQUMsVUFBVSxDQUFBO0lBQzdCLE9BQU8sV0FBVyxDQUFDLFFBQVEsQ0FBQTtJQUMzQixXQUFXLENBQUMsU0FBUyxHQUFHLGtCQUFrQixDQUFBO0lBQzFDLFdBQVcsQ0FBQyxPQUFPLEdBQUcsa0JBQWtCLENBQUE7SUFDeEMsT0FBTyxXQUFXLENBQUE7QUFDcEIsQ0FBQztBQVhELGtFQVdDIn0=
/// <reference types="node" />
/**
* Converts a buffer to a hex string. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
export default function stringify(buffer: Buffer): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Converts a buffer to a hex string. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
function stringify(buffer) {

@@ -7,2 +13,2 @@ return buffer.toString('hex');

exports.default = stringify;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0cmluZ2lmeS9zdHJpbmdpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxTQUF3QixTQUFTLENBQUMsTUFBYztJQUM5QyxPQUFPLE1BQU0sQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUE7QUFDL0IsQ0FBQztBQUZELDRCQUVDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0cmluZ2lmeS9zdHJpbmdpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7R0FLRztBQUNILFNBQXdCLFNBQVMsQ0FBQyxNQUFjO0lBQzlDLE9BQU8sTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQTtBQUMvQixDQUFDO0FBRkQsNEJBRUMifQ==
/// <reference types="node" />
/**
* A record containing a user's encrypted secret key and associated data.
* Requires a corresponding encryption key with which to decrypt the secret
* key in order to function.
*
* This value is passed to the Nash Central Account System for new accounts.
* The corresponding encryption key is never passed, and needs to be supplied
* by the client.
*
* Two top-level functions deal with AEADs: `encryptSecretKey.ts` and
* `decryptSecretKey.ts`.
*
* Additionally, initialization of the Nash Protocol for a user requires the
* user's AEAD.
*
* Refer to [this manual](https://www.cryptosys.net/manapi/api_aeadalgorithms.html)
* for more information on the nonce and tag.
*/
export default interface AEAD {
/**
* The encrypted version of a user's master key.
*/
readonly encryptedSecretKey: Buffer;
/**
* Associated AEAD data.
*/
readonly nonce: Buffer;
/**
* Associated AEAD data.
*/
readonly tag: Buffer;
}

@@ -0,2 +1,12 @@

/**
* Represents an asset on the Nash Exchange.
*
* Generally, this is consumed in the form of `Record<string, Asset>` where
* `string` represents the asset's name. This interface represents the
* absolute minimum of properties needed for the Nash Protocol to function.
*/
export default interface Asset {
/**
* Represents the chain this asset uses, such as NEO or ETH.
*/
readonly blockchain: string;

@@ -3,0 +13,0 @@ readonly hash: string;

@@ -0,1 +1,4 @@

/**
* @TODO Add documentation.
*/
export default interface BlockchainData {

@@ -11,2 +14,5 @@ readonly amount: string;

}
/**
* @TODO Add documentation.
*/
export interface ChainNoncePair {

@@ -13,0 +19,0 @@ chain: string;

import Market from './market';
import Asset from './asset';
import Wallet from './wallet';
/**
* The user-specific configuration object generated by initialization of the
* Nash protocol. Used as an input for various operations, such as signing.
*
* Derived from `InitParams`. Should generally be made accessible on program
* start, as most important Nash operations require this `Config`.
*/
export default interface Config {
/**
* Transparently forwarded from `InitParams` for convenience.
*/
readonly assetData: {
readonly [key: string]: Asset;
};
/**
* Transparently forwarded from `InitParams` for convenience.
*/
readonly marketData: {
readonly [key: string]: Market;
};
/**
* All of a user's `Wallet`s for all supported blockchains.
*
* Note that private keys are included, so this should never be exposed.
*/
readonly wallets: Record<string, Wallet>;
/**
* The public and private keypair used by the user to sign payloads.
*
* Refer to `signPayload.ts` and
* `generateWallet.ts#generateNashPayloadSigningKey()` for more information.
*
* @TODO: While this type is valid, it is confusing, as it's not _really_ a
* wallet. It just coincidentally has a private and public key.
*/
readonly payloadSigningKey: Wallet;
}
/// <reference types="node" />
/**
* The stretched keys derived from a master password via HKDF. Created via
* `getHKDFKeysFromPassword`.
*/
export default interface HKDFKeys {
/**
* The derived key used for authentication with Nash's Central Accounts System.
*
* This is sent to Nash servers whenever signing in. This should never be
* exposed elsewhere, but even if it is, an attacker will have limited
* capability if the encryption key is not exposed.
*/
readonly authKey: Buffer;
/**
* The derived key used for encrypting the user's secret key.
*
* This is _NEVER_ sent to the Nash servers, and should _NEVER_ be exposed.
* If made available with the user's encrypted secret key, all of the user's
* funds are freely accessible.
*/
readonly encryptionKey: Buffer;
}
/// <reference types="node" />
import { Asset, Market, AEAD } from '../types';
/**
* The configuration parameters used to initialize the Nash Protocol.
*
* Used to generate a `Config`.
*/
export default interface InitParams {
/**
* The secret key needed to decrypt the AEAD. If operating on the AEAD
* returned by the CAS after authenticating, this should be the encryption
* key derived from the user's password.
*
* Refer to the documentation for `getHKDFKeysFromPassword.md`.
*/
encryptionKey: Buffer;
/**
* A user's AEAD. When initializing, this is received from the CAS after
* authenticating.
*
* Refer to the documentation for the `AEAD` interface.
*/
aead: AEAD;
/**
* A record of wallet types to chain index.
*
* For more information, refer to the [BIP-44 spec](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#index).
*/
walletIndices: {
readonly [key: string]: number;
};
/**
* A record of asset names to asset parameters.
*
* For more information, refer to the `Asset` interface.
*/
assetData?: {
readonly [key: string]: Asset;
};
/**
* A record of market names to market parameters.
*
* For more information, refer to the `Market` interface.
*/
marketData?: {
readonly [key: string]: Market;
};
/**
* The blockchain network to use.
*/
net?: 'MainNet' | 'TestNet' | 'LocalNet';
}

@@ -0,6 +1,31 @@

/**
* Represents a market on the Nash Exchange.
*
* Generally, this is consumed in the form of `Record<string, Market>` where
* `string` represents the market's name. This interface represents the
* absolute minimum of properties needed for the Nash Protocol to function.
*/
export default interface Market {
/**
* Represents the smallest increment by which an order size can increase in
* the given market.
*
* For example, if `minTickSize` is `0.1`, all trades must be sized in
* increments of `0.1`.
*/
readonly minTickSize: number;
/**
* Represents the lowest price an order can have in the given market.
*/
readonly minTradeSize: number;
/**
* Represents the smallest increment by which an order price can increase for
* the given market's `aUnit`, or base currency.
*/
readonly minTradeIncrementA: number;
/**
* Represents the smallest increment by which an order price can increase for
* the given market's `bUnit`, or quote currency.
*/
readonly minTradeIncrementB: number;
}

@@ -0,1 +1,6 @@

/**
* The output from payload signing for blockchain operations.
*
* Refer to the documentation for `signPayload.ts`.
*/
export interface BlockchainSignature {

@@ -8,3 +13,25 @@ readonly blockchain: string;

}
/**
* The output from payload signing. Is used by the Nash Matching Engine to
* validate the authenticity of requests.
*
* A `PayloadSignature` may optionally contain a blockchain movement, which is
* needed for certain operations that interact with the blockchain, such as
* order placement. For such requests, the `payload` should include appropriate
* blockchain signatures.
*
* Refer to the documentation for `signPayload.ts`.
*/
export interface PayloadSignature {
/**
* The payload being signed with optional embedded blockchain signatures.
*
* At a bare minimum, a `timestamp` is required. For operations involving
* blockchain, a `blockchain_signatures` array is also required.
*
* @TODO Better instructions needed for how to use blockchain signatures.
*
* @property `timestamp` Current timestamp in milliseconds.
* @property `blockchain_signatures` An array of blockchain signatures.
*/
readonly payload: Record<string, any>;

@@ -16,2 +43,5 @@ readonly signature: string;

}
/**
* @TODO add documentation.
*/
export interface BlockchainMovement {

@@ -18,0 +48,0 @@ prefix: string;

@@ -0,6 +1,23 @@

/**
* Represents a standardized wallet interface agnostic of blockchain.
*/
export default interface Wallet {
/**
* A shortened form of the public key.
*/
readonly address: string;
/**
* Key granting ownership of wallet funds. Derived from the 12-word mnemonic.
*/
readonly privateKey: string;
/**
* Key used for receiving funds. Derived from private key.
*/
readonly publicKey: string;
/**
* Wallet index as defined by BIP-44 used for HD key derivation.
*
* For more information, refer to the [BIP-44 spec](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#index).
*/
readonly index: number;
}

@@ -0,2 +1,5 @@

/**
* Returns the number of milliseconds since the Unix Epoch.
*/
export declare const createTimestamp: () => number;
export declare const createTimestamp32: () => number;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const EPOCH_START = 155000000000;
/**
* Returns the number of milliseconds since the Unix Epoch.
*/
exports.createTimestamp = () => {

@@ -10,2 +13,2 @@ return new Date().getTime();

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlVGltZXN0YW1wLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL2NyZWF0ZVRpbWVzdGFtcC9jcmVhdGVUaW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLFdBQVcsR0FBRyxZQUFZLENBQUE7QUFFbkIsUUFBQSxlQUFlLEdBQUcsR0FBVyxFQUFFO0lBQzFDLE9BQU8sSUFBSSxJQUFJLEVBQUUsQ0FBQyxPQUFPLEVBQUUsQ0FBQTtBQUM3QixDQUFDLENBQUE7QUFFWSxRQUFBLGlCQUFpQixHQUFHLEdBQVcsRUFBRTtJQUM1QyxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsdUJBQWUsRUFBRSxHQUFHLEVBQUUsQ0FBQyxHQUFHLFdBQVcsQ0FBQTtBQUN6RCxDQUFDLENBQUEifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlVGltZXN0YW1wLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL2NyZWF0ZVRpbWVzdGFtcC9jcmVhdGVUaW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFNLFdBQVcsR0FBRyxZQUFZLENBQUE7QUFFaEM7O0dBRUc7QUFDVSxRQUFBLGVBQWUsR0FBRyxHQUFXLEVBQUU7SUFDMUMsT0FBTyxJQUFJLElBQUksRUFBRSxDQUFDLE9BQU8sRUFBRSxDQUFBO0FBQzdCLENBQUMsQ0FBQTtBQUVZLFFBQUEsaUJBQWlCLEdBQUcsR0FBVyxFQUFFO0lBQzVDLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyx1QkFBZSxFQUFFLEdBQUcsRUFBRSxDQUFDLEdBQUcsV0FBVyxDQUFBO0FBQ3pELENBQUMsQ0FBQSJ9

@@ -0,1 +1,8 @@

/**
* Checks if an array of BIP39 words forms a valid BIP39 mnemonic. Note that
* Nash uses 12-word mnemonics, but this function will return `true` for a spec
* compliant mnemonic of any length.
*
* @param mnemonic An array of words to validate.
*/
export default function validateMnemonic(mnemonic: ReadonlyArray<string>): boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const bip39_1 = require("bip39");
/**
* Checks if an array of BIP39 words forms a valid BIP39 mnemonic. Note that
* Nash uses 12-word mnemonics, but this function will return `true` for a spec
* compliant mnemonic of any length.
*
* @param mnemonic An array of words to validate.
*/
function validateMnemonic(mnemonic) {

@@ -8,2 +15,2 @@ return bip39_1.validateMnemonic(mnemonic.join(' '));

exports.default = validateMnemonic;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGVNbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy92YWxpZGF0ZU1uZW1vbmljL3ZhbGlkYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxpQ0FBb0Q7QUFFcEQsU0FBd0IsZ0JBQWdCLENBQUMsUUFBK0I7SUFDdEUsT0FBTyx3QkFBUSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtBQUNyQyxDQUFDO0FBRkQsbUNBRUMifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGVNbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy92YWxpZGF0ZU1uZW1vbmljL3ZhbGlkYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxpQ0FBb0Q7QUFFcEQ7Ozs7OztHQU1HO0FBQ0gsU0FBd0IsZ0JBQWdCLENBQUMsUUFBK0I7SUFDdEUsT0FBTyx3QkFBUSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtBQUNyQyxDQUFDO0FBRkQsbUNBRUMifQ==
/// <reference types="node" />
/**
* Converts a hex string to a buffer. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
export default function bufferize(str: string): Buffer;

@@ -0,4 +1,10 @@

/**
* Converts a hex string to a buffer. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
export default function bufferize(str) {
return Buffer.from(str, 'hex');
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVyaXplLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2J1ZmZlcml6ZS9idWZmZXJpemUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE9BQU8sVUFBVSxTQUFTLENBQUMsR0FBVztJQUMzQyxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFBO0FBQ2hDLENBQUMifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVyaXplLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2J1ZmZlcml6ZS9idWZmZXJpemUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0dBS0c7QUFDSCxNQUFNLENBQUMsT0FBTyxVQUFVLFNBQVMsQ0FBQyxHQUFXO0lBQzNDLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUE7QUFDaEMsQ0FBQyJ9
/// <reference types="node" />
import AEAD from '../types/AEAD';
/**
* Decrypts an encrypted secret key via AEAD. Takes an `AEAD` object.
*
* See `encryptSecretKey.ts`.
*/
export default function decryptSecretKey(encryptionKey: Buffer, aead: AEAD): Promise<Buffer>;
import { createDecipheriv } from 'browserify-aes';
// tslint:disable:no-expression-statement
/**
* Decrypts an encrypted secret key via AEAD. Takes an `AEAD` object.
*
* See `encryptSecretKey.ts`.
*/
export default function decryptSecretKey(encryptionKey, aead) {

@@ -18,2 +22,2 @@ const { encryptedSecretKey, nonce, tag } = aead;

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjcnlwdFNlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9kZWNyeXB0U2VjcmV0S2V5L2RlY3J5cHRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFJakQseUNBQXlDO0FBQ3pDLE1BQU0sQ0FBQyxPQUFPLFVBQVUsZ0JBQWdCLENBQUMsYUFBcUIsRUFBRSxJQUFVO0lBQ3hFLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxLQUFLLEVBQUUsR0FBRyxFQUFFLEdBQUcsSUFBSSxDQUFBO0lBQy9DLE1BQU0sUUFBUSxHQUFHLGdCQUFnQixDQUFDLGFBQWEsRUFBRSxhQUFhLEVBQUUsS0FBSyxFQUFFO1FBQ3JFLGFBQWEsRUFBRSxFQUFFO0tBQ2xCLENBQUMsQ0FBQTtJQUVGLFFBQVEsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUE7SUFDeEIsTUFBTSxZQUFZLEdBQUcsUUFBUSxDQUFDLE1BQU0sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFBO0lBRXhELElBQUk7UUFDRixPQUFPLE9BQU8sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDLFlBQVksRUFBRSxRQUFRLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUE7S0FDeEU7SUFBQyxPQUFPLENBQUMsRUFBRTtRQUN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0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUE7S0FDekI7QUFDSCxDQUFDIn0=
/// <reference types="node" />
import AEAD from '../types/AEAD';
/**
* Encrypts a secret key via AEAD. Returns an `AEAD` object. This object is
* stored server-side, while the encryption key is never stored. When
* authenticating, the server returns the `AEAD` object while the client must
* generate the encryption key on the fly from the user's password using
* `getHKDFKeyFromPassword.ts`.
*
* Uses [`aes-256-gcm`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* See `decryptSecretKey.ts`.
*/
export default function encryptSecretKey(encryptionKey: Buffer, secretKey: Buffer): AEAD;
import { createCipheriv } from 'browserify-aes';
import randomBytes from '../randomBytes';
const NONCE_SIZE = 12;
// Reference: https://nodejs.org/api/crypto.html#crypto_crypto_createcipheriv_algorithm_key_iv_options
// tslint:disable:no-expression-statement
/**
* Encrypts a secret key via AEAD. Returns an `AEAD` object. This object is
* stored server-side, while the encryption key is never stored. When
* authenticating, the server returns the `AEAD` object while the client must
* generate the encryption key on the fly from the user's password using
* `getHKDFKeyFromPassword.ts`.
*
* Uses [`aes-256-gcm`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* See `decryptSecretKey.ts`.
*/
export default function encryptSecretKey(encryptionKey, secretKey) {

@@ -11,4 +20,2 @@ const nonce = randomBytes(NONCE_SIZE);

});
// do we need additional authenticated data? what data should be used here?
// cipher.setAAD(some known)
const encryptedSecretKey = Buffer.concat([cipher.update(secretKey), cipher.final()]);

@@ -22,2 +29,2 @@ const tag = cipher.getAuthTag();

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jcnlwdFNlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbmNyeXB0U2VjcmV0S2V5L2VuY3J5cHRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQ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BO0FBRS9DLE9BQU8sV0FBVyxNQUFNLGdCQUFnQixDQUFBO0FBR3hDLE1BQU0sVUFBVSxHQUFHLEVBQUUsQ0FBQTtBQUVyQjs7Ozs7Ozs7OztHQVVHO0FBQ0gsTUFBTSxDQUFDLE9BQU8sVUFBVSxnQkFBZ0IsQ0FBQyxhQUFxQixFQUFFLFNBQWlCO0lBQy9FLE1BQU0sS0FBSyxHQUFHLFdBQVcsQ0FBQyxVQUFVLENBQUMsQ0FBQTtJQUVyQyxNQUFNLE1BQU0sR0FBRyxjQUFjLENBQUMsYUFBYSxFQUFFLGFBQWEsRUFBRSxLQUFLLEVBQUU7UUFDakUsYUFBYSxFQUFFLEVBQUU7S0FDbEIsQ0FBQyxDQUFBO0lBRUYsTUFBTSxrQkFBa0IsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsRUFBRSxNQUFNLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFBO0lBRXBGLE1BQU0sR0FBRyxHQUFHLE1BQU0sQ0FBQyxVQUFVLEVBQUUsQ0FBQTtJQUUvQixPQUFPO1FBQ0wsa0JBQWtCO1FBQ2xCLEtBQUs7UUFDTCxHQUFHO0tBQ0osQ0FBQTtBQUNILENBQUMifQ==

@@ -9,6 +9,25 @@ /// <reference types="node" />

}
/**
* Creates a wallet for a given token via the
* [BIP-44 protocol]((https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* Requires the user's master seed.
*/
export declare function generateWallet(masterSeed: Buffer, coinType: CoinType, index: number, net?: string): Wallet;
/**
* Creates the keypair used for signing payloads. Used during Nash Protocol
* initialization.
*/
export declare function generateNashPayloadSigningKey(masterSeed: Buffer, index: number): Wallet;
/**
* Generates a deterministic key according to the BIP-44 spec.
*
* `M' / purpose' / coin' / account' / change / index`
* `M' / 44' / coin' / 0' / 0`
*/
export declare function generateBIP44Key(masterSeed: Buffer, coinType: CoinType, index: number): bip32.BIP32Interface;
/**
* Derives a new key from the extended key for the given index.
*/
export declare function deriveIndex(extendedKey: bip32.BIP32Interface, index: number): bip32.BIP32Interface;
export declare const coinTypeFromString: (s: string) => CoinType;

@@ -14,2 +14,8 @@ import * as bip32 from 'bip32';

})(CoinType || (CoinType = {}));
/**
* Creates a wallet for a given token via the
* [BIP-44 protocol]((https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
*
* Requires the user's master seed.
*/
export function generateWallet(masterSeed, coinType, index, net) {

@@ -20,2 +26,6 @@ const key = derivePath(masterSeed, bip44Purpose, coinType, 0, 0);

}
/**
* Creates the keypair used for signing payloads. Used during Nash Protocol
* initialization.
*/
export function generateNashPayloadSigningKey(masterSeed, index) {

@@ -34,5 +44,8 @@ const extendedKey = derivePath(masterSeed, nashPurpose, 0, 0, 0);

}
// Generates a deterministic key according to the BIP44 spec.
// M' / purpose' / coin' / account' / change / index
// M' / 44' / coin' / 0' / 0
/**
* Generates a deterministic key according to the BIP-44 spec.
*
* `M' / purpose' / coin' / account' / change / index`
* `M' / 44' / coin' / 0' / 0`
*/
export function generateBIP44Key(masterSeed, coinType, index) {

@@ -43,3 +56,5 @@ const extendedKey = derivePath(masterSeed, bip44Purpose, coinType, 0, 0);

}
// Derives a new key from the extended key for the given index.
/**
* Derives a new key from the extended key for the given index.
*/
export function deriveIndex(extendedKey, index) {

@@ -74,2 +89,4 @@ return extendedKey.derive(index);

case CoinType.ETH:
// TODO: can we replace this with the elliptic package which we already
// use to trim bundle size?
const pubkey = tiny.pointFromScalar(key.privateKey, false);

@@ -116,2 +133,2 @@ return {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGVXYWxsZXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZ2VuZXJhdGVXYWxsZXQvZ2VuZXJhdGVXYWxsZXQudHMiXSwibmFtZXMiOltdLCJtYXB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LE9BQVEsQ0FBQTtBQUN2RyxDQUFDLENBQUE7QUFFRCxNQUFNLHdCQUF3QixHQUFHLENBQUMsR0FBdUIsRUFBbUIsRUFBRTtJQUM1RSxRQUFRLEdBQUcsRUFBRTtRQUNYLEtBQUssU0FBUztZQUNaLE9BQU8sT0FBTyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUE7UUFDakMsS0FBSyxTQUFTO1lBQ1osT0FBTyxPQUFPLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQTtRQUNqQyxLQUFLLFVBQVU7WUFDYixPQUFPLE9BQU8sQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFBO1FBQ2pDO1lBQ0UsT0FBTyxPQUFPLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQTtLQUNsQztBQUNILENBQUMsQ0FBQTtBQUVELFNBQVMsVUFBVSxDQUNqQixVQUFrQixFQUNsQixPQUFlLEVBQ2YsUUFBa0IsRUFDbEIsT0FBZSxFQUNmLE1BQWM7SUFFZCxNQUFNLFNBQVMsR0FBRyxLQUFLLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBQyxDQUFBO0lBQzVDLE9BQU8sU0FBUztTQUNiLGNBQWMsQ0FBQyxPQUFPLENBQUM7U0FDdkIsY0FBYyxDQUFDLFFBQVEsQ0FBQztTQUN4QixjQUFjLENBQUMsT0FBTyxDQUFDO1NBQ3ZCLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQTtBQUNuQixDQUFDIn0=
import HKDFKeys from '../types/HKDFKeys';
/**
* Derives two keys from a given input key via
* [HKDF](https://en.wikipedia.org/wiki/HKDF).
*
* Specifically, we use this to derive keys from a user's hashed password and
* never use the hashed password directly. Thus, if one derived key is
* compromised, other keys are not affected.
*
* See the `HKDFKeys` interface for information on how Nash uses these keys.
*/
export default function getHKDFKeysFromPassword(password: string, salt: string): Promise<HKDFKeys>;
import hkdf from 'futoin-hkdf';
/*
HKDF seems easy enough to implement on top of crypto.createHmac which would
allow us to reduce external dependencies.
https://en.wikipedia.org/wiki/HKDF#Example:_Python_implementation
*/
import hashPassword from '../hashPassword';

@@ -11,9 +6,16 @@ /*

*/
// TODO: We're expanding the key here right? The scrypted key is already len=32. Do we want this to be longer?
const length = 32;
const hash = 'SHA-256';
/**
* Derives two keys from a given input key via
* [HKDF](https://en.wikipedia.org/wiki/HKDF).
*
* Specifically, we use this to derive keys from a user's hashed password and
* never use the hashed password directly. Thus, if one derived key is
* compromised, other keys are not affected.
*
* See the `HKDFKeys` interface for information on how Nash uses these keys.
*/
export default async function getHKDFKeysFromPassword(password, salt) {
const hashed = await hashPassword(password, salt);
// TODO: do we need to salt here again? If the original input is already hashed we shouldn't need to salt again right?
// Does it matter?
return {

@@ -24,2 +26,2 @@ authKey: hkdf(hashed, length, { hash, info: 'auth', salt }),

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0SEtERktleXNGcm9tUGFzc3dvcmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvZ2V0SEtERktleXNGcm9tUGFzc3dvcmQvZ2V0SEtERktleXNGcm9tUGFzc3dvcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxJQUFJLE1BQU0sYUFBYSxDQUFBO0FBQzlCOzs7O0dBSUc7QUFDSCxPQUFPLFlBQVksTUFBTSxpQkFBaUIsQ0FBQTtBQUcxQzs7R0FFRztBQUNILDhHQUE4RztBQUM5RyxNQUFNLE1BQU0sR0FBRyxFQUFFLENBQUE7QUFDakIsTUFBTSxJQUFJLEdBQUcsU0FBUyxDQUFBO0FBRXRCLE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxVQUFVLHVCQUF1QixDQUFDLFFBQWdCLEVBQUUsSUFBWTtJQUNsRixNQUFNLE1BQU0sR0FBRyxNQUFNLFlBQVksQ0FBQyxRQUFRLEVBQUUsSUFBSSxDQUFDL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UFBSSxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsQ0FBQztRQUMzRCxhQUFhLEVBQUUsSUFBSSxDQUFDLE1BQU0sRUFBRSxNQUFNLEVBQUUsRUFBRSxJQUFJLEVBQUUsSUFBSSxFQUFFLFlBQVksRUFBRSxJQUFJLEVBQUUsQ0FBQztLQUN4RSxDQUFBO0FBQ0gsQ0FBQyJ9
/// <reference types="node" />
/**
* Generates a secret key of Nash's desired length from a random entropy.
*
* This secret key is ultimately the foundation of a user's wallets, so should
* be treated with extreme care.
*/
export default function getSecretKey(): Buffer;

@@ -5,5 +5,11 @@ import randomBytes from '../randomBytes';

const SECRET_KEY_SIZE_BYTES = 16;
/**
* Generates a secret key of Nash's desired length from a random entropy.
*
* This secret key is ultimately the foundation of a user's wallets, so should
* be treated with extreme care.
*/
export default function getSecretKey() {
return randomBytes(SECRET_KEY_SIZE_BYTES);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U2VjcmV0S2V5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2dldFNlY3JldEtleS9nZXRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxXQUFXLE1BQU0sZ0JBQWdCLENBQUE7QUFFeEMsOERBQThEO0FBQzlELHFCQUFxQjtBQUNyQixNQUFNLHFCQUFxQixHQUFHLEVBQUUsQ0FBQTtBQUVoQyxNQUFNLENBQUMsT0FBTyxVQUFVLFlBQVk7SUFDbEMsT0FBTyxXQUFXLENBQUMscUJBQXFCLENBQUMsQ0FBQTtBQUMzQyxDQUFDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U2VjcmV0S2V5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2dldFNlY3JldEtleS9nZXRTZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxXQUFXLE1BQU0sZ0JBQWdCLENBQUE7QUFFeEMsOERBQThEO0FBQzlELHFCQUFxQjtBQUNyQixNQUFNLHFCQUFxQixHQUFHLEVBQUUsQ0FBQTtBQUVoQzs7Ozs7R0FLRztBQUNILE1BQU0sQ0FBQyxPQUFPLFVBQVUsWUFBWTtJQUNsQyxPQUFPLFdBQVcsQ0FBQyxxQkFBcUIsQ0FBQyxDQUFBO0FBQzNDLENBQUMifQ==
/// <reference types="node" />
/**
* Hashes a plaintext password via the
* [scrypt key derivation function](https://en.wikipedia.org/wiki/Scrypt).
*/
export default function hashPassword(password: string, salt: string): Promise<Buffer>;
import scrypt from 'scrypt-js';
import normalizeString from '../utils/normalizeString';
/*
scrypt parameters recommended by spec document.
Scrypt parameters
N given by Cure53; 2^20 === 1048576. However this takes unacceptably long; using
2^16 === 65536 for now.
The salt should be the user email.
Suggested N is 2^20 === 1048576. However this takes unacceptably long; using
2^16 === 65536 is acceptable.
*/

@@ -15,2 +13,6 @@ const N = 2 ** 16;

const dkLen = 32;
/**
* Hashes a plaintext password via the
* [scrypt key derivation function](https://en.wikipedia.org/wiki/Scrypt).
*/
export default function hashPassword(password, salt) {

@@ -28,2 +30,2 @@ return new Promise(res => scrypt(normalizeString(password), normalizeString(salt), N, r, p, dkLen, (error, _, key) => {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFzaFBhc3N3b3JkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2hhc2hQYXNzd29yZC9oYXNoUGFzc3dvcmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxNQUFNLE1BQU0sV0FBVyxDQUFBO0FBRTlCLE9BQU8sZUFBZSxNQUFNLDBCQUEwQixDQUFBO0FBRXREOzs7Ozs7O0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ixDQUFBO0FBRXREOzs7OztHQUtHO0FBQ0gsTUFBTSxDQUFDLEdBQUcsQ0FBQyxJQUFJLEVBQUUsQ0FBQTtBQUNqQixNQUFNLENBQUMsR0FBRyxDQUFDLENBQUE7QUFDWCxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUE7QUFDWCxNQUFNLEtBQUssR0FBRyxFQUFFLENBQUE7QUFFaEI7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE9BQU8sVUFBVSxZQUFZLENBQUMsUUFBZ0IsRUFBRSxJQUFZO0lBQ2pFLE9BQU8sSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FDdkIsTUFBTSxDQUFDLGVBQWUsQ0FBQyxRQUFRLENBQUMsRUFBRSxlQUFlLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsS0FBSyxFQUFFLENBQUMsS0FBWSxFQUFFLENBQVMsRUFBRSxHQUFXLEVBQUUsRUFBRTtRQUNoSCxzRUFBc0U7UUFDdEUsSUFBSSxLQUFLLEVBQUU7WUFDVCxNQUFNLEtBQUssQ0FBQTtTQUNaO1FBRUQsb0VBQW9FO1FBQ3BFLElBQUksR0FBRyxFQUFFO1lBQ1AsT0FBTyxHQUFHLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFBO1NBQzdCO0lBQ0gsQ0FBQyxDQUFDLENBQ0gsQ0FBQTtBQUNILENBQUMifQ==
/// <reference types="node" />
/**
* Converts a BIP-39 mnemonic to its master seed representation. This
* representation is used to generate blockchain wallets.
*/
export default function mnemonicToMasterSeed(mnemonic: ReadonlyArray<string>): Buffer;
import { mnemonicToSeed } from 'bip39';
// We might want to customize this down the line but this works out of the box for now.
/**
* Converts a BIP-39 mnemonic to its master seed representation. This
* representation is used to generate blockchain wallets.
*/
export default function mnemonicToMasterSeed(mnemonic) {
return mnemonicToSeed(mnemonic.join(' '));
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb01hc3RlclNlZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbW5lbW9uaWNUb01hc3RlclNlZWQvbW5lbW9uaWNUb01hc3RlclNlZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLE9BQU8sQ0FBQTtBQUV0Qyx1RkFBdUY7QUFDdkYsTUFBTSxDQUFDLE9BQU8sVUFBVSxvQkFBb0IsQ0FBQyxRQUErQjtJQUMxRSxPQUFPLGNBQWMsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUE7QUFDM0MsQ0FBQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb01hc3RlclNlZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbW5lbW9uaWNUb01hc3RlclNlZWQvbW5lbW9uaWNUb01hc3RlclNlZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLE9BQU8sQ0FBQTtBQUV0Qzs7O0dBR0c7QUFDSCxNQUFNLENBQUMsT0FBTyxVQUFVLG9CQUFvQixDQUFDLFFBQStCO0lBQzFFLE9BQU8sY0FBYyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtBQUMzQyxDQUFDIn0=
/// <reference types="node" />
/**
* Converts a BIP-39 mnemonic to its secret key representation.
*
* See `secretKeyToMnemonic.ts`.
*/
export default function mnemonicToSecretKey(mnemonic: ReadonlyArray<string>): Buffer;
import { mnemonicToEntropy } from 'bip39';
import bufferize from '../bufferize';
/**
* Converts a BIP-39 mnemonic to its secret key representation.
*
* See `secretKeyToMnemonic.ts`.
*/
export default function mnemonicToSecretKey(mnemonic) {
return bufferize(mnemonicToEntropy(mnemonic.join(' ')));
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb1NlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tbmVtb25pY1RvU2VjcmV0S2V5L21uZW1vbmljVG9TZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sT0FBTyxDQUFBO0FBRXpDLE9BQU8sU0FBUyxNQUFNLGNBQWMsQ0FBQTtBQUVwQyxNQUFNLENBQUMsT0FBTyxVQUFVLG1CQUFtQixDQUFDLFFBQStCO0lBQ3pFLE9BQU8sU0FBUyxDQUFDLGlCQUFpQixDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFBO0FBQ3pELENBQUMifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW5lbW9uaWNUb1NlY3JldEtleS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9tbmVtb25pY1RvU2VjcmV0S2V5L21uZW1vbmljVG9TZWNyZXRLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sT0FBTyxDQUFBO0FBRXpDLE9BQU8sU0FBUyxNQUFNLGNBQWMsQ0FBQTtBQUVwQzs7OztHQUlHO0FBQ0gsTUFBTSxDQUFDLE9BQU8sVUFBVSxtQkFBbUIsQ0FBQyxRQUErQjtJQUN6RSxPQUFPLFNBQVMsQ0FBQyxpQkFBaUIsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQTtBQUN6RCxDQUFDIn0=

@@ -0,1 +1,4 @@

/**
* IDs mapping Nash Matching Engine operations with handling strategies.
*/
export declare enum SigningPayloadID {

@@ -2,0 +5,0 @@ listOrderPayload = 0,

import { MovementTypeWithdrawal, MovementTypeDeposit } from './payload';
// This is currently the same as api-client-ts/constants/PayloadID
/**
* IDs mapping Nash Matching Engine operations with handling strategies.
*/
export var SigningPayloadID;

@@ -105,2 +107,2 @@ (function (SigningPayloadID) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmluZ1BheWxvYWRJRC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYXlsb2FkL3NpZ25pbmdQYXlsb2FkSUQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHNCQUFzQixFQUFFLG1CQUFtQixFQUFFLE1BQU0sV0FBVyxDQUFBO0FBRXZFLGtFQUFrRTtBQUNsRSxNQUFNLENBQU4sSUFBWSxnQkFnQ1g7QUFoQ0QsV0FBWSxnQkFBZ0I7SUFDMUIsK0VBQW9CLENBQUE7SUFDcEIsbUZBQXNCLENBQUE7SUFDdEIsaUdBQTZCLENBQUE7SUFDN0IsK0ZBQTRCLENBQUE7SUFDNUIsdUZBQXdCLENBQUE7SUFDeEIsK0ZBQTRCLENBQUE7SUFDNUIsK0ZBQTRCLENBQUE7SUFDNUIsbUZBQXNCLENBQUE7SUFDdEIsNkVBQW1CLENBQUE7SUFFbkIsaUVBQWlFO0lBQ2pFLDJGQUEwQixDQUFBO0lBQzFCLG9HQUErQixDQUFBO0lBQy9CLHNHQUFnQyxDQUFBO0lBQ2hDLDhGQUE0QixDQUFBO0lBQzVCLG9GQUF1QixDQUFBO0lBQ3ZCLGdGQU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yxDQUFBO0FBQzNELENBQUMifQ==
/// <reference types="node" />
/**
* Returns an entropy with the given number of bytes. Works in both Node and
* the browser.
*/
export default function randomBytes(bytes: number): Buffer;
import random from 'randombytes';
/**
* Returns an entropy with the given number of bytes. Works in both Node and
* the browser.
*/
export default function randomBytes(bytes) {
return random(bytes);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZG9tQnl0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcmFuZG9tQnl0ZXMvcmFuZG9tQnl0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxNQUFNLE1BQU0sYUFBYSxDQUFBO0FBRWhDLE1BQU0sQ0FBQyxPQUFPLFVBQVUsV0FBVyxDQUFDLEtBQWE7SUFDL0MsT0FBTyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUE7QUFDdEIsQ0FBQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZG9tQnl0ZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcmFuZG9tQnl0ZXMvcmFuZG9tQnl0ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxNQUFNLE1BQU0sYUFBYSxDQUFBO0FBRWhDOzs7R0FHRztBQUNILE1BQU0sQ0FBQyxPQUFPLFVBQVUsV0FBVyxDQUFDLEtBQWE7SUFDL0MsT0FBTyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUE7QUFDdEIsQ0FBQyJ9
import AEAD from '../types/AEAD';
/**
* Convenience function for retrieving a mnemonic from a user's password and
* `AEAD`. Simply derives the encryption key from the password, and uses that
* to decrypt the encrypted secret key, then derives the mnemonic from the key.
*/
export default function regenerateMnemonic(aead: AEAD, password: string, salt: string): Promise<ReadonlyArray<string>>;
import decryptSecretKey from '../decryptSecretKey';
import getHKDFKeysFromPassword from '../getHKDFKeysFromPassword';
import secretKeyToMnemonic from '../secretKeyToMnemonic';
/**
* Convenience function for retrieving a mnemonic from a user's password and
* `AEAD`. Simply derives the encryption key from the password, and uses that
* to decrypt the encrypted secret key, then derives the mnemonic from the key.
*/
export default async function regenerateMnemonic(aead, password, salt) {

@@ -9,2 +14,2 @@ const { encryptionKey } = await getHKDFKeysFromPassword(password, salt);

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnZW5lcmF0ZU1uZW1vbmljLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3JlZ2VuZXJhdGVNbmVtb25pYy9yZWdlbmVyYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxnQkFBZ0IsTUFBTSxxQkFBcUIsQ0FBQTtBQUNsRCxPQUFPLHVCQUF1QixNQUFNLDRCQUE0QixDQUFBO0FBQ2hFLE9BQU8sbUJBQW1CLE1BQU0sd0JBQXdCLENBQUE7QUFJeEQsTUFBTSxDQUFDLE9BQU8sQ0FBQyxLQUFLLFVBQVUsa0JBQWtCLENBQzlDLElBQVUsRUFDVixRQUFnQixFQUNoQixJQUFZO0lBRVosTUFBTSxFQUFFLGFBQWEsRUFBRSxHQUFHLE1BQU0sdUJBQXVCLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxDQUFBO0lBQ3ZFLE1BQU0sa0JBQWtCLEdBQUcsTUFBTSxnQkFBZ0IsQ0FBQyxhQUFhLEVBQUUsSUFBSSxDQUFDLENBQUE7SUFDdEUsT0FBTyxtQkFBbUIsQ0FBQyxrQkFBa0IsQ0FBQyxDQUFBO0FBQ2hELENBQUMifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVnZW5lcmF0ZU1uZW1vbmljLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3JlZ2VuZXJhdGVNbmVtb25pYy9yZWdlbmVyYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxnQkFBZ0IsTUFBTSxxQkFBcUIsQ0FBQTtBQUNsRCxPQUFPLHVCQUF1QixNQUFNLDRCQUE0QixDQUFBO0FBQ2hFLE9BQU8sbUJBQW1CLE1BQU0sd0JBQXdCLENBQUE7QUFJeEQ7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxPQUFPLENBQUMsS0FBSyxVQUFVLGtCQUFrQixDQUM5QyxJQUFVLEVBQ1YsUUFBZ0IsRUFDaEIsSUFBWTtJQUVaLE1BQU0sRUFBRSxhQUFhLEVBQUUsR0FBRyxNQUFNLHVCQUF1QixDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsQ0FBQTtJQUN2RSxNQUFNLGtCQUFrQixHQUFHLE1BQU0sZ0JBQWdCLENBQUMsYUFBYSxFQUFFLElBQUksQ0FBQyxDQUFBO0lBQ3RFLE9BQU8sbUJBQW1CLENBQUMsa0JBQWtCLENBQUMsQ0FBQTtBQUNoRCxDQUFDIn0=
/// <reference types="node" />
/**
* Converts a given secret key to its BIP-39 mnemonic representation.
*
* Returns the mnemonic as an array of words.
*
* See `mnemonicToSecretKey.ts`.
*/
export default function secretKeyToMnemonic(secretKey: Buffer): ReadonlyArray<string>;
import { entropyToMnemonic } from 'bip39';
/**
* Converts a given secret key to its BIP-39 mnemonic representation.
*
* Returns the mnemonic as an array of words.
*
* See `mnemonicToSecretKey.ts`.
*/
export default function secretKeyToMnemonic(secretKey) {

@@ -6,2 +13,2 @@ // library returns wordlist as space-delimited string. Arrays should be easier to handle.

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VjcmV0S2V5VG9NbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZWNyZXRLZXlUb01uZW1vbmljL3NlY3JldEtleVRvTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sT0FBTyxDQUFBO0FBRXpDLE1BQU0sQ0FBQyxPQUFPLFVBQVUsbUJBQW1CLENBQUMsU0FBaUI7SUFDM0QseUZBQXlGO0lBQ3pGLE9BQU8saUJBQWlCLENBQUMsU0FBUyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFBO0FBQ2hELENBQUMifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VjcmV0S2V5VG9NbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zZWNyZXRLZXlUb01uZW1vbmljL3NlY3JldEtleVRvTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sT0FBTyxDQUFBO0FBRXpDOzs7Ozs7R0FNRztBQUNILE1BQU0sQ0FBQyxPQUFPLFVBQVUsbUJBQW1CLENBQUMsU0FBaUI7SUFDM0QseUZBQXlGO0lBQ3pGLE9BQU8saUJBQWlCLENBQUMsU0FBUyxDQUFDLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxDQUFBO0FBQ2hELENBQUMifQ==

@@ -5,7 +5,44 @@ /// <reference types="node" />

import { PayloadAndKind, ClientSignedState, SignStatesRequestPayload, AddMovementPayload } from '../payload';
/**
* Generates the canonical string for a given payload.
*
* The canonical string is a human-readable JSON representation of the payload
* parameters. The keys are alphabetized, and are represented in snake case.
*/
export declare const canonicalString: (a1: object) => string;
/**
* Different payload types have different preprocessing strategies. This is a
* convenience function to properly process various payloads.
*/
export declare const canonicalizePayload: (kind: SigningPayloadID, payload: object) => string;
/**
* Signs a payload using a private key. The private key should be the key
* created by initialization of the Nash Protocol. Payloads are signed via
* [ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm)
* using [secp256k1](https://en.bitcoin.it/wiki/Secp256k1).
*
* If the payload to be signed is for a blockchain operation, the `Config`
* object must be passed as well to create the blockchain signatures.
*
* Refer to the documentation for the `Config` interface and to `initialize.ts`.
*/
export default function signPayload(privateKey: Buffer, payloadAndKind: PayloadAndKind, config?: Config): PayloadSignature;
/**
* Signs blockchain data. Returns an array of signatures. Needed for operations
* such as order placement.
*
* If the operation occurs within the same blockchain origin, 1 signature is
* returned. For example, 1 signature is returned when trading NEO for GAS.
*
* If the operation is cross-chain, 2 signatures are returned. For example, two
* signatures are returned for a BTC-ETH trade.
*/
export declare function signBlockchainData(config: Config, payloadAndKind: PayloadAndKind): ReadonlyArray<BlockchainSignature>;
/**
* @TODO Add documentation.
*/
export declare function determineSignatureNonceTuplesNeeded(config: Config, blockchainData: BlockchainData): ChainNoncePair[];
/**
* @TODO Add documentation.
*/
export declare function addRawBlockchainOrderData(config: Config, payloadAndKind: PayloadAndKind): object;

@@ -12,0 +49,0 @@ export declare function signStateListAndRecycledOrders(config: Config, payload: any): SignStatesRequestPayload;

@@ -19,6 +19,15 @@ import hexEncoding from 'crypto-js/enc-hex';

const ORDER_NONCE_IGNORE = 4294967295;
// Generates the canonical string for the given arbitrary payload.
/**
* Generates the canonical string for a given payload.
*
* The canonical string is a human-readable JSON representation of the payload
* parameters. The keys are alphabetized, and are represented in snake case.
*/
export const canonicalString = compose(toLower, JSON.stringify, o => Object.keys(o)
.sort()
.reduce((acc, el) => ({ ...acc, [el]: o[el] }), {}), deep(mapKeys(snakeCase)));
/**
* Different payload types have different preprocessing strategies. This is a
* convenience function to properly process various payloads.
*/
export const canonicalizePayload = (kind, payload) => {

@@ -46,3 +55,13 @@ switch (kind) {

};
// Signs the given payload with the given private key.
/**
* Signs a payload using a private key. The private key should be the key
* created by initialization of the Nash Protocol. Payloads are signed via
* [ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm)
* using [secp256k1](https://en.bitcoin.it/wiki/Secp256k1).
*
* If the payload to be signed is for a blockchain operation, the `Config`
* object must be passed as well to create the blockchain signatures.
*
* Refer to the documentation for the `Config` interface and to `initialize.ts`.
*/
export default function signPayload(privateKey, payloadAndKind, config) {

@@ -95,6 +114,12 @@ let blockchainRaw;

}
// If we are trading within the same blockchain origin we only need 1 signature,
// neo_gas, nos_neo, etc..
// Otherwise we are trading cross chain, hence need signatures for both blockchains,
// neo_eth, eth_btc, etc..
/**
* Signs blockchain data. Returns an array of signatures. Needed for operations
* such as order placement.
*
* If the operation occurs within the same blockchain origin, 1 signature is
* returned. For example, 1 signature is returned when trading NEO for GAS.
*
* If the operation is cross-chain, 2 signatures are returned. For example, two
* signatures are returned for a BTC-ETH trade.
*/
export function signBlockchainData(config, payloadAndKind) {

@@ -142,2 +167,5 @@ // if this is a movement we don't want to do all the stuff below

}
/**
* @TODO Add documentation.
*/
export function determineSignatureNonceTuplesNeeded(config, blockchainData) {

@@ -166,2 +194,5 @@ const { unitA, unitB } = getUnitPairs(blockchainData.marketName);

}
/**
* @TODO Add documentation.
*/
export function addRawBlockchainOrderData(config, payloadAndKind) {

@@ -188,2 +219,5 @@ const blockchainData = inferBlockchainData(payloadAndKind);

}
/*
* @TODO Add documentation.
*/
export function signStateListAndRecycledOrders(config, payload) {

@@ -196,2 +230,5 @@ return {

}
/*
* @TODO Add documentation.
*/
export function signRecycledOrdersForAddMovement(config, payload) {

@@ -203,2 +240,5 @@ if (payload.recycled_orders !== undefined) {

}
/*
* @TODO Add documentation.
*/
export function signStateList(config, items) {

@@ -219,2 +259,5 @@ const result = items.map((item) => {

}
/*
* @TODO Add documentation.
*/
export function alterOrderPayloadForGraphql(payload) {

@@ -232,2 +275,2 @@ // for order nonce_from/nonce_to, this is actually tracked from within the payload blockchain signatures object

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnblBheWxvYWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2lnblBheWxvYWQvc2lnblBheWxvYWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxXQUFXLE1BQU0sbUJBQW1CLENBQUE7QUFDM0MsT0FBTyxNQUFNLE1BQU0sa0JBQWtCLENBQUE7QUFDckMsT0FBTyxDQUFDLE1BQU0sUUFBUSxDQUFBO0FBQ3RCLE9BQU8sRUFBRSxFQUFFLElBQUksRUFBRSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQ25DLE9BQU8sT0FBTyxNQUFNLG1CQUFtQixDQUFBO0FBQ3ZDLE9BQU8sT0FBTyxNQUFNLG1CQUFtQixDQUFBO0FBQ3ZDLE9BQU8sU0FBUyxNQUFNLHFCQUFxQixDQUFBO0FBQzNDLE9BQU8sT0FBTyxNQUFNLG1CQUFtQixDQUFBO0FBRXZDLE9BQU8sU0FBUyxNQUFNLGNBQWMsQ0FBQTtBQUNwQyxPQUFPLFNBQVMsTUFBTSxjQUFjLENBQUE7QUFDcEMsT0FBTyxJQUFJLE1BQU0sZUFBZSxDQUFBO0FBRWhDLE9BQU8sRUFDTCxVQUFVLEVBQ1Ysc0JBQXNCLEVBQ3RCLHVCQUF1QixFQUN2QixnQkFBZ0IsRUFDaEIsY0FBYyxFQUNkLGNBQWMsRUFDZixNQUFNLDZCQUE2QixDQUFBO0FBRXBDLE9BQU8sRUFNTCxZQUFZLEVBQ2IsTUFBTSxZQUFZLENBQUE7QUFDbkIsT0FBTyxFQUFFLG1CQUFtQixFQUFFLFlBQVksRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHFCQUFxQixDQUFBO0FBQzlGLE9BQU8sRUFDTCwwQkFBMEIsRUFDMUIsNkJBQTZCLEVBQzdC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R0FBUSxFQUFFLEdBQUcsT0FBTyxFQUFFLENBQUE7SUFDdkMsT0FBTyxXQUFXLENBQUMsVUFBVSxDQUFBO0lBQzdCLE9BQU8sV0FBVyxDQUFDLFFBQVEsQ0FBQTtJQUMzQixXQUFXLENBQUMsU0FBUyxHQUFHLGtCQUFrQixDQUFBO0lBQzFDLFdBQVcsQ0FBQyxPQUFPLEdBQUcsa0JBQWtCLENBQUE7SUFDeEMsT0FBTyxXQUFXLENBQUE7QUFDcEIsQ0FBQyJ9
/// <reference types="node" />
/**
* Converts a buffer to a hex string. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
export default function stringify(buffer: Buffer): string;

@@ -0,4 +1,10 @@

/**
* Converts a buffer to a hex string. Used for consistency to ensure the
* proper canonical string representation for buffers.
*
* See `bufferize.ts`.
*/
export default function stringify(buffer) {
return buffer.toString('hex');
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0cmluZ2lmeS9zdHJpbmdpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE9BQU8sVUFBVSxTQUFTLENBQUMsTUFBYztJQUM5QyxPQUFPLE1BQU0sQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUE7QUFDL0IsQ0FBQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0cmluZ2lmeS9zdHJpbmdpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0dBS0c7QUFDSCxNQUFNLENBQUMsT0FBTyxVQUFVLFNBQVMsQ0FBQyxNQUFjO0lBQzlDLE9BQU8sTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQTtBQUMvQixDQUFDIn0=
/// <reference types="node" />
/**
* A record containing a user's encrypted secret key and associated data.
* Requires a corresponding encryption key with which to decrypt the secret
* key in order to function.
*
* This value is passed to the Nash Central Account System for new accounts.
* The corresponding encryption key is never passed, and needs to be supplied
* by the client.
*
* Two top-level functions deal with AEADs: `encryptSecretKey.ts` and
* `decryptSecretKey.ts`.
*
* Additionally, initialization of the Nash Protocol for a user requires the
* user's AEAD.
*
* Refer to [this manual](https://www.cryptosys.net/manapi/api_aeadalgorithms.html)
* for more information on the nonce and tag.
*/
export default interface AEAD {
/**
* The encrypted version of a user's master key.
*/
readonly encryptedSecretKey: Buffer;
/**
* Associated AEAD data.
*/
readonly nonce: Buffer;
/**
* Associated AEAD data.
*/
readonly tag: Buffer;
}

@@ -0,2 +1,12 @@

/**
* Represents an asset on the Nash Exchange.
*
* Generally, this is consumed in the form of `Record<string, Asset>` where
* `string` represents the asset's name. This interface represents the
* absolute minimum of properties needed for the Nash Protocol to function.
*/
export default interface Asset {
/**
* Represents the chain this asset uses, such as NEO or ETH.
*/
readonly blockchain: string;

@@ -3,0 +13,0 @@ readonly hash: string;

@@ -0,1 +1,4 @@

/**
* @TODO Add documentation.
*/
export default interface BlockchainData {

@@ -11,2 +14,5 @@ readonly amount: string;

}
/**
* @TODO Add documentation.
*/
export interface ChainNoncePair {

@@ -13,0 +19,0 @@ chain: string;

import Market from './market';
import Asset from './asset';
import Wallet from './wallet';
/**
* The user-specific configuration object generated by initialization of the
* Nash protocol. Used as an input for various operations, such as signing.
*
* Derived from `InitParams`. Should generally be made accessible on program
* start, as most important Nash operations require this `Config`.
*/
export default interface Config {
/**
* Transparently forwarded from `InitParams` for convenience.
*/
readonly assetData: {
readonly [key: string]: Asset;
};
/**
* Transparently forwarded from `InitParams` for convenience.
*/
readonly marketData: {
readonly [key: string]: Market;
};
/**
* All of a user's `Wallet`s for all supported blockchains.
*
* Note that private keys are included, so this should never be exposed.
*/
readonly wallets: Record<string, Wallet>;
/**
* The public and private keypair used by the user to sign payloads.
*
* Refer to `signPayload.ts` and
* `generateWallet.ts#generateNashPayloadSigningKey()` for more information.
*
* @TODO: While this type is valid, it is confusing, as it's not _really_ a
* wallet. It just coincidentally has a private and public key.
*/
readonly payloadSigningKey: Wallet;
}
/// <reference types="node" />
/**
* The stretched keys derived from a master password via HKDF. Created via
* `getHKDFKeysFromPassword`.
*/
export default interface HKDFKeys {
/**
* The derived key used for authentication with Nash's Central Accounts System.
*
* This is sent to Nash servers whenever signing in. This should never be
* exposed elsewhere, but even if it is, an attacker will have limited
* capability if the encryption key is not exposed.
*/
readonly authKey: Buffer;
/**
* The derived key used for encrypting the user's secret key.
*
* This is _NEVER_ sent to the Nash servers, and should _NEVER_ be exposed.
* If made available with the user's encrypted secret key, all of the user's
* funds are freely accessible.
*/
readonly encryptionKey: Buffer;
}
/// <reference types="node" />
import { Asset, Market, AEAD } from '../types';
/**
* The configuration parameters used to initialize the Nash Protocol.
*
* Used to generate a `Config`.
*/
export default interface InitParams {
/**
* The secret key needed to decrypt the AEAD. If operating on the AEAD
* returned by the CAS after authenticating, this should be the encryption
* key derived from the user's password.
*
* Refer to the documentation for `getHKDFKeysFromPassword.md`.
*/
encryptionKey: Buffer;
/**
* A user's AEAD. When initializing, this is received from the CAS after
* authenticating.
*
* Refer to the documentation for the `AEAD` interface.
*/
aead: AEAD;
/**
* A record of wallet types to chain index.
*
* For more information, refer to the [BIP-44 spec](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#index).
*/
walletIndices: {
readonly [key: string]: number;
};
/**
* A record of asset names to asset parameters.
*
* For more information, refer to the `Asset` interface.
*/
assetData?: {
readonly [key: string]: Asset;
};
/**
* A record of market names to market parameters.
*
* For more information, refer to the `Market` interface.
*/
marketData?: {
readonly [key: string]: Market;
};
/**
* The blockchain network to use.
*/
net?: 'MainNet' | 'TestNet' | 'LocalNet';
}

@@ -0,6 +1,31 @@

/**
* Represents a market on the Nash Exchange.
*
* Generally, this is consumed in the form of `Record<string, Market>` where
* `string` represents the market's name. This interface represents the
* absolute minimum of properties needed for the Nash Protocol to function.
*/
export default interface Market {
/**
* Represents the smallest increment by which an order size can increase in
* the given market.
*
* For example, if `minTickSize` is `0.1`, all trades must be sized in
* increments of `0.1`.
*/
readonly minTickSize: number;
/**
* Represents the lowest price an order can have in the given market.
*/
readonly minTradeSize: number;
/**
* Represents the smallest increment by which an order price can increase for
* the given market's `aUnit`, or base currency.
*/
readonly minTradeIncrementA: number;
/**
* Represents the smallest increment by which an order price can increase for
* the given market's `bUnit`, or quote currency.
*/
readonly minTradeIncrementB: number;
}

@@ -0,1 +1,6 @@

/**
* The output from payload signing for blockchain operations.
*
* Refer to the documentation for `signPayload.ts`.
*/
export interface BlockchainSignature {

@@ -8,3 +13,25 @@ readonly blockchain: string;

}
/**
* The output from payload signing. Is used by the Nash Matching Engine to
* validate the authenticity of requests.
*
* A `PayloadSignature` may optionally contain a blockchain movement, which is
* needed for certain operations that interact with the blockchain, such as
* order placement. For such requests, the `payload` should include appropriate
* blockchain signatures.
*
* Refer to the documentation for `signPayload.ts`.
*/
export interface PayloadSignature {
/**
* The payload being signed with optional embedded blockchain signatures.
*
* At a bare minimum, a `timestamp` is required. For operations involving
* blockchain, a `blockchain_signatures` array is also required.
*
* @TODO Better instructions needed for how to use blockchain signatures.
*
* @property `timestamp` Current timestamp in milliseconds.
* @property `blockchain_signatures` An array of blockchain signatures.
*/
readonly payload: Record<string, any>;

@@ -16,2 +43,5 @@ readonly signature: string;

}
/**
* @TODO add documentation.
*/
export interface BlockchainMovement {

@@ -18,0 +48,0 @@ prefix: string;

@@ -0,6 +1,23 @@

/**
* Represents a standardized wallet interface agnostic of blockchain.
*/
export default interface Wallet {
/**
* A shortened form of the public key.
*/
readonly address: string;
/**
* Key granting ownership of wallet funds. Derived from the 12-word mnemonic.
*/
readonly privateKey: string;
/**
* Key used for receiving funds. Derived from private key.
*/
readonly publicKey: string;
/**
* Wallet index as defined by BIP-44 used for HD key derivation.
*
* For more information, refer to the [BIP-44 spec](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#index).
*/
readonly index: number;
}

@@ -0,2 +1,5 @@

/**
* Returns the number of milliseconds since the Unix Epoch.
*/
export declare const createTimestamp: () => number;
export declare const createTimestamp32: () => number;
const EPOCH_START = 155000000000;
/**
* Returns the number of milliseconds since the Unix Epoch.
*/
export const createTimestamp = () => {

@@ -8,2 +11,2 @@ return new Date().getTime();

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlVGltZXN0YW1wLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL2NyZWF0ZVRpbWVzdGFtcC9jcmVhdGVUaW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxXQUFXLEdBQUcsWUFBWSxDQUFBO0FBRWhDLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBRyxHQUFXLEVBQUU7SUFDMUMsT0FBTyxJQUFJLElBQUksRUFBRSxDQUFDLE9BQU8sRUFBRSxDQUFBO0FBQzdCLENBQUMsQ0FBQTtBQUVELE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLEdBQVcsRUFBRTtJQUM1QyxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsZUFBZSxFQUFFLEdBQUcsRUFBRSxDQUFDLEdBQUcsV0FBVyxDQUFBO0FBQ3pELENBQUMsQ0FBQSJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlVGltZXN0YW1wLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3V0aWxzL2NyZWF0ZVRpbWVzdGFtcC9jcmVhdGVUaW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxXQUFXLEdBQUcsWUFBWSxDQUFBO0FBRWhDOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sZUFBZSxHQUFHLEdBQVcsRUFBRTtJQUMxQyxPQUFPLElBQUksSUFBSSxFQUFFLENBQUMsT0FBTyxFQUFFLENBQUE7QUFDN0IsQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE1BQU0saUJBQWlCLEdBQUcsR0FBVyxFQUFFO0lBQzVDLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxlQUFlLEVBQUUsR0FBRyxFQUFFLENBQUMsR0FBRyxXQUFXLENBQUE7QUFDekQsQ0FBQyxDQUFBIn0=

@@ -0,1 +1,8 @@

/**
* Checks if an array of BIP39 words forms a valid BIP39 mnemonic. Note that
* Nash uses 12-word mnemonics, but this function will return `true` for a spec
* compliant mnemonic of any length.
*
* @param mnemonic An array of words to validate.
*/
export default function validateMnemonic(mnemonic: ReadonlyArray<string>): boolean;
import { validateMnemonic as validate } from 'bip39';
/**
* Checks if an array of BIP39 words forms a valid BIP39 mnemonic. Note that
* Nash uses 12-word mnemonics, but this function will return `true` for a spec
* compliant mnemonic of any length.
*
* @param mnemonic An array of words to validate.
*/
export default function validateMnemonic(mnemonic) {
return validate(mnemonic.join(' '));
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGVNbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy92YWxpZGF0ZU1uZW1vbmljL3ZhbGlkYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixJQUFJLFFBQVEsRUFBRSxNQUFNLE9BQU8sQ0FBQTtBQUVwRCxNQUFNLENBQUMsT0FBTyxVQUFVLGdCQUFnQixDQUFDLFFBQStCO0lBQ3RFLE9BQU8sUUFBUSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtBQUNyQyxDQUFDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdGVNbmVtb25pYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy92YWxpZGF0ZU1uZW1vbmljL3ZhbGlkYXRlTW5lbW9uaWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixJQUFJLFFBQVEsRUFBRSxNQUFNLE9BQU8sQ0FBQTtBQUVwRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLENBQUMsT0FBTyxVQUFVLGdCQUFnQixDQUFDLFFBQStCO0lBQ3RFLE9BQU8sUUFBUSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtBQUNyQyxDQUFDIn0=

@@ -5,2 +5,7 @@ # Change Log

<a name="2.2.2"></a>
## [2.2.2](https://gitlab.com/nash-io/frontend/nash-protocol/compare/v2.1.26...v2.2.2) (2019-09-30)
No code changes. Update documentation.
<a name="2.2.1"></a>

@@ -7,0 +12,0 @@ ## [2.2.1](https://gitlab.com/nash-io/frontend/nash-protocol/compare/v2.1.31...v2.2.1) (2019-09-09)

{
"name": "@neon-exchange/nash-protocol",
"version": "2.2.1",
"version": "2.2.2",
"description": "TypeScript implementation of Nash crypto routines",

@@ -29,6 +29,7 @@ "main": "build/main/index.js",

"cov:check": "nyc report && nyc check-coverage --lines 100 --functions 100 --branches 100",
"docs": "typedoc src/",
"version": "standard-version",
"reset": "git clean -dfx && git reset --hard && yarn",
"clean": "rm -rf build test",
"all": "yarn reset && yarn test && yarn cov:check",
"all": "yarn reset && yarn test && yarn cov:check && yarn docs",
"prepare-release": "yarn all && yarn version",

@@ -76,2 +77,3 @@ "preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('nash-protocol must be installed with Yarn: https://yarnpkg.com/')\""

"tslint-immutable": "5.0.0",
"typedoc": "0.15.0",
"typescript": "3.1.6"

@@ -78,0 +80,0 @@ },

# nash-protocol
Implementation of Nash cryptographic routines
Implementation of Nash cryptographic routines.
This document is very WIP and should be checked for accuracy by someone with more expertise!
## [Documentation](docs/index.html)
Currently, you should clone the repository to access the HTML documentation. This may be statically hosted separately at some point for convenience.
## Getting started

@@ -13,114 +15,49 @@

## Usage Summary
## API
### Onboarding
```typescript
/*
Secure-randomly generates a series of random bytes.
* publicKey is used to verify signatures.
* secretKey is the "master key" used to sign stuff and to generate mnemonic.
The Nash Protocol contains functions necessary to create, setup, and authenticate into an account.
Uses crypto-browserify/randombytes which polyfills node crypto.
#### Account creation
Spec: SIGGEN()
*/
getEntropy = () => { publicKey: Buffer, secretKey: Buffer }
This step registers a new user with Nash's Central Accounts System.
/*
Converts entropy to wordlist. We can supply our own wordlist for i18n.
This is not an encryption, it's a simple mapping.
1. A user signs up for an account and provides a password.
2. `hashPassword()` should be called to hash the password, and `getHKDFKeysFromPassword()` should be called on the hasked password to get an **authentication key** and **encryption key**.
3. The **authentication key** is sent to Nash's Central Accounts System in lieu of the original password, and is what is used hereafter for authentication. The **encryption key** is never sent to Nash, and must be computed on the fly from the user's password by the client.
Uses bitcoinjs/bip39 implementation.
*/
secretKeyToMnemonic = (secretKey: Buffer) => Array<string>
#### Account setup
/*
Converts wordlist back to entropy.
*/
mnemonictoSecretKey = (Array<string>) => Buffer
This step creates blockchain wallets for a user.
/*
Creates the master seed which is the foundation of all wallet secret keys.
Use PBKDF2.
1. `getEntropy()` is called to generate a **secret key**.
2. `secretKeyToMnemonic()` is called on the **secret key** to provide a user's **mnemonic**. The user should persist this and never share this value.
3. `mnemonicToMasterSeed()` is called on the **mnemonic** to create the **master seed**, which is the seed value for BIP-44 HD wallet generation.
4. `generateWallet` is called using the **master seed** for all supported coin types.
5. Wallet public keys are sent to Nash. Private keys are never sent to Nash, and should be computed on the fly by the client.
6. The **secret key** is encrypted with `encryptSecretKey()`, which produces an **encrypted secret key AEAD object**. This is sent to Nash.
Uses bitcoinjs/bip39 implementation.
*/
mnemonicToMasterSeed = (mnemonic: Array<string>) => Buffer
### Authentication
/*
Hashes user password using scrypt with parameters N = 16384, r = 8, p = 1.
1. User provides their password.
2. `getHKDFKeysFromPassword()` is used to get the **authentication key** and **encryption key**.
3. The **authentication key** is sent to Nash, which responds with the **encrypted secret key AEAD object** and some **wallet metadata** (public keys and chain heights).
4. The client calls `initialize()` with the **encrypted secret key AEAD object**, **encryption key**, **wallet metadata**, and some Nash Matching Engine market and asset data to receive a **config**.
5. This **config** contains all necessary values to interact with the Nash Matching Engine, including the ability to sign payloads needed for operations such as order placement, viewing private account information, asset transfers, and staking.
Spec: SCRYPT()
## Glossary
Uses scrypt-js implementation.
*/
hashPassword = (password: string) => Promise<Buffer>
**Secret** values are never sent to Nash. Values that are **visible to Nash** are. A combination of secret values and values accessible by Nash are needed for all sensitive operations. Both types of values are sensitive and should be carefully guarded.
/*
Derives two symmetric secret keys from password via HKDF. Uses user ID as salt.
* authKey is stored server side for use in authentication
* encryptionKey is used to encrypt the secret key
Uses futoin-hkdf implementation.
Spec: HKDF()
*/
getHKDFKeysFromPassword = (password: string, salt: string) => Promise<{ authKey: Buffer, encryptionKey: Buffer }>
/*
Encrypts master key using encryptionKey. Uses AEAD. Reversible.
aead is stored server-side.
Uses crypto-browserify/browserify-aes implementation, which polyfills Node `crypto`.
Spec: ENC(), DEC()
*/
interface AEAD = {
encryptedSecretKey: Buffer
nonce: Buffer
tag: Buffer
}
encryptSecretKey = (encryptionKey: Buffer, secretKey: Buffer) => AEAD
decryptSecretKey = (encryptionKey: Buffer, aead: AEAD) => Promise<Buffer>
/*
Regenerates mnemonic. Because the only information the user has is their
password, we have to go through several hash/encrypt/decrypt steps.
aead can come from the server as it is secure.
*/
regenerateMnemonic = (aead: AEAD, password: string): Array<String>
```
## Usage Summary
### Onboarding
1. User signs up for an account with a password (and other stuff). `getEntropy()` generates their keys.
2. Secret key is used to generate mnemonic with `secretKeyToMnemonic()`. Asynchronously, the master seed is used to generate the master seed with `mnemonicToMasterSeed()`.
3. User confirms they recorded the mnemonic.
4. Auth / encryption keys are derived from password with `hashPassword()` and `getHKDFKeysFromPassword()`. Auth key is sent to server.
5. Encryption key is used to encrypt the secret key with `encryptSecretKey()`. Output is sent to server.
6. Wallets are created with the master seed.
### Logging in
1. User submits password. Client processes into auth / encryption keys. Auth key is used to login, server responds with `aead` which can be decrypted using the encryption key.
## Glossary
- Auth key: Derived from password. **Stored on the server side** to validate sessions.
- Authentication key: Derived from password. Used to authentcate into Nash's systems. **Visible to Nash**.
- BIP-39: Protocol for generating master seed from private key.
- BIP-44: Protocol for generating wallet addresses from master seed.
- Chain: an ID for each blockchain we want to generate a private key for. Constant. TODO: Should this use the standardized chain IDs described in BIP-44, or should we make our own?
- Encryption key: Derived from password. Used to encrypt the private key for server side storage.
- Entropy: A secure-randomly generated bitstring composed of public and private key.
- Master seed: Hash generated by `PBKDF2(mnemonic, passphrase = "")` Iteration = 2048, uses HMAC-SHA512. Should be 512 bits (64 bytes). Used to generate wallet addresses.
- Mnemonic: A n-word phrase generated from the entropy using a wordlist. Can be used along with passphrase to (re)generate the master seed. **User needs to memorize this.**
- Passphrase: An optional string for use with the `PBKDF2()` encryption function.
- Password: User's login credential. Used to generate encryption key and auth key via HKDF.
- PBKDF2: The encryption function used to generate the master seed from the mnemonic and an optional passphrase.
- Private key: Abstracted into the **mnemonic** for better UX. We use this as the "master key" -- the ultimate password from which everything is derived, that should be protected at all costs. **An encrypted version is stored on the server side.**
- Public key: Used to verify signatures.
- Chain: an ID for each blockchain we want to generate a private key for. Constant. Nash uses the [coin types](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#coin-type) as defined by BIP044.
- Encrypted secret key: The secret key encrypted via the encryption key via AEAD. Cannot be decrypted without the encryption key. **Visible to Nash.**
- Encryption key: Derived from password. Used to encrypt the private key for server side storage. **Secret.**
- Master seed: Value used to generate wallets. Derived from mnemonic. **Secret.**
- Mnemonic: A n-word phrase generated from the secret key using a wordlist. Can be used along with passphrase to (re)generate the master seed. **Secret.**
- Password: User's login credential. Used to generate encryption key and auth key via HKDF. **Secret.**
- Secret key: A random value. Abstracted into the **mnemonic** for better user experience. We use this as the "master key" -- the ultimate password from which everything is derived, that should be protected at all costs. **Secret.** (An encrypted version is visible to Nash.)

@@ -127,0 +64,0 @@ ## Notes

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc