จาก Seed Phrase สู่ Binary Seed
การสร้าง Seed จาก Seed Phrase
ในการสร้าง Binary Seed นั้นจะใช้ function ชื่อว่า PBKDF2 ซึ่งหน้าตาจะเป็นแบบนี้
pbkdf2(password, salt, iterations-count, hash-function, derived-key-len)
แต่ละ parameters จะแทนค่าตามนี้
passwordคือ mnemonic sentence หรือ seed phrase (encoded in UTF-8) ยกตัวอย่างเช่นcraneprofitfanholdpictureboardsoccermangodanceclipnephewplugsaltคือ คำว่า “mnemonic” + passphrase (encoded in UTF-8) หรือ ถ้าไม่มี passphrase ก็จะเป็นแค่คำว่า “mnemonic” คำเดียว ยกตัวอย่างเช่น กรณีมี passphrase ก็คือmnemonichelloworldหรือ กรณีไม่มี passphrase ก็คือmnemoniciterations-countคือ 2048hash-functionคือ HMAC-SHA512derived-key-lenคือ 512 bits หรือ 64 bytes
ค่า binary ที่ได้ออกมาจาก function จะมีความยาวตาม derived-key-len ก็คือ 512 bits ซึ่งสามารถนำค่านี้ไปสร้าง deterministic wallets ตาม BIP-32 ได้
Write a comment