10gic / vanitygen-plusplus

A vanity address generator for BTC, ETH, LTC, TRX and 100+ more crypto currencies.
GNU Affero General Public License v3.0
254 stars 90 forks source link

vanity gen for TON blockchain #1

Open boo50 opened 4 years ago

boo50 commented 4 years ago

this is not an issue actually, but inquiry to add TON blockchain to vanity gen https://github.com/ton-blockchain/ton

10gic commented 4 years ago

Telegram has shut down its TON cryptocurrency project. 😭

Currently, vanitygen plusplus can support a new blockchain very easily, if the chain:

  1. use elliptic curve secp256k1, and
  2. its address encoded with Base58Check.

It seems that TON does not meet the conditions, https://ton.live/accounts?section=all To support it, may be there is extra work to be done.

boo50 commented 4 years ago

Yes, but there are Free TON project which is maintained by https://github.com/tonlabs/ and it's live, even mainnet already active. And ton.live is actually their website.

10gic commented 4 years ago

Is there technical article about how to generating TON address? Just like https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses

boo50 commented 4 years ago

Yes sure on the top of howto https://ton.org/HOWTO.txt

10gic commented 4 years ago

Yes sure on the top of howto https://ton.org/HOWTO.txt

It just talks about how to convert address from raw form (eg. -1:fcb91a3a3816d0f7b8c2c76108b8a9bc5a6b7a55bd79f8ab101c52db29232260) to user-friendly forms. There is no guide about how to generate an address inside masterchain (workchain_id=-1).

boo50 commented 3 years ago

Yes you right. Maybe this pdf starting from page 53 have necessary information? https://test.ton.org/tblkch.pdf

Or maybe source code for tonos-cli can help ? https://github.com/tonlabs/tonos-cli/blob/master/src/genaddr.rs

10gic commented 3 years ago

@boo50 I'm not familiar with TON.

In source code of tonos-cli https://github.com/tonlabs/tonos-cli/blob/master/src/genaddr.rs, the key part of generating address is:

    let addr = ton.contracts.get_deploy_address(
        abi.clone().into(),
        &contract,
        initial_data.clone().map(|d| d.into()),
        &keys.public,
        wc,
    ).map_err(|e| format!("failed to generate address: {}", e.to_string()))?;

Is the address always related with contract?

boo50 commented 3 years ago

Yes, every address in ton is actually a smart-contract. This one for example https://github.com/tonlabs/ton-labs-contracts/tree/master/solidity/safemultisig

10gic commented 3 years ago

@boo50 Does it mean that user must provide a concrete contract before generating address? Given a private/public key-pair and a contract, is the address determined?

boo50 commented 3 years ago

yes, generate address example you can see in this script https://github.com/tonlabs/net.ton.dev/blob/master/scripts/msig_genaddr.sh in this example address is generating for contract provided before - safemultisig and keys to access this address(contract) are generated like this ./tonos-cli genphrase ./tonos-cli getkeypair msig.keys.json "phrase from prev step"