tonkeeper / tongo

Go primitives to work with TON
MIT License
214 stars 45 forks source link

can not use seeds to get correct wallet address #186

Closed yangyile1990 closed 1 year ago

yangyile1990 commented 1 year ago

this is my wallet: https://testnet.tonviewer.com/EQD1MmyldfAm3D5tz5lz5BmkqpLZtSmIi2cLM1Mq_HLQfGDd

the testnet address.

const SEED = "medal abstract denial cheese horn skin pond feed decade grace zebra village hip clump actor trim slight interest bleak slush share boss agent orphan"

w, err := wallet.DefaultWalletFromSeed(SEED, clientTon)
    require.NoError(t, err)

t.Log(w.GetAddress())

return this:

0:8b522eed900eef4376a953d86c7f1a8b0f2c069befba5076fac0464e4307ae76

while the real address is:

EQD1MmyldfAm3D5tz5lz5BmkqpLZtSmIi2cLM1Mq_HLQfGDd
0:f5326ca575f026dc3e6dcf9973e419a4aa92d9b529888b670b33532afc72d07c
截屏2023-09-28 09 56 32

I don't know what is wrong.

change another seed got the same misstake.

yangyile1990 commented 1 year ago

the example code is also wrong: https://github.com/tonkeeper/tongo/blob/master/examples/wallet/simple_send/main.go it return the wallet address is: 0:23b39a83ee928968b95b40e1642f6619305dcb5a8fd3a91bdfbc1443c1642967 while https://testnet.tonviewer.com/EQAjs5qD7pKJaLlbQOFkL2YZMF3LWo_TqRvfvBRDwWQpZya4 the result is not exist.

mr-tron commented 1 year ago

why do you think some address is "real" and over are invalid? in TON you can use one public key with different code and get different addresse. there are few "standard" wallets in TON. for your pubkey:


v1R1 0:dc55d57576fbd6bc715765d9df050077012c7934833dfb553186c4584bcd963e
v1R2 0:27b8e91b5a8db365b1346d1f10aada153497595716916ed152c1e47554e87b45
v1R3 0:23dbcfb4b1bf8086e5c928d07173ea2e88db61136c11b1afa1eacf80adee22a2
v2R1 0:087bf28a90e0a339733540f7f578f5bf34f85c6c60a5b1f5c5b366e1f723c8ad
v2R2 0:66214e54284799b60d3a878d005239566c304cbee9033b2ccea1f7ba44db81bc
v3R1 0:8826a54a0696b9dfa6f34508896e19febf3321de71e57b849abfd84f306ab6b3
v3R2 0:f5326ca575f026dc3e6dcf9973e419a4aa92d9b529888b670b33532afc72d07c
v4R1 0:3d292a6e6c88fa5ba67e51fb7ebafc9e3ee4fc2316d7b3e7b87e3669de083a76
v4R2 0:8b522eed900eef4376a953d86c7f1a8b0f2c069befba5076fac0464e4307ae76