可划分为为单、多币种钱包,及全币种钱包
单币种钱包:顾名思义,就是只为单一区块链数字资产服务的区块链钱包。因为它通常只支持单一区块链主链平台,所以也被称为主链钱包,
多币种钱包:支持多种区块链数字资产的钱包。多种区块链数字资产可以是一条区块链主链及围绕该主链协议设置的代币,也可以是多种区块链主链上不同的数字资产。
全币种钱包:支持所有类型的区块链主链数字资产和代币资产的区块链钱包。
public DeterministicSeed(byte[]entropy,String passphrase,long creationTimeSeconds){
...
this.seed=MnemonicCode.toSeed(mnemonicCode,passphrase);
...
}
public static byte[]toSeed(List<String>words,String passphrase){
checkNotNull(passphrase,"A null passphrase is not allowed.");
//To create binary seed from mnemonic,we use PBKDF2 function
//with mnemonic sentence(in UTF-8)used as a password and
//string"mnemonic"+passphrase(again in UTF-8)used as a
//salt.Iteration count is set to 4096 and HMAC-SHA512 is
//used as a pseudo-random function.Desired length of the
//derived key is 512 bits(=64 bytes).
//将助记词连接起来,以空格作为分隔符。pass格式:"aa bb cc dd..."
String pass=Utils.SPACE_JOINER.join(words);
String salt="mnemonic"+passphrase;
final Stopwatch watch=Stopwatch.createStarted();
//使用PBKDF2SHA512生成64位的种子
byte[]seed=PBKDF2SHA512.derive(pass,salt,PBKDF2_ROUNDS,64);
watch.stop();
log.info("PBKDF2 took{}",watch);
return seed;
}