- New [Default] Wallet Version 3
Better encryption scheme / key derivation. - Deprecated passing in
primaryPrivateKey
, should useprimarySeed
instead.
- Add support for
OP_RETURN
inwallet.pay
(seeexamples/opreturn_payment_api_usage.js
)
- New [Default] Wallet Version 2
BackupGenerator
now supportsextra
to be printed on document for extra notes- No longer support
BackupGenerator::generateImage
- 2FA support
- Floating Fees
createNewWallet
now returnsspread(wallet, backupInfo)
to be able to support both v1 and v2new BackupGenerator()
now takesidentifier, backupInfo, extra
- No longer support
BackupGenerator::generateImage
- Defaults to using
Wallet.FEE_STRATEGY_OPTIMAL
instead ofWallet.FEE_STRATEGY_BASE_FEE
!
Instead of using BIP39
, wallet seeds will now be stored encrypted - to allow for password changes
Wallet Creation:
primarySeed = random()
secret = random()
primaryMnemonic = BIP39.entropyToMnemonic(AES.encrypt(primarySeed, secret))
secretMnemonic = BIP39.entropyToMnemonic(AES.encrypt(secret, password))
Wallet Init:
secret = BIP39.entropyToMnemonic(AES.decrypt(secretMnemonic, password))
primarySeed = BIP39.entropyToMnemonic(AES.decrypt(primaryMnemonic, secret))
See docs/KEYS.md
for more info
Old Wallets that are v1 will remain so and will continue working.
Wallets created through the Blocktrail website will have an option to choose which version to create (default v2), as grace period the first few days after the SDK release this will default to v1 still.
To deal with stresstests etc. there's now a feePerKB
method to get the optimal fee and the wallet.pay
has a feeStrategy
argument.
When feeStrategy
is Wallet.FEE_STRATEGY_OPTIMAL
(default) it will use the (by the API calculated) optimal fee per KB.
When feeStrategy
is Wallet.FEE_STRATEGY_BASE_FEE
it will use the BASE_FEE of 0.0001 BTC per KB and use the old way of rounding the transaction size to 1 KB.
Optimal fee is calculated by taking all transactions from the last 30 blocks and calculating what the lowest possible fee is that still gives more than 80% chance to end up in the next block.
When enabled (currently still impossible to enable) you'll be required to add a twoFactorToken
to the wallet.pay
.
We'll do another patch soon to add ways to setup 2FA and add it to the GUI on the site!
- add batch support for fetching multiple transactions.
- use .notify on the pay promise for progress.
- allow for bypassing of local derivation of new address (used to verify API response)