coinables / buidljs

A wrapper for bitcoinjs-lib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Account Input Range Validation

EAWF opened this issue · comments

Haven't had time to review all of the code yet, but I know that Account numbers are "hardened," in the range of 0x80000000 to 0xFFFFFFFF, (See BIP-32 Serialization).
I'm not clear yet on how the program uses the Account number.
(Does it automatically add 0x80000000 to the Account Index? Assuming yes, but do you know how it actually works?).
As a result, I am not sure how to apply a range to the input fields for Account numbers.

This should not be an issue for any portion of the program which uses an xpub, ypub, or zpub, as the account number is already encoded(as 8xxxxxxx) within the exported, account-level, extended public key, but where someone enters an invalid account number it might cause losing funds.

Not sure, but IF I am correct, Account min="2147483648"(x80000000), max="4294967295"(xFFFFFFFF)
Question remains if the code is adjusting the index up to the hardened index.

Outside of scope. This is handled on the bitcoinjs layer.