diff --git a/docs/develop/blockchain/sharding-lifecycle.mdx b/docs/develop/blockchain/sharding-lifecycle.mdx new file mode 100644 index 0000000000..f1b98bb179 --- /dev/null +++ b/docs/develop/blockchain/sharding-lifecycle.mdx @@ -0,0 +1,74 @@ +# Infinity Sharding Paradigm + +:::danger +Page is under development. +::: + +## Understanding Split Merge in TON Blockchain + +The TON (Telegram Open Network) Blockchain introduces innovative concepts for blockchain scalability and efficiency. One such concept is the Split Merge functionality, integral to its blockchain architecture. This short article explores the key aspects of Split Merge in the TON Blockchain, focusing on its role within the Infinite Sharding Paradigm (ISP). + +#### Infinite Sharding Paradigm (ISP) and its Application + +ISP underpins the TON Blockchain's design, treating each account as part of its separate "accountchain." These accountchains are then aggregated into shardchain blocks for efficiency. The state of a shardchain comprises the states of all its accountchains. Thus, a shardchain block essentially is a collection of virtual blocks of accounts assigned to it. + +- **ShardState**: Approximated as Hashmap(n, AccountState), where n is the bit length of the account_id. +- **ShardBlock**: Approximated as Hashmap(n, AccountBlock). + +Each shardchain, or more precisely, each shardchain block, is identified by a combination of `workchain_id` and a binary prefix `s` of the account_id. + +## Sharding Example + +![](/img/docs/blockchain-fundamentals/split-merge.svg) + +In the provided graphic scheme: + +- The black line represents the masterchain. +- Shards of a workchain are divided by time and denoted in black dashed line. +- Blocks 101, 102, 103, and 80 relate to the masterchain block with seqno=29. Here, 101, 102, and 103 are in one shard, while 80 is in another. +- If a split or merge event happens, the affected shards pause until the next masterchain block. + +In summary, Split Merge in TON Blockchain is a complex yet efficient mechanism that enhances scalability and interaction within the blockchain network. It exemplifies TON's approach to resolving common blockchain challenges, emphasizing efficiency and global consistency. + + +## Sharding Details + +#### Split and Non-Split Parts of Shardchain + +A shardchain block and state are divided into two parts: + +1. **Split Part**: Complies with the ISP form, containing account-specific data. +2. **Non-Split Part**: Involves data pertaining to the block's interaction with other blocks and the outside world. + +#### Interaction with Other Blocks + +The non-split parts are crucial for ensuring global consistency, reduced to internal and external local consistency conditions. They are significant for: + +- Message forwarding between shardchains. +- Transactions involving multiple shardchains. +- Delivery guarantees and validation of a block's initial state against its predecessor. + +#### Inbound and Outbound Messages + +Key components of the non-split part of a shardchain block include: + +- **InMsgDescr**: Descriptions of all messages imported into the block. +- **OutMsgDescr**: Descriptions of all messages exported or generated by the block. + +#### Block Header and Validator Signatures + +The block header, another non-split component, contains essential information like workchain_id, binary prefix of account_ids, and various hashes (e.g., of the immediate predecessor). Validator signatures are appended to the unsigned block, forming the signed block. + +#### Outbound Message Queue + +OutMsgQueue in the shardchain state is a critical non-split part. It holds undelivered messages from OutMsgDescr until they are processed or delivered to their destination. + +#### Shard Split and Merge Mechanics + +In the context of dynamic sharding, shard configurations may change due to split and merge events. These events are synchronized with the masterchain block. For instance, if a split or merge occurs, the affected shards wait for the next masterchain block before proceeding. + + +## See Also + +* [Block Layout](/develop/data-formats/block-layout) +* [Whitepapers](/learn/docs) \ No newline at end of file diff --git a/docs/develop/dapps/apis/sdk.mdx b/docs/develop/dapps/apis/sdk.mdx index c7a596d429..9545264aff 100644 --- a/docs/develop/dapps/apis/sdk.mdx +++ b/docs/develop/dapps/apis/sdk.mdx @@ -20,7 +20,7 @@ The data provider is a [Liteserver](/participate/run-nodes/liteserver), which ca | Library | Language | ADNL connector type | Description | |---------|----------|-------|--------------| -|[ton-kotlin](https://github.com/andreypfau/ton-kotlin)|Kotlin|Native ADNL |Kotlin/Multiplatform SDK for The Open Network| +|[ton-kotlin](https://github.com/ton-community/ton-kotlin)|Kotlin|Native ADNL |Kotlin/Multiplatform SDK for The Open Network| |[tonutils-go](https://github.com/xssnick/tonutils-go)|GO|Native ADNL |Golang library for interacting with TON blockchain| |[tongo](https://github.com/tonkeeper/tongo)|GO|Native ADNL |Go implementation of libraries for TON blockchain| |[tonutils](https://github.com/thekiba/tonutils) | TypeScript | Native ADNL | TypeScript-based interface for building and interacting with applications in TON Ecosystem. | diff --git a/docs/develop/dapps/asset-processing/jettons.md b/docs/develop/dapps/asset-processing/jettons.md index bdb62d0fce..73af5815d4 100644 --- a/docs/develop/dapps/asset-processing/jettons.md +++ b/docs/develop/dapps/asset-processing/jettons.md @@ -271,10 +271,10 @@ in the wallet to pay the required gas fees. Communication between Jetton wallets and TON wallets occurs through the following communication sequence: -![](message_layouts.png) +![](/img/docs/asset-processing/jetton_transfer.svg) -`Sender -> sender' jetton wallet` means the transfer message body contains the following data: +`Sender -> sender' jetton wallet` means the _transfer_ message body contains the following data: | Name | Type | diff --git a/docs/develop/smart-contracts/testing/overview.mdx b/docs/develop/smart-contracts/testing/overview.mdx index 64c82c948d..bbd391e0eb 100644 --- a/docs/develop/smart-contracts/testing/overview.mdx +++ b/docs/develop/smart-contracts/testing/overview.mdx @@ -96,7 +96,7 @@ Check test suites used for TON Ecosystem contracts and learn by examples. * [governance_tests](https://github.com/Trinketer22/governance_tests/blob/master/elector_tests/tests/complaint-test.fc) * [MassSender.spec.ts](https://github.com/Gusarich/ton-mass-sender/blob/main/tests/MassSender.spec.ts) * [TonForwarder.spec.ts](https://github.com/TrueCarry/ton-contract-forwarder/blob/main/src/contracts/ton-forwarder/TonForwarder.spec.ts) - +* [Assurer.spec.ts](https://github.com/aSpite/dominant-assurance-contract/blob/main/tests/Assurer.spec.ts) ## See Also * [Blueprint](/develop/smart-contracts/sdk/javascript) diff --git a/docs/participate/explorers.mdx b/docs/participate/explorers.mdx index 07d2b57bf7..16aa137b18 100644 --- a/docs/participate/explorers.mdx +++ b/docs/participate/explorers.mdx @@ -28,7 +28,7 @@ Almost all explorers have the ability to find out information about balances, tr Next, we will consider several explorers that can be attributed to each of these categories. -## TON Scan +## TON Scan.org Good explorer for everyday use. It provides a comprehensive view of the TON Blockchain, allowing users to search for transactions, addresses, blocks, and more. Any search is performed against the public [address book](https://github.com/catchain/tonscan/blob/master/src/addrbook.json) (TON Foundation, OKX and etc.) @@ -45,6 +45,17 @@ Good explorer for everyday use. It provides a comprehensive view of the TON Bloc - URL: https://tonscan.org/ - Testnet URL: https://testnet.tonscan.org/ +## TON Scan.com + +### Features + +- Transaction aggregation analytics +- Transaction Traces + +### Links + +- URL: https://tonscan.com/ + ## Ton Whales Explorer This explorer is more oriented towards developers than ordinary users. diff --git a/sidebars.js b/sidebars.js index 9baf21bbe4..b47360a996 100644 --- a/sidebars.js +++ b/sidebars.js @@ -549,6 +549,14 @@ const sidebars = { } ], }, + { + type: 'category', + label: 'Blockchain Fundamentals', + items: [ + + 'develop/blockchain/sharding-lifecycle', + ], + }, { type: 'category', label: 'Data Formats', diff --git a/static/img/docs/asset-processing/jetton_transfer.svg b/static/img/docs/asset-processing/jetton_transfer.svg new file mode 100644 index 0000000000..250cf94753 --- /dev/null +++ b/static/img/docs/asset-processing/jetton_transfer.svg @@ -0,0 +1,520 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Jetton Transfer + + + + + On-page reference.132 + Wallet v3 + + + + + + + Walletv3 + + Dynamic connector.135 + 0 + + + + + 0 + + Round Corner Rectangle.141 + transfer + + + + + + + + + + + + + + + + + + + + + + + + + transfer + + On-page reference.116 + + + + + + + Sheet.24 + Smart Contract + + + + Smart Contract + + Sheet.26 + Message + + + + Message + + Dynamic connector.130 + N + + + + + N + + Sheet.28 + Transaction + + + + Transaction + + Round Corner Rectangle.224 + + + + + + + + + + + + + + + + + + + + + + + + + On-page reference.30 + + + + + + + Sheet.31 + Jetton Wallet + + + + Jetton Wallet + + Actor + + + + + + + On-page reference.40 + BOB + + + + BOB + + Round Corner Rectangle.41 + internal transfer + + + + + + + + + + + + + + + + + + + + + + + + + internal transfer + + Dynamic connector.42 + + + + Dynamic connector.43 + 1 + + + + + 1 + + Actor.44 + + + + + + + On-page reference.45 + ALICE + + + + ALICE + + On-page reference.46 + Wallet v4 + + + + + + + Walletv4 + + On-page reference.47 + + + + + + + Dynamic connector.48 + 2 + + + + + 2 + + Dynamic connector.49 + + + + Sheet.50 + Jetton Wallet + + + + Jetton Wallet + + Round Corner Rectangle.51 + transfer notification + + + + + + + + + + + + + + + + + + + + + + + + + transfer notification + + Round Corner Rectangle.52 + excesses + + + + + + + + + + + + + + + + + + + + + + + + + excesses + + Actor.53 + + + + + + + On-page reference.54 + Response Destination + + + + + + + Response Destination + + Dynamic connector.55 + + + + Dynamic connector.56 + 2' + + + + + 2' + + Dynamic connector.57 + 2'' + + + + + 2'' + + On-page reference.61 + JOE + + + + JOE + + Square + Jetton Balance Update + + + + + + + Jetton Balance Update + + Dynamic connector + + + + Round Corner Rectangle.67 + + + + + + + + + + + + + + + + + + + + + + + + + Sheet.68 + Optional Message + + + + Optional Message + + diff --git a/static/img/docs/blockchain-fundamentals/split-merge.svg b/static/img/docs/blockchain-fundamentals/split-merge.svg new file mode 100644 index 0000000000..a664bf9f55 --- /dev/null +++ b/static/img/docs/blockchain-fundamentals/split-merge.svg @@ -0,0 +1,441 @@ + + + + + + + + + + + + + + + + + + + + + + split-merge-scheme + + + + Circle.37 + + + + + + + Sheet.2 + seqno = 28 + + + + seqno = 28 + + Dynamic connector.44 + + + + Dynamic connector.4 + + + + Sheet.5 + Masterchain (workchain = -1) + + + + Masterchain (workchain = -1) + + Circle.7 + + + + + + + Dynamic connector.8 + + + + Circle.9 + + + + + + + Sheet.12 + seqno = 29 + + + + seqno = 29 + + Sheet.13 + seqno = 30 + + + + seqno = 30 + + Circle.14 + + + + + + + Dynamic connector.15 + + + + Sheet.16 + Basechain (workchain = 0) + + + + Basechain (workchain = 0) + + Sheet.17 + 100 + + + + 100 + + Circle.18 + + + + + + + Dynamic connector.19 + + + + Sheet.20 + 101 + + + + 101 + + Circle.22 + + + + + + + Dynamic connector.23 + + + + Sheet.24 + 102 + + + + 102 + + Circle.25 + + + + + + + Dynamic connector.26 + + + + Sheet.27 + 103 + + + + 103 + + Dynamic connector.28 + + + + Circle.29 + + + + + + + Dynamic connector.30 + + + + Sheet.31 + 104 + + + + 104 + + Dynamic connector.32 + + + + Circle.33 + + + + + + + Dynamic connector.34 + + + + Sheet.35 + 105 + + + + 105 + + Circle.36 + + + + + + + Dynamic connector.37 + + + + Sheet.38 + 106 + + + + 106 + + Dynamic connector.39 + + + + Dynamic connector.40 + + + + Circle.41 + + + + + + + Sheet.42 + 60 + + + + 60 + + Circle.43 + + + + + + + Dynamic connector.44 + + + + Sheet.45 + 61 + + + + 61 + + Circle.46 + + + + + + + Dynamic connector.47 + + + + Sheet.48 + 62 + + + + 62 + + Circle.50 + + + + + + + Dynamic connector.51 + + + + Sheet.52 + 63 + + + + 63 + + Dynamic connector.53 + + + + Dynamic connector + + + + Dynamic connector.55 + + + + Dynamic connector.59 + + + + Dynamic connector.60 + + + + Circle.67 + + + + + + + Sheet.68 + 80 + + + + 80 + + Circle.69 + + + + + + + Dynamic connector.70 + + + + Sheet.71 + 81 + + + + 81 + + Circle.72 + + + + + + + Dynamic connector.73 + + + + Sheet.74 + 82 + + + + 82 + + Dynamic connector.76 + + + + Dynamic connector.77 + + + + Dynamic connector.79 + + + + Dynamic connector.80 + t + + + + + t + + Circle.81 + + + + + + + Dynamic connector.82 + + + + Sheet.83 + seqno = 31 + + + + seqno = 31 + + Dynamic connector.84 + + + + diff --git a/static/schemes-visio/message_processing.vsdx b/static/schemes-visio/message_processing.vsdx index 205d6a7e2d..c2ddb07620 100644 Binary files a/static/schemes-visio/message_processing.vsdx and b/static/schemes-visio/message_processing.vsdx differ