diff options
| author | Adam Soltys <[email protected]> | 2015-12-03 20:24:37 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2015-12-03 20:24:37 -0800 |
| commit | 3de0e94e1343df0ce2cc8f39de53b1eef87b0a84 (patch) | |
| tree | cd2d4896890fa11f7c446f3ff218fbe43f3e61a1 /public/js/key.coffee | |
| parent | b5edbc724cbebb44d54ee508752cb2101a356a3d (diff) | |
| download | coinos-server-3de0e94e1343df0ce2cc8f39de53b1eef87b0a84.tar.gz coinos-server-3de0e94e1343df0ce2cc8f39de53b1eef87b0a84.zip | |
Derive BIP44 wallets from BIP39 seeds on registration, clean up wallet page
Diffstat (limited to 'public/js/key.coffee')
| -rw-r--r-- | public/js/key.coffee | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/public/js/key.coffee b/public/js/key.coffee deleted file mode 100644 index e37eda61..00000000 --- a/public/js/key.coffee +++ /dev/null @@ -1,28 +0,0 @@ -Key = -> - rng = new SecureRandom() - bytes = new Array(256) - rng.nextBytes(bytes) - - hasher = new jsSHA(bytes.toString(), 'TEXT') - rng.nextBytes(bytes) - - I = hasher.getHMAC(bytes.toString(), "TEXT", "SHA-512", "HEX") - il = Crypto.util.hexToBytes(I.slice(0, 64)) - ir = Crypto.util.hexToBytes(I.slice(64, 128)) - - key = new BIP32() - key.eckey = new Bitcoin.ECKey(il) - key.eckey.pub = key.eckey.getPubPoint() - key.eckey.setCompressed(true) - key.eckey.pubKeyHash = Bitcoin.Util.sha256ripe160(key.eckey.pub.getEncoded(true)) - key.has_private_key = true - - key.chain_code = ir - key.child_index = 0 - key.parent_fingerprint = Bitcoin.Util.hexToBytes("00000000") - key.version = BITCOIN_MAINNET_PRIVATE - key.depth = 1 - - key.build_extended_public_key() - key.build_extended_private_key() - return key |
