All Projects → terryjiao → Bitcoinwallet

terryjiao / Bitcoinwallet

Licence: mit
Bitcoin and ETH wallet

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bitcoinwallet

Hdwallet
Simple Swift library for creating HD cryptocurrencies wallets and working with crypto Coins/ERC20 tokens.
Stars: ✭ 80 (-35.48%)
Mutual labels:  ethereum, bitcoin, bitcoin-wallet
Balance Open
Balance Open: A GPL3-licensed macOS menu bar app for all the world’s currencies.
Stars: ✭ 279 (+125%)
Mutual labels:  ethereum, bitcoin, bitcoin-wallet
Crypto vba
An Excel/VBA project to communicate with various cryptocurrency exchanges APIs
Stars: ✭ 103 (-16.94%)
Mutual labels:  ethereum, bitcoin
Coinbasepro Python
The unofficial Python client for the Coinbase Pro API
Stars: ✭ 1,386 (+1017.74%)
Mutual labels:  ethereum, bitcoin
Gnome Feeder
Profit Trailer Feeder Full Build with Settings
Stars: ✭ 122 (-1.61%)
Mutual labels:  ethereum, bitcoin
Masterblockchain
Stars: ✭ 100 (-19.35%)
Mutual labels:  ethereum, bitcoin
Awesome Cryptocurrency Security
😎 Curated list about cryptocurrency security (reverse / exploit / fuzz..)
Stars: ✭ 102 (-17.74%)
Mutual labels:  ethereum, bitcoin
Cryptotrader
This is an experimental trading bot framework written in PHP. It may contain bugs and should not be trusted with much money
Stars: ✭ 108 (-12.9%)
Mutual labels:  ethereum, bitcoin
Coincurve
Cross-platform Python bindings for libsecp256k1
Stars: ✭ 89 (-28.23%)
Mutual labels:  ethereum, bitcoin
Coingraph
Coingraph is a real-time graph for cryptocurrencies.
Stars: ✭ 116 (-6.45%)
Mutual labels:  ethereum, bitcoin
Moneda Cli
Command line to track cryptocurrency prices
Stars: ✭ 114 (-8.06%)
Mutual labels:  ethereum, bitcoin
Coinbase Pro Node
Coinbase Pro API written in TypeScript and covered by tests.
Stars: ✭ 116 (-6.45%)
Mutual labels:  ethereum, bitcoin
Cryptocurrency Cli
💰 Cryptocurrency Portfolio On The Command Line 💰
Stars: ✭ 99 (-20.16%)
Mutual labels:  ethereum, bitcoin
Sentinel Android
Watch Only bitcoin wallet tracker for Android
Stars: ✭ 98 (-20.97%)
Mutual labels:  bitcoin, bitcoin-wallet
Diadata
DIAdata.org platform
Stars: ✭ 103 (-16.94%)
Mutual labels:  ethereum, bitcoin
Coinwink
Crypto Alerts, Watchlist and Portfolio Tracking App
Stars: ✭ 95 (-23.39%)
Mutual labels:  ethereum, bitcoin
Bitstore Ios
Native iOS Bitcoin wallet
Stars: ✭ 103 (-16.94%)
Mutual labels:  bitcoin, bitcoin-wallet
Stocklook
crypto currency library for trading & market making bots, account management, and data analysis
Stars: ✭ 119 (-4.03%)
Mutual labels:  ethereum, bitcoin
Coin registry
A global registry of JSON formatted files on 1500+ cryptocurrency tokens. Provides information like chat rooms, communities, explorers, and contact information on each coin. Used by https://blockmodo.com, DEXs, developers, and exchanges.
Stars: ✭ 85 (-31.45%)
Mutual labels:  ethereum, bitcoin
Awesome Privacy On Blockchains
A curated list of privacy on blockchains resources
Stars: ✭ 86 (-30.65%)
Mutual labels:  ethereum, bitcoin

Ethereum Wallet

Generating ETH key pairs and address from mnemonic.


1. From entropy to mnemonic

1. Generating 128 digits random entropy

UUID uuid = UUID.randomUUID();
String[] digits = uuid.toString().split("\\-");
StringBuilder randomDigits = new StringBuilder();
for (String digit : digits) {
    randomDigits.append(digit);
}

2. Doing SHA256 to entropy for checksum, append first 4 bits to the end of entropy

//generate sha-256 from entropy
String encodeStr = "";
byte[] hash = Sha256.sha256(hexStringToByteArray(entropy));
encodeStr = String.valueOf(Hex.encodeHex(hash));
System.out.println(encodeStr);
char firstSHA = encodeStr.charAt(0);
String new_entropy = entropy + firstSHA;
String bin_entropy = "";
for (int i = 0; i < new_entropy.length(); i++) {
    bin_entropy += dict[Integer.parseInt(new_entropy.substring(i, i + 1), 16)];
}

3. Segment 132 bits entropy into 11 bits long parts

String[] segments = new String[12];
for (int i = 0; i <= 11; i++) {
    segments[i] = bin_entropy.substring(i * 11, (i + 1) * 11);
}

4. Generating mnemonic from dictionary

mnemonic += wordlist[Integer.valueOf(segments[0], 2)];
for (int j = 1; j < segments.length; j++) {
    mnemonic += " " + (wordlist[Integer.valueOf(segments[j], 2)]);
}

enter image description here


2. From mnemonic to seed

Using PBKDF2 function to get 512 bits seed from mnemonic. In this part we need a salt string to generate the seed we needed. Normally the value of salt is "mnemonic" for universality

String seed;
String salt = "mnemonic";
seed = getSeed(mnemonic, salt);

enter image description here


###3. From seed to master private key

Divide 512 bits seed into two equal parts, the first 256 bits is master private key and the last 256 bits is chain code. We could use BIP32 library to do the jobs by APIs this library provided.

ExtendedPrivateKey rootKey = ExtendedPrivateKey.fromSeed(hexStringToByteArray(seed), Bitcoin.MAIN_NET);

enter image description here


###4. From master private key to child private key Firstly, generate address index to get 0th private key generated from master private key and chain code.

AddressIndex ethAddressIndex = BIP44.m().purpose44().coinType(60).account(0).external().address(0);

44.60.0.0.0 is eth address index.

And then get key pair and address that we need.

ExtendedPrivateKey childPrivateKey = rootKey.derive(ethAddressIndex, AddressIndex.DERIVATION);
byte[] privateKeyBytes = childPrivateKey.getKey(); 
ECKeyPair keyPair = ECKeyPair.create(privateKeyBytes);
List<String> returnList = EthAddress(childPrivateKey, keyPair);

enter image description here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].