Native Node.js module for BBSCoin. This should work for all cryptonote based cryptocurrencies.
Create a GUI compatible wallet file with a single spending key.
createWallet(filePath, walletPassword, callback);
Create a GUI compatible wallet file with given keys.
generateWallet(filePath, walletPassword, address, viewSecret, spendSecret, callback);
Parse a GUI wallet file.
parseWallet(filePath, walletPassword, callback);
Create a new public/secret key pair.
generateNewKeyPair();
Create an address from public keys.
generateAddressFromKeyPair(spendPublicKey, viewPublicKey);
Get public view and spend key from a wallet address. Returns null if the address is not valid.
getKeyPairFromAddress(walletAddress);
Generate public key from secret key
secretKeyToPublicKey(secretKey)
Filter transaction output by given view and spend keys.
const transactionPublicKey = '64 characters long hex key';
const transactionOutputs = [
{
key: '64 characters long hex key'
amount: 100000,
}
]
const viewSecretKey = '64 characters long hex key';
const publicSpendKeys = [
'64 characters long hex key'
]
findOutputs(transactionPublicKey, transactionOutputs, viewSecretKey, publicSpendKeys, callback)
Check whether the ring signature is correct
checkRingSignature(txPrefixHash, keyImage, outputPublicKeysFromInput, signatures);
Generate key image
generateKeyImage({ address, viewSecret, spendSecret }, transactionHash, indexInOutput);
Decompose amount
decomposeAmount(amount, dustThreshold)
// eg:
decomposeAmount(62387455827, 500000) === [
455827,
7000000,
80000000,
300000000,
2000000000,
60000000000
]
- node (v9.5.0+)
- boost
You will need the daemon source code in order to compile this module
brew install boost
ln ../bbscoin bbscoin
npm install
node-gyp rebuild
npm test