Closed kendol07 closed 1 month ago
@kendol07 What method did you use to generate your phrase? What client application did you use (tonkeeper, tonhub, mytonwallet, etc)?
I used a 24-word phrase for testing, which I obtained from the Bip39 tool by Ian Coleman (https://iancoleman.io/bip39/). This was for testing purposes only, but I encountered an error. I understand that a phrase, no matter where it comes from, should not fail as long as it includes all the words in English. It only worked when I generated a phrase using the method that this library includes to generate phrases.
I would appreciate any help you can provide.
Mnemonic phrases in TON is not BIP39-compliant (except for word list). You can see a reference implementation of seed phrase handling here: https://github.com/ton-blockchain/ton/blob/master/tonlib/tonlib/keys/Mnemonic.cpp
You can invent your own algorithm for obtaining secret key from any phrases. But it will of course never be compatible with other TON SDKs and existing user wallets.
The custom mnemonic phrase you provided is invalid. It only works with a generated mnemonic phrase. Please verify and try again with a valid generated phrase
PHP Fatal error: Uncaught Olifanton\Mnemonic\Exceptions\TonMnemonicException: Invalid mnemonic phrase in /home/yqxb16bsjvdm/vendor/olifanton/mnemonic/src/Olifanton/Mnemonic/TonMnemonic.php:89 Stack trace:
0 /home/yqxb16bsjvdm/vendor/olifanton/mnemonic/src/Olifanton/Mnemonic/TonMnemonic.php(105): Olifanton\Mnemonic\TonMnemonic::mnemonicToSeed()
1 /home/yqxb16bsjvdm/public_html/TON/Wallet.php(42): Olifanton\Mnemonic\TonMnemonic::mnemonicToKeyPair()
2 {main}
thrown in /home/yqxb16bsjvdm/vendor/olifanton/mnemonic/src/Olifanton/Mnemonic/TonMnemonic.php on line 89