๐งฉ 1. HD ์ง๊ฐ ์์ฑ ๋ฐ ๋ณต๊ตฌ
src/HDWallet.cpp
/include/TrustWalletCore/TWHDWallet.h
- BIP39 ์๋ ์์ฑ, ๋ณต๊ตฌ ๋ฐ BIP44/BIP84 ๋ฑ ํ์ค์ ๋ฐ๋ฅธ ํค/์ฃผ์ ์ ๋ ๋ด๋น (github.com, trustwallet.github.io).
๐ง 2. ์ฃผ์ ์ ๋
src/Derivation.cpp
/include/TrustWalletCore/TWDerivationPath.h
- ์ปค์คํ
๊ฒฝ๋ก(
m/44'/60'/โฆ
) ์ฒ๋ฆฌํ ์ ์์ผ๋ฉฐ,HDWallet.getKey(...)
,CoinType.deriveAddress(...)
๋ฉ์๋ ๊ตฌํ (trustwallet.github.io, developer.trustwallet.com).
- ์ปค์คํ
๊ฒฝ๋ก(
โ๏ธ 3. ํธ๋์ญ์ ์๋ช
โข UTXO ๊ธฐ๋ฐ (๋นํธ์ฝ์ธ ๋ฑ)
src/Bitcoin/Signer.cpp
/include/TrustWalletCore/TWBitcoinSigningInput.h
BitcoinSigningInput
๊ฐ์ฒด๋ฅผ ๊ธฐ๋ฐ์ผ๋ก TX ์์ฑ ๋ฐ ์๋ช ์ฒ๋ฆฌ (developer.trustwallet.com).
โข ๊ณ์ ๊ธฐ๋ฐ (์ด๋๋ฆฌ์ ๋ฑ)
src/Ethereum/Signer.cpp
/include/TrustWalletCore/TWEthereumSigningInput.h
Transaction.Transfer
,chainID
,gasPrice
,gasLimit
๋ฑ ํฌํจํ์ฌ Ethereum ํธ๋์ญ์ ์ ์ ๋ ฅ๋ฐ์ RLP ์ธ์ฝ๋ฉ ์๋ช ์ฒ๋ฆฌ (developer.trustwallet.com).
๐ 4. AnySigner (๋ฒ์ฉ ์๋ช API)
src/AnySigner.cpp
- ๋ค์ํ ์ฝ์ธ ํ์ ์ ๋ํด ๊ณตํต ์ธํฐํ์ด์ค๋ก ์๋ช ๊ฐ๋ฅ. ์ฃผ๋ก ๋ธ๋ผ์ฐ์ ๋ WASM ํ๊ฒฝ์์ ์ฌ์ฉ (developer.trustwallet.com).
๐งฉ 5. Protobuf & C ์ธํฐํ์ด์ค
src/proto/*.proto
&include/TrustWalletCore
ํด๋- ํธ๋์ญ์
๊ด๋ จ ๋ชจ๋ธ์ Protobuf๋ก ์ ์๋๋ฉฐ,
TW_*
์ ๋์ฌ์ C ํค๋๋ก ๋ ธ์ถ๋์ด ์ธ์ด๊ฐ ๋ฐ์ธ๋ฉ์ ์ ๊ณต (developer.trustwallet.com).
- ํธ๋์ญ์
๊ด๋ จ ๋ชจ๋ธ์ Protobuf๋ก ์ ์๋๋ฉฐ,
๐ 6. ์ํธํ/ํค ๊ด๋ฆฌ ์ ํธ๋ฆฌํฐ
src/Crypto.cpp
,Trezor-crypto
์๋ธํด๋,include/PublicKey.h
/PrivateKey.h
- ํค ์์ฑ, ์๋ช ์ฒ๋ฆฌ, AES/PBKDF2 ๋ฑ ์ ์์ค ์ํธ ๊ธฐ๋ฅ์ ์ ๊ณต .
๐งช 7. ํ ์คํธ & ์ํ
tests/
,swift/Tests/
,samples/android/โฆTestBitcoinSigning.kt
- ๊ฐ ๊ธฐ๋ฅ์ ์ค์ ์๋์ ๊ฒ์ฆํ๊ธฐ ์ํ ํ ์คํธ ์ผ์ด์ค ์์ ์ ๊ณต (developer.trustwallet.com).
๐งญ ์์ฝ: ํต์ฌ ํ์ผ ์ ๋ฆฌ
๊ธฐ๋ฅ ์์ญ | ์ฃผ์ ํ์ผ ์์น |
---|---|
HDWallet (seed/key) | src/HDWallet.cpp , include/TWHDWallet.h |
Derivation | src/Derivation.cpp , include/TWDerivationPath.h |
Bitcoin Signer | src/Bitcoin/Signer.cpp , TWBitcoinSigningInput.h |
Ethereum Signer | src/Ethereum/Signer.cpp , TWEthereumSigningInput.h |
AnySigner | src/AnySigner.cpp |
Protobuf & C API | src/proto/*.proto , include/TW*.h |
Crypto utils | src/Crypto.cpp , trezor-crypto/**/* |
Tests & ์ํ | tests/ , swift/Tests/ , samples/ |
๋ต๊ธ ๋จ๊ธฐ๊ธฐ