Skip to content

Instantly share code, notes, and snippets.

View ilyar's full-sized avatar
🖖
this is the way

ilyar

🖖
this is the way
View GitHub Profile
@ilyar
ilyar / chksig_proposal.md
Created February 14, 2026 23:55 — forked from Rexagon/chksig_proposal.md
CHKSIG proposal

Draft

Improved signature verification for TON L2 networks

The appearance of new networks in which a user can reuse the same key for the same contracts carries new risks. The proposed solution allows using same keys and contracts across different L2 networks without worrying about new replay attacks, as the signatures themselves will be different everywhere and will depend on a unique network ID (later referred to as global_id).

Most contracts verify the signature of external message with CHKSIGNU or CHKSIGNS. Therefore, to minimize the number of any changes, we propose adding new behavior for these opcodes (enabled/disabled via capability). Fow now, this new behavior can only be implemented on the L2 side, however, it requires at least the reservation of three additional opcodes, which are needed for explicit verification of signatures with other ids.

VM state changes

Cell research

benchmark @ton/core vs @incubare/cell

> @incubare/cell@1.0.0-alpha.0 benchmark
> npx tsx benchmark.ts

=== @incubare/cell ===

Iterations: 100,000
// npx ts-node hex-to-boc.ts
import { BitReader, BitString, Builder, Slice } from "@ton/core";
async function main() {
const data = Buffer.from('000000000000000000000000000000000000000000000000000000000000002a', 'hex');
const bs = new BitString(data, 0, data.length * 8);
const r = new BitReader(bs);
const s = new Slice(r, []);
const b = new Builder();

Tutorial collect contract gas metric

PR: ton-community/ton-docs#1294

collect contract gas metric

When writing contracts for the TON blockchain, it's important to consider how efficiently gas is consumed when executing the logic you implement, in addition, unlike other blockchains, in the TON blockchain you need to pay for storing contract data and for forward messages between contracts

Therefore, when developing a contract, it's important to pay attention to how data size changes and how gas consumption changes after you modify the contract's behavior or add new functionality

@ilyar
ilyar / tonup.sh
Last active May 23, 2025 07:35
tonup - TON toolchain versions manager
#!/usr/bin/env bash
# tonup - TON toolchain versions manager
# INSTALL
# wget -O tonup.sh https://gist.githubusercontent.com/ilyar/ec7f560d4632cb09a319d60f75a518a2/raw/6ad10f2e33dad7f138cefee441c0ba2dcb83d182/tonup.sh
# cp tonup.sh ~/bin/tonup && chmod +x ~/bin/tonup
# SETUP
# export PATH="$HOME/bin-ton/current:$PATH"
set -eo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
{
"comment": "Some label",
"createdAt": "2025-05-07T19:07:22.277Z",
"items": [
{
"address": "EQBiA46W-PQaaZZNFIDglnVknV9CR6J5hs81bSv70FwfNTrD",
"codeHash": "0xd992502b94ea96e7b34e5d62ffb0c6fc73d78b3e61f11f0848fb3a1eb1afc912",
"contractName": "TreasuryContract",
"methodName": "send",
"receiver": "external-in",
@ilyar
ilyar / sample_parsing_a_payload_via_TL-B.md
Last active March 18, 2025 07:07
Sample parsing a payload via TL-B

Sample parsing a payload via TL-B

Short

Create schema.tlb

a a: int256 = A;
b b: MsgAddressInt = B;
@ilyar
ilyar / tonutils-reverse-proxy.md
Last active November 20, 2024 09:22
System V init script for tonutils-reverse-proxy

System V init script for tonutils-reverse-proxy

1. Install tonutils-reverse-proxy

If you haven’t installed tonutils-reverse-proxy, follow the instructions docs.ton.org/develop/dapps/tutorials/how-to-run-ton-site, for example:

curl -fsSL -o tonutils-reverse-proxy https://github.com/ton-utils/reverse-proxy/releases/latest/download/tonutils-reverse-proxy-linux-amd64
chmod +x tonutils-reverse-proxy
mv tonutils-reverse-proxy /usr/local/bin/
{
"p0": "5555555555555555555555555555555555555555555555555555555555555555",
"p1": "3333333333333333333333333333333333333333333333333333333333333333",
"p2": "0000000000000000000000000000000000000000000000000000000000000000",
"p7": [
{
"currency": 239,
"value": "666666666666"
},
{

mermaid

timeline
    title Roadmap 2023
    section Q3 <br> First Release
        Develop : sub-point 1a : sub-point 1b
                : sub-point 1c
        Bullet 2 : sub-point 2a : sub-point 2b