Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Convert public key of validator to correct format

I managed to get a list of the validators from the lite-client.

The response has a list of validators that look like this

value:(
    validator_addr
    public_key:(ed25519_pubkey pubkey:x7613BCA2CBB4AE0F5309D70E14900D38E60BD1207136AFFDED7BFCF683E00FD4) 
    weight:5240089054832364 
    adnl_addr:x6DF20651F61604A8763882856EDC3484DF6B6513E992CDE84A71BC1D1C75A72B
)

From my understanding, I should be able to convert the public_key into such format, so that I can look it up on one of the explorer sites like tonscan.org etc.

This does not seem to work. Can someone please point me to the solution?

2
2
Posted 11 months ago
Votes Newest

Answers 2


Validators create a new keypair for each round of validation, and use that to participate in elections and create blocks. They may also change their ADNL address on each round, but that's not what they usually do.

If you want to look at their wallets on TON blockchain explorers, you have to first find the controlling wallet, that is the wallet that sends TON to participate in elections.

This information can be looked up by running the get method participant_list_extended and it only returns useful data before election is finished.

For example, if I start lite-client on testnet and run this command:

runmethod kf8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM_BP participant_list_extended

The result will be something like:

result:  [ 1692631422 1692631242 10000000000000 14019250477034344 ([1785726394745260293869629821187026920743160317479397166793665319642004602034 [1000001000000000 1966080 101184175721668699951755525112601793644527200681998252172335557711320252984635 87647878168491834245916094424296400596840187149190938906730361646994336065092]] [...

Here, the first 4 fields are related to election (elect_at, elect_close, min_stake, total_stake), then there is a list of validators, first field being the validator id, and then 4 related fields, the third one being the address of controlling wallet.

For example, here, 1785726394745260293869629821187026920743160317479397166793665319642004602034 is the validator id or validator_pubkey, and 101184175721668699951755525112601793644527200681998252172335557711320252984635 is the decimal number which can identify the wallet. If you convert it to a hex value, and then convert it to a TON address (ton.org/address and prepending with '-1:') then you'll arrive at address: kf_ftDbFY_gRWt2FkqVk68scKhuoniW6Po7GndTGdkCtO_2Z.


I don't have any experience dealing with Validator configuration, but I can share with you the idea for the Public Key we use in TON and how it interacts with smart contracts.

import { randomBytes } from "crypto";
import { keyPairFromSeed } from "ton-crypto";

    let keypair = keyPairFromSeed(randomBytes(32));
    let public_key_hex = keypair.publicKey.toString("hex");
    let public_key_int = BigInt("0x" + public_key_hex);
    let public_key_cell = beginCell().storeUint(public_key_int, 256).endCell();
		console.log(keypair.publicKey);
    console.log(public_key_hex);
    console.log(public_key_int);
    console.log(public_key_cell);

You will get:

<Buffer 3b 19 27 24 86 4a 6a 7b fa 02 5f 4e b6 20 c9 fb 51 1e 31 b6 5f 9f 4f 72 8f cc d8 ac dd ea 12 c1>
3b192724864a6a7bfa025f4eb620c9fb511e31b65f9f4f728fccd8acddea12c1
26730899395840241403219970071225489010060933487521107827084323612022786364097n
x{3B192724864A6A7BFA025F4EB620C9FB511E31B65F9F4F728FCCD8ACDDEA12C1}

As you can see, these four lines of results are all the Public Keys I generated, but they look different. This is why you got the error that the format was incorrect. I think you need to pass the Public Key as an Unsigned Integer with 256 bits to try out.

In TON, or TVM, we only pass the Cell datatype to the smart contract. That is why I need to convert my uint Public Key to the Cell data type there!

1
1
Posted 11 months ago
Edited 11 months ago