 이번에는 니모닉으로 지갑키(PrivateKet)와 지갑주소를 생성합니다. 지갑주소는 공개키(PublicKey)에서 계산됩니다. <br><center>* * *</center><br> # ethereumjs-util 라이브러리 설치 이더리움 주소를 계산하기 위해 아래 라이브러리를 설치합니다. ```bash $ npm install --save ethereumjs-util ``` 이더리움 지갑키와 주소 계산에 필요한 라이브러리를 import 합니다. ```jsx import bip32 from 'bip32'; import ethUtil from 'ethereumjs-util'; ``` 마지막으로 `CreateWalletScreen.js`를 수정합니다. ```jsx export default class CreateWalletScreen extends Component { // (...) _createWallet = async () => { const seed = bip39.mnemonicToSeed(this.state.mnemonic); // 마스터 키 생성 const root = bip32.fromSeed(seed); // 이더리움 차일드 개인키 생성 const xPrivKey = root.derivePath("m/44'/60'/0'/0/0"); const privKey = xPrivKey.privateKey.toString('hex'); // 이더리움 주소 생성 let address = ethUtil.pubToAddress(xPrivKey.publicKey, true).toString('hex'); // 이더리움 EIP-55 체크섬 주소로 변환 address = ethUtil.toChecksumAddress(address).toString('hex'); alert(address); } render() { return ( <Container style={styles.container}> <View style={{ flex: 1, padding: 10 }}> <View style={{ flex: 1 }}> {/* (...) */} </View> <View style={{ flex: 1 }}> <Button block primary onPress={() => this._createWallet()}> <Text>생성하기</Text> </Button> </View> </View> </Container> ); } } ``` > 1. 지갑 생성하는 `_createWallet()` 함수를 생성합니다. 그리고 생성하기 버튼의 `onPress` 속성에 `{() => this._createWallet()}`를 입력합니다. 이제 생성하기 버튼을 누르면 `_createWallet()` 함수를 호출할 것입니다. > 2. `_createWallet()` 함수는 니모닉에서 시드(*SEED*) 를 계산합니다. > 3. 그리고 [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)를 사용하여 시드에서 확장 개인키(*HDPrivateKey*)를 계산합니다. > 4. 그다음 **HDPrivateKey**에서 이더리움 **PrivateKey**를 계산합니다. 이더리움 **PrivateKey는** [BIP-44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki)에 따라 생성(derivation) 됩니다. 그리고 **derivePath**는 이와 같은 형태입니다. `m/purpose'/coin_type'/account'/change/address_index` > 우리는 HD지갑이 목적이 아니므로 단순하게 `m/44'/60'/0'/0/0`를 사용하여 지갑키를 생성합니다. > 5. 마지막으로 공개키(PublicKey)에서 주소를 계산합니다. 그리고 [EIP-55](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md) 규칙에 따라 체크섬이 포함된 주소로 변환합니다. 이제 생성 버튼을 누르면 아래와 같이 지갑 주소가 생성됩니다. 확인하기 쉽게 **Alert** 으로 출력하였습니다.  이더리움 모바일 지갑앱 개발을 하면서, 개발 과정을 정리하여 포스팅까지 하려니 시간이 2~3배 정도 걸리네요. 여기까지 읽어주셔서 감사합니다.
author | anpigon |
---|---|
permlink | react-native-ethereum-mobile-wallet-3 |
category | kr |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["kr","kr-dev","busy","jjangjjangman","ethereum"],"links":["https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki","https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki","https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md"],"image":["https://steemitimages.com/640x0/https://cdn.steemitimages.com/720x0/https://cdn.steemitimages.com/DQmTBYPHABLZoXJMWL9msssEoTsXz9LvVaK7dT49uXXGQi7/galaxy-2.png","https://cdn.steemitimages.com/300x0/https://cdn.steemitimages.com/DQmNpZzkAyNvbWbU6RtKkgEt4XwbrkvNahB4HhAXoUR8SG7/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202019-02-03%2016.11.31.png"],"users":[]} |
created | 2019-02-04 02:00:21 |
last_update | 2019-02-04 05:51:33 |
depth | 0 |
children | 7 |
last_payout | 2019-02-11 02:00:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.295 HBD |
curator_payout_value | 0.368 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,798 |
author_reputation | 17,258,940,000,931 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,364,110 |
net_rshares | 3,555,510,443,317 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
busy.pay | 0 | 472,625,053,123 | 2.27% | ||
skan | 0 | 973,617,871,095 | 16% | ||
kardus | 0 | 1,625,299,632 | 100% | ||
nhj12311 | 0 | 67,549,942,915 | 100% | ||
bree1042 | 0 | 29,880,074,517 | 25% | ||
hjk96 | 0 | 95,595,038,314 | 20% | ||
fur2002ks | 0 | 223,850,031,192 | 13% | ||
ukk | 0 | 113,279,526,069 | 30% | ||
accelerator | 0 | 16,890,899,254 | 1.11% | ||
june0620 | 0 | 58,629,321,775 | 10% | ||
pediatrics | 0 | 40,619,857,716 | 25% | ||
lostmine27 | 0 | 27,442,394,039 | 100% | ||
fun2learn | 0 | 1,161,782,052 | 1.6% | ||
codingman | 0 | 44,942,387,677 | 100% | ||
kyunga | 0 | 13,425,017,477 | 50% | ||
asinayo | 0 | 28,388,040,929 | 49% | ||
songbj | 0 | 1,301,090,695 | 100% | ||
sd974201 | 0 | 2,647,745,798 | 7% | ||
sleeprince | 0 | 29,066,656,652 | 100% | ||
kiwifi | 0 | 141,478,513,802 | 25% | ||
modolee | 0 | 580,407,137 | 100% | ||
blockchainstudio | 0 | 33,967,065,866 | 100% | ||
anpigon | 0 | 89,416,229,467 | 100% | ||
ravenkim | 0 | 53,907,469,920 | 20% | ||
newbijohn | 0 | 27,227,035,776 | 100% | ||
nailyourhome | 0 | 1,203,840,181 | 1.6% | ||
ulockblock | 0 | 289,449,004,583 | 100% | ||
bukio | 0 | 262,184,288,400 | 2.12% | ||
delegate4upvot | 0 | 1,193,434,916 | 1.6% | ||
bbooaae | 0 | 53,964,712,271 | 15% | ||
mco | 0 | 818,727,474 | 10.5% | ||
steem-ua | 0 | 281,482,918,562 | 2.61% | ||
dalkong323 | 0 | 542,115,534 | 100% | ||
gomdory | 0 | 67,522,320,503 | 100% | ||
talken | 0 | 1,375,350,245 | 100% | ||
steemory | 0 | 4,619,470,485 | 100% | ||
mbappe | 0 | 891,766,852 | 3% | ||
openmedia | 0 | 1,147,740,422 | 10% |
짱짱맨 호출에 응답하여 보팅하였습니다.
author | bukio |
---|---|
permlink | re-bukio-jjangjjangman-1549246548286 |
category | kr |
json_metadata | "{"tags":["bukio", "jjangjjangman"],"app":"steemer/1.0"}" |
created | 2019-02-04 02:15:48 |
last_update | 2019-02-04 02:15:48 |
depth | 1 |
children | 1 |
last_payout | 2019-02-11 02:15:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 22 |
author_reputation | 11,545,563,591,097 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,364,514 |
net_rshares | 0 |
감사합니다.
author | anpigon |
---|---|
permlink | re-bukio-re-bukio-jjangjjangman-1549246548286-20190204t055245048z |
category | kr |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["kr"],"users":[],"links":[],"image":[]} |
created | 2019-02-04 05:52:48 |
last_update | 2019-02-04 05:52:48 |
depth | 2 |
children | 0 |
last_payout | 2019-02-11 05:52:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 6 |
author_reputation | 17,258,940,000,931 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,370,294 |
net_rshares | 0 |
대단하네요
author | codingman |
---|---|
permlink | re-anpigon-react-native-ethereum-mobile-wallet-3-20190204t112759748z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2019-02-04 11:28:00 |
last_update | 2019-02-04 11:28:00 |
depth | 1 |
children | 0 |
last_payout | 2019-02-11 11:28:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 5 |
author_reputation | 23,188,231,710,844 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,379,905 |
net_rshares | 0 |

author | gomdory |
---|---|
permlink | re-react-native-ethereum-mobile-wallet-3-20190204t104713 |
category | kr |
json_metadata | "" |
created | 2019-02-04 10:47:15 |
last_update | 2019-02-04 10:47:15 |
depth | 1 |
children | 0 |
last_payout | 2019-02-11 10:47:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 78 |
author_reputation | 38,104,394,235,725 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,378,661 |
net_rshares | 0 |
멋지세요^^ 이더리움 지갑을 직접 만드시다니 대단하세요👍👍
author | ravenkim |
---|---|
permlink | re-anpigon-react-native-ethereum-mobile-wallet-3-20190204t022554114z |
category | kr |
json_metadata | {"tags":["kr"],"app":"steemit/0.1"} |
created | 2019-02-04 02:25:57 |
last_update | 2019-02-04 02:25:57 |
depth | 1 |
children | 1 |
last_payout | 2019-02-11 02:25:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 32 |
author_reputation | 107,302,486,367,072 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,364,805 |
net_rshares | 0 |
감사합니다. 지갑앱 만드는 개발 과정을 공개함으로써, 다양한 형태의 모바일앱이 출시되었으면 좋겠습니다.
author | anpigon |
---|---|
permlink | re-ravenkim-re-anpigon-react-native-ethereum-mobile-wallet-3-20190204t055234141z |
category | kr |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["kr"],"users":[],"links":[],"image":[]} |
created | 2019-02-04 05:52:36 |
last_update | 2019-02-04 05:52:36 |
depth | 2 |
children | 0 |
last_payout | 2019-02-11 05:52:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 58 |
author_reputation | 17,258,940,000,931 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,370,291 |
net_rshares | 0 |
#### Hi @anpigon! Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your **UA** account score is currently 2.910 which ranks you at **#11533** across all Steem accounts. Your rank has improved 6 places in the last three days (old rank 11539). In our last Algorithmic Curation Round, consisting of 196 contributions, your post is ranked at **#83**. ##### Evaluation of your UA score: * Only a few people are following you, try to convince more people with good work. * The readers like your work! * Good user engagement! **Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
author | steem-ua |
---|---|
permlink | re-react-native-ethereum-mobile-wallet-3-20190204t175227z |
category | kr |
json_metadata | "{"app": "beem/0.20.18"}" |
created | 2019-02-04 17:52:27 |
last_update | 2019-02-04 17:52:27 |
depth | 1 |
children | 0 |
last_payout | 2019-02-11 17:52:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 658 |
author_reputation | 23,214,230,978,060 |
root_title | "[React Native] 이더리움 모바일 지갑(Ethereum Mobile Wallet) 만들기 #3" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 79,394,145 |
net_rshares | 0 |