What is the exact process to generate a wallet address based on an private key?
I know I can get wallet V4 address through SDK.
Aug 3, 2023, 9:23 AM
But i want to generate and using the Wallet contract I wrote by myself.
Aug 3, 2023, 9:23 AM
https://github.com/ProgramCrafter/wallet-contract/blob/main/wallet-v5.ts
Aug 3, 2023, 9:24 AM
I see. Very happy to implement this in my project
Aug 3, 2023, 9:26 AM
hey man! This is so powerful! I have the idea for this after checking the Account Abstraction content on ETHcc.
We can build something huge based on this feature in TON. Customized Wallet logic with External message is the briliant idea.
Aug 3, 2023, 9:38 AM
Look how it is implemented in @ton/ton library and do the same for your custom contract:
https://github.com/ton-org/ton/blob/master/src/wallets/WalletContractV4.ts
https://github.com/ton-org/ton/blob/master/src/wallets/WalletContractV4.ts
Actually, the address of ANY smart contract on TON is calculated deterministically from its code and data (StateInit object).
You can use contractAddress() function in JS from @ton/core library.
You can use contractAddress() function in JS from @ton/core library.
In terms of wallet contracts, the data usually consists of some service values like seqno, and also the Public key of the owner to validate their signatures.
From private key you can calculate the public key (it usually happens automatically when you create Keypair object), so you just need to build a Cell that contains all that data. If you wrote the smart contract, you should know how the data is stored in it.
From private key you can calculate the public key (it usually happens automatically when you create Keypair object), so you just need to build a Cell that contains all that data. If you wrote the smart contract, you should know how the data is stored in it.
Aug 3, 2023, 9:44 AM