vanitygen-plusplus icon indicating copy to clipboard operation
vanitygen-plusplus copied to clipboard

vanity gen for TON blockchain

Open boo50 opened this issue 5 years ago • 10 comments
trafficstars

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

boo50 avatar Jul 22 '20 05:07 boo50

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.

10gic avatar Jul 22 '20 14:07 10gic

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.

boo50 avatar Jul 22 '20 14:07 boo50

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

10gic avatar Jul 22 '20 16:07 10gic

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

boo50 avatar Jul 23 '20 02:07 boo50

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).

10gic avatar Jul 23 '20 03:07 10gic

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

boo50 avatar Aug 01 '20 07:08 boo50

@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?

10gic avatar Aug 07 '20 15:08 10gic

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

boo50 avatar Aug 07 '20 15:08 boo50

@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?

10gic avatar Aug 07 '20 15:08 10gic

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"

boo50 avatar Aug 07 '20 16:08 boo50