mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-06 19:03:49 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90f7a5ec93 | ||
|
|
dd496c82c1 | ||
|
|
1dafc30db4 | ||
|
|
927450e169 | ||
|
|
a67554c649 | ||
|
|
0bc6361db4 | ||
|
|
a98d40c43d | ||
|
|
54a8e781b4 | ||
|
|
c1d6274224 | ||
|
|
c16661aeea | ||
|
|
e9491c7efd | ||
|
|
d07983bc1f | ||
|
|
3aa7677ace | ||
|
|
9e04576e2f | ||
|
|
8131a07115 | ||
|
|
181b5d61e3 | ||
|
|
4dfc681f71 | ||
|
|
dfb4fd1be5 |
12
changelog.md
12
changelog.md
@@ -1,3 +1,15 @@
|
||||
# 0.4.2
|
||||
|
||||
* Fix ethereum private key format
|
||||
|
||||
# 0.4.1
|
||||
|
||||
* Fix no loading on chrome with third-party cookies blocked
|
||||
* Add EtherCore
|
||||
* Add RSK network
|
||||
* Add DeepOnion segwit parameters
|
||||
* Fix ethereum xpub derivation
|
||||
|
||||
# 0.4.0
|
||||
|
||||
* Third party libraries deduplicated and minified
|
||||
|
||||
@@ -1,66 +1,72 @@
|
||||
/* base-x */
|
||||
|
||||
let basex = require('base-x')
|
||||
module.exports.basex = require('base-x')
|
||||
|
||||
/* bchaddrjs */
|
||||
|
||||
let bchaddr = require('bchaddrjs')
|
||||
module.exports.bchaddr = require('bchaddrjs')
|
||||
|
||||
/* bchaddrjs slp */
|
||||
|
||||
let bchaddrSlp = require('bchaddrjs-slp')
|
||||
module.exports.bchaddrSlp = require('bchaddrjs-slp')
|
||||
|
||||
/* biginteger */
|
||||
|
||||
let BigInteger = require('javascript-biginteger')
|
||||
module.exports.BigInteger = require('javascript-biginteger')
|
||||
|
||||
/* bitcoinjs-bip38 */
|
||||
|
||||
let bip38 = require('bip38')
|
||||
module.exports.bip38 = require('bip38')
|
||||
|
||||
/* bitcoinjs-lib */
|
||||
|
||||
let bitcoin = require('bitcoinjs-lib')
|
||||
module.exports.bitcoin = require('bitcoinjs-lib')
|
||||
|
||||
/* buffer */
|
||||
|
||||
let buffer = require('buffer');
|
||||
module.exports.buffer = require('buffer');
|
||||
|
||||
/* elastos */
|
||||
// See https://github.com/iancoleman/bip39/pull/368
|
||||
// and https://github.com/johnnynanjiang/Elastos.SDK.Keypair.Javascript/tree/iancoleman-bip39
|
||||
|
||||
let elastosjs = require('elastos-wallet-js')
|
||||
module.exports.elastosjs = require('elastos-wallet-js')
|
||||
|
||||
/* ethereum-util */
|
||||
|
||||
let ethUtil = require('ethereumjs-util')
|
||||
module.exports.ethUtil = require('ethereumjs-util')
|
||||
|
||||
/* fast-levenshtein */
|
||||
|
||||
let levenshtein = require('fast-levenshtein')
|
||||
module.exports.levenshtein = require('fast-levenshtein')
|
||||
|
||||
/* groestlcoin */
|
||||
|
||||
let groestlcoinjs = require('groestlcoinjs-lib')
|
||||
module.exports.groestlcoinjs = require('groestlcoinjs-lib')
|
||||
|
||||
/* groestlcoin bip38 */
|
||||
|
||||
let groestlcoinjsBip38 = require('bip38grs')
|
||||
module.exports.groestlcoinjsBip38 = require('bip38grs')
|
||||
|
||||
/* kjua qr codes */
|
||||
|
||||
let kjua = require('kjua')
|
||||
module.exports.kjua = require('kjua')
|
||||
|
||||
/* nebulas */
|
||||
|
||||
let nebulas = require('nebulas')
|
||||
try {
|
||||
module.exports.nebulas = require('nebulas')
|
||||
}
|
||||
catch (e) {
|
||||
console.warn("Error loading nebulas library");
|
||||
console.warn(e);
|
||||
};
|
||||
|
||||
/* stellar-util */
|
||||
|
||||
let StellarBase = require('stellar-base');
|
||||
let edHd = require('ed25519-hd-key');
|
||||
let stellarUtil = {
|
||||
module.exports.stellarUtil = {
|
||||
getKeypair: function (path, seed) {
|
||||
const result = edHd.derivePath(path, seed);
|
||||
return StellarBase.Keypair.fromRawEd25519Seed(result.key);
|
||||
@@ -76,30 +82,8 @@ let stellarUtil = {
|
||||
|
||||
/* unorm */
|
||||
|
||||
let unorm = require('unorm')
|
||||
module.exports.unorm = require('unorm')
|
||||
|
||||
/* zxcvbn */
|
||||
|
||||
let zxcvbn = require('zxcvbn')
|
||||
|
||||
/* exports */
|
||||
|
||||
module.exports = {
|
||||
basex,
|
||||
bchaddr,
|
||||
bchaddrSlp,
|
||||
buffer,
|
||||
BigInteger,
|
||||
bip38,
|
||||
bitcoin,
|
||||
elastosjs,
|
||||
ethUtil,
|
||||
groestlcoinjs,
|
||||
groestlcoinjsBip38,
|
||||
kjua,
|
||||
levenshtein,
|
||||
nebulas,
|
||||
stellarUtil,
|
||||
unorm,
|
||||
zxcvbn
|
||||
}
|
||||
module.exports.zxcvbn = require('zxcvbn')
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.4.0</p>
|
||||
<p class="version">v0.4.2</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1128,14 +1128,16 @@
|
||||
}
|
||||
// Ethereum values are different
|
||||
if (networkIsEthereum()) {
|
||||
var privKeyBuffer = keyPair.d.toBuffer(32);
|
||||
privkey = privKeyBuffer.toString('hex');
|
||||
var addressBuffer = libs.ethUtil.privateToAddress(privKeyBuffer);
|
||||
var pubkeyBuffer = keyPair.getPublicKeyBuffer();
|
||||
var ethPubkey = libs.ethUtil.importPublic(pubkeyBuffer);
|
||||
var addressBuffer = libs.ethUtil.publicToAddress(ethPubkey);
|
||||
var hexAddress = addressBuffer.toString('hex');
|
||||
var checksumAddress = libs.ethUtil.toChecksumAddress(hexAddress);
|
||||
address = libs.ethUtil.addHexPrefix(checksumAddress);
|
||||
privkey = libs.ethUtil.addHexPrefix(privkey);
|
||||
pubkey = libs.ethUtil.addHexPrefix(pubkey);
|
||||
if (hasPrivkey) {
|
||||
privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer());
|
||||
}
|
||||
}
|
||||
|
||||
// Stellar is different
|
||||
@@ -1838,6 +1840,7 @@
|
||||
|| (name == "ELLA - Ellaism")
|
||||
|| (name == "ESN - Ethersocial Network")
|
||||
|| (name == "VET - VeChain")
|
||||
|| (name == "ERE - EtherCore")
|
||||
}
|
||||
|
||||
function networkHasSegwit() {
|
||||
@@ -2417,6 +2420,14 @@
|
||||
setHdCoin(194);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ERE - EtherCore",
|
||||
segwitAvailable: false,
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(466);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ESN - Ethersocial Network",
|
||||
segwitAvailable: false,
|
||||
@@ -2947,6 +2958,20 @@
|
||||
setHdCoin(175);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "RBTC - RSK",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.rubycoin;
|
||||
setHdCoin(137);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "tRBTC - RSK Testnet",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.rubycoin;
|
||||
setHdCoin(37310);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "RBY - Rubycoin",
|
||||
onSelect: function() {
|
||||
|
||||
@@ -657,4 +657,30 @@ libs.bitcoin.networks.groestlcointestnet.p2wpkhInP2sh = {
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.deeponion.p2wpkh = {
|
||||
baseNetwork: "deeponion",
|
||||
messagePrefix: '\x18DeepOnion Signed Message:\n',
|
||||
bech32: 'dpn',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x1f,
|
||||
scriptHash: 0x4e,
|
||||
wif: 0x9f
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.deeponion.p2wpkhInP2sh = {
|
||||
baseNetwork: "deeponion",
|
||||
messagePrefix: '\x18DeepOnion Signed Message:\n',
|
||||
bech32: 'dpn',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x1f,
|
||||
scriptHash: 0x4e,
|
||||
wif: 0x9f
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user