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
What is seqno?

In the world of TON development, when it comes to messages, I often see references to seqno but I haven't yet understood, what exactly that is? What do we need it for?


This question was imported from Telegram Chat: https://t.me/tondev/86427

2
2
Posted one year ago
Votes Newest

Answers 2


Great question, seqno is an interesting concept on TVM that will be highlight

Which is more like the the transaction number of the wallet sending the Tx. Like the nonce on EVM world.

For more example, if you want to send the Txs through SDK to the blockchain, will use the code like this:

		// (=== more codes === ) //
    console.log("Interacting with Collection Contract: \n" + contract_address);
    let seqno: number = await wallet_address.getSeqno();
    let transfer = await wallet_address.sendTransfer({
        seqno: seqno,
        secretKey: keyPair.secretKey,
        messages: [
            internal({
                value: toNano("0.5"),
                to: contract_address,
                init: {
                    code: init.code,
                    data: init.data,
                },
                bounce: true,
                body: packed, 
            }),
        ],
    });

You will need to get the seqno first to send with the parameters in a Transaction.

1
1
wiki
Posted one year ago

Seqno is one way to prevent Replay Attacks. When a transaction is sent to a wallet smart contract, it compares the seqno field of the transaction with the one inside its storage. If they match, it's accepted and the stored seqno is incremented by one. If they don't match, the transaction is discarded.

Without seqno (or another mechanism to prevent Replay Attacks), anyone (usually the receiver of funds) can read the transaction data (for example from blockchain explorers) and create another fake transaction and resend it to the original wallet smart contract and force it to resend TON once more, ultimately draining all of its funds.

3
3
Posted one year ago
21K Views
2 Answers
one year ago
one year ago
Tags