Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vanity gen for TON blockchain #1

Open
boo50 opened this issue Jul 22, 2020 · 10 comments
Open

vanity gen for TON blockchain #1

boo50 opened this issue Jul 22, 2020 · 10 comments

Comments

@boo50
Copy link

boo50 commented Jul 22, 2020

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

@10gic
Copy link
Owner

10gic commented Jul 22, 2020

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
Copy link
Author

boo50 commented Jul 22, 2020

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
Copy link
Owner

10gic commented Jul 22, 2020

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
Copy link
Author

boo50 commented Jul 23, 2020

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

@10gic
Copy link
Owner

10gic commented Jul 23, 2020

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
Copy link
Author

boo50 commented Aug 1, 2020

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
Copy link
Owner

10gic commented Aug 7, 2020

@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
Copy link
Author

boo50 commented Aug 7, 2020

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
Copy link
Owner

10gic commented Aug 7, 2020

@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
Copy link
Author

boo50 commented Aug 7, 2020

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants