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

    public_key:(ed25519_pubkey pubkey:x7613BCA2CBB4AE0F5309D70E14900D38E60BD1207136AFFDED7BFCF683E00FD4) 

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?

Posted 3 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();

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>

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!

Posted 3 months ago
Edited 3 months ago