bcoin-org / bcoin

Javascript bitcoin library for node.js and browsers
https://bcoin.io
Other
2.98k stars 811 forks source link

add korean word module to hd mnemonic #1158

Closed ChrisCho-H closed 12 months ago

ChrisCho-H commented 1 year ago

Korea is one of the largest in terms of the number of users in crypto. I refer to bip39.js where Korean support is implemented. expect zero harm with useful utility.

theanmolsharma commented 1 year ago

I'd like to see some tests before we get it merged.

ChrisCho-H commented 1 year ago

image

I've tested and it works well! You can try mnemonic-test to verify.

theanmolsharma commented 1 year ago

Tested ACK. Before we merge, I'd like you to squash all commits into a single commit.

ChrisCho-H commented 1 year ago

alright

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 50.00% and no project coverage change.

Comparison is base (b005869) 69.55% compared to head (49a0cca) 69.56%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1158 +/- ## ======================================= Coverage 69.55% 69.56% ======================================= Files 158 159 +1 Lines 26603 26607 +4 ======================================= + Hits 18505 18509 +4 Misses 8098 8098 ``` | [Impacted Files](https://app.codecov.io/gh/bcoin-org/bcoin/pull/1158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcoin-org) | Coverage Δ | | |---|---|---| | [lib/hd/mnemonic.js](https://app.codecov.io/gh/bcoin-org/bcoin/pull/1158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcoin-org#diff-bGliL2hkL21uZW1vbmljLmpz) | `82.14% <ø> (ø)` | | | [lib/hd/wordlist-browser.js](https://app.codecov.io/gh/bcoin-org/bcoin/pull/1158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcoin-org#diff-bGliL2hkL3dvcmRsaXN0LWJyb3dzZXIuanM=) | `0.00% <0.00%> (ø)` | | | [lib/hd/words/index.js](https://app.codecov.io/gh/bcoin-org/bcoin/pull/1158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcoin-org#diff-bGliL2hkL3dvcmRzL2luZGV4Lmpz) | `0.00% <0.00%> (ø)` | | | [lib/hd/wordlist.js](https://app.codecov.io/gh/bcoin-org/bcoin/pull/1158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcoin-org#diff-bGliL2hkL3dvcmRsaXN0Lmpz) | `90.90% <100.00%> (+10.90%)` | :arrow_up: | | [lib/hd/words/korean.js](https://app.codecov.io/gh/bcoin-org/bcoin/pull/1158?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcoin-org#diff-bGliL2hkL3dvcmRzL2tvcmVhbi5qcw==) | `100.00% <100.00%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/bcoin-org/bcoin/pull/1158/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bcoin-org)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

pinheadmz commented 1 year ago

Where is the word list from? I don't understand the language but it doesn't look like it matches

https://github.com/bitcoinjs/bip39/blob/master/src/wordlists/korean.json

or

https://github.com/bitcoin/bips/blob/master/bip-0039/korean.txt

Same question about the test vectors, where are those from?

ChrisCho-H commented 1 year ago

It's same with the former one(bitcoinjs/bip39). Test vector is just generated from given seed, and the phrase is one in the wordlist.

pinheadmz commented 1 year ago

ah ok, its just the rendering that confused me,

compare https://github.com/bitcoinjs/bip39/blob/master/src/wordlists/korean.json to https://raw.githubusercontent.com/bitcoinjs/bip39/master/src/wordlists/korean.json

pinheadmz commented 1 year ago

ok please just fix the lint error (single quotes)

ChrisCho-H commented 1 year ago

line error fixed