﻿{"id":375,"date":"2021-06-11T07:07:55","date_gmt":"2021-06-11T07:07:55","guid":{"rendered":"https:\/\/gridnet.org\/wpp\/?p=375"},"modified":"2021-06-11T13:15:14","modified_gmt":"2021-06-11T13:15:14","slug":"gridscript-basics-and-micropayments-from-the-users-perspective","status":"publish","type":"post","link":"https:\/\/mag.gridnet.org\/index.php\/2021\/06\/11\/gridscript-basics-and-micropayments-from-the-users-perspective\/","title":{"rendered":"GridScript Basics and Micropayments &#8211; From the User&#8217;s Perspective"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-71 alignleft\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/05\/gridUser1.gif\" alt=\"\" width=\"114\" height=\"161\" \/><\/p>\n<p data-pm-slice=\"0 0 []\"><span style=\"letter-spacing: -.6em; padding-right: 0.3em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>\u00a0Today we will be looking at Stateless-Channels, as described within some of our research papers and Multi-Dimensional Token Pools in particular &#8211; from the user\u2019s perspective. This is the first article in the series of articles related to the subject. In a way material described here gets ahead of what had been documented in our official research publications. Nevertheless, it has been implemented, found its way into <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong> already and does more than great! Some may compare Stateless-Channels to Lightning Network found within the Bitcoin\u2019s realm. Indeed, the comparison would be valid. Under the hood, implementation of State Less Blockchain channels is more \u2018streamlined\u2019 than what can be seen within the Lightning Protocol.<\/p>\n<p>We believe this leads to fewer constraints and more use-case flexibility. Not only do we allow for anonymized network, where data is onion routed, we also allow the network to span across web-browsers, giving users and developers access to an extremely convenient JavaScript API.<\/p>\n<p>This could be\u00a0seen with the crypto-snake game where parties\u00a0are rewarded without being previously known to any smart-contract and no a priori preparation needs to be take place before an unknown party begins receiving micro-payments.<\/p>\n<p>That\u2019s a thing which is simply not possible within the Lightning Protocol.<\/p>\n<p>The topics\u00a0described in here have been covered partially already within the\u00a0<a href=\"https:\/\/gridnet.org\/whitepaper\/\" target=\"_blank\" rel=\"noopener noreferrer\">Whitepaper<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-413 aligncenter\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/tokenpools-1.jpg\" alt=\"\" width=\"1500\" height=\"1039\" \/><\/p>\n<p>&nbsp;<\/p>\n<p data-pm-slice=\"0 0 []\">In this article we\u00a0will approach things from a practical point of view while\u00a0having\u00a0access to the\u00a0<span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS <\/strong>Decentralized Terminal Interface (DTI)\u00a0and handle\u00a0<strong><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>Token mobile <\/strong> app. What a joy! ~The two seem to go along quite well,\u00a0don\u2019t they? \ud83d\ude01<\/p>\n<h4>By reading on you will:<\/h4>\n<ul>\n<li>get some hands-on experience with #GridScript basics<\/li>\n<li>you will get to know how to time-travel<\/li>\n<li>learn why on-the-chain transactions are not always good and the <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong> solution<\/li>\n<li>get to know how the Snake\ud83d\udc0d game issues rewards<\/li>\n<li>how to cash-out rewards received within the game<\/li>\n<li>check for yourself if double-spends are possible \ud83d\ude04<\/li>\n<li>learn how to create and register Token Pools of your own<\/li>\n<\/ul>\n<p><strong>#GridScript<\/strong>\u00a0definitely needs a documentation on its own. You will be glad to know that it is backwards compatible with Forth and there are a lot of places on the Internet to start from!\u00a0<a href=\"https:\/\/www.forth.com\/starting-forth\/\" target=\"_blank\" rel=\"noopener noreferrer\">Here\u00a0<\/a>may be a good place to get you started. #GridScript is backwards compatible, but it includes A LOT of new extensions, security mechanics, cryptography and decentralized consensus operandi. It includes support of runtime-metadata, type conversions, Java-like memory management, pay-per instruction mechanisms, decentralized applications support and so much more. From your current viewpoint it includes something as essential as in-line parameters which allows the entire #GridScript interpreter to be perceived as a command-line interface.<\/p>\n<p>Indeed, everything you have ever typed so far on\u00a0<strong><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong><\/strong>, all the Linux\/Windows parametrised commands utilities- these are either direct low level native #GridSscript instructions or high-level utilities implemented using the former.<\/p>\n<h4>Basic Concepts<\/h4>\n<p>For the purposes of this Tutorial keep in mind the following simple concepts:<\/p>\n<ul>\n<li>Invocation of\u00a0each instruction comes at a cost. Similarly like in Ethereum. The more resources (CPU\/storage\/memory) the instruction involves, the more costly it is. Each low-level\u00a0<strong>#GridScript<\/strong>\u00a0instruction has a cost associated.<\/li>\n<li>The\u00a0<strong style=\"color: #19f0fa;\"><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>GRIDNET VM<\/strong>. Everything you type is done within a\u00a0<strong style=\"color: #19f0fa;\"><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee <\/span>Virtual Machine<\/strong>. While you play Crypto snake, it\u2019s the <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>VM serving you each and every frame. Each time you connect either through SSH or access\u00a0<strong><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>Desktop<\/strong>\u00a0through web-browser, a fresh new instance is spawned for you and killed automatically once you are done or should the system detect any kind of abuse. Even the\u00a0<strong><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>GRIDNET Token<\/strong>\u00a0mobile spawns 1-2 <strong style=\"color: #19f0fa;\">VM<\/strong> instances as needed.<\/li>\n<li>The Sandbox Mode &#8211; what\u2019s important to note about the\u00a0<strong><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>GRIDNET VM<\/strong>? By default it operates within a Sandbox. A certain amount of assets is arranged for your connection and you are free to use these assets as you see fit. However, none of these operations would permanently affect the decentralized state-machine. Results of your instructions\/commands\/operations, asset transfers.. these would only live within the current state of your Sandbox.<\/li>\n<\/ul>\n<h4 data-pm-slice=\"0 0 []\">Escape The Sandbox\ud83d\udcab<\/h4>\n<p>Can we escape the current reality as we know it (while keeping \u2018alive\u2019)\ud83d\ude35\u200d\ud83d\udcab? At least for now we don\u2019t know how\ud83d\ude06. Luckily for us we can escape the\u00a0<strong><span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS\u2019 <\/strong> Sandbox\u00a0<\/strong>and have the results of computations affect the entire Decentralized State Machine thus at high redundancy and security.<\/p>\n<p>How?<\/p>\n<p>That is not overly difficult!\ud83d\ude0a.<\/p>\n<ul>\n<li>Before executing instructions, use the\u00a0<strong>Begin Transaction<\/strong>\u00a0command (\u2018bt\u2019)<\/li>\n<li>When over, issue\u00a0<strong>Commit Transaction<\/strong>\u00a0(\u2018ct\u2019)<\/li>\n<li>at any moment you may see the auto-generated transaction\u2019s source code by using\u00a0<strong>View Transaction<\/strong>\u00a0(\u2018vt\u2019)<\/li>\n<li>even when using <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>GRIDNET Desktop, all your actions are translated into #GridScript under the hood by the<strong>\u00a0<span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong> JavaScript Context<\/strong><\/li>\n<\/ul>\n<p>That\u2019s it. \u00a0The system would then guide you through any questions if needed and present you with a QR Intent which you would scan with your mobile app\ud83d\ude01. Within the <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>GRIDNET Desktop graphical environment things will be even easier and definitely more pleasurable to look at\u00a0\ud83d\ude09<\/p>\n<p>Let\u2019s now get into some more details.<\/p>\n<p>Each instruction which affects the state of the <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong> puts it into another \u2018perspective\u2019.\u00a0 Perspective is the identifier of its state. State-Domains may exist in multiple perspectives at the same time, but only the most recent one is the effective one. All others are assumed to exist in the past.<\/p>\n<p>How does one get to know the current perspective? easily. Simply type&#8230; \u2018perspective\u2019 within the Decentralized Terminal Interface:<\/p>\n<div id=\"attachment_382\" style=\"width: 670px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-382\" class=\"wp-image-382 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/perspective.png\" alt=\"\" width=\"660\" height=\"417\" \/><p id=\"caption-attachment-382\" class=\"wp-caption-text\">Getting to know the current Perspective<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">You may just think of it as the current perspective on things indeed.<\/p>\n<p>You may choose to make your current <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong> switch to any perspective from the past by using the<strong>\u00a0\u2018sync\u2019\u00a0<\/strong>command.<\/p>\n<p>How\u00a0does one\u00a0get perspectives from the past? For one let me go into my home Directory and execute the\u00a0<strong>\u2018info\u2019<\/strong>\u00a0command.<\/p>\n<div id=\"attachment_383\" style=\"width: 676px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-383\" class=\"wp-image-383 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/perviousPers.png\" alt=\"\" width=\"666\" height=\"414\" \/><p id=\"caption-attachment-383\" class=\"wp-caption-text\">Previous States of a State-Domain (i.e. account)<\/p><\/div>\n<div id=\"attachment_384\" style=\"width: 669px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-384\" class=\"wp-image-384 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/perviousPers-1.png\" alt=\"\" width=\"659\" height=\"412\" \/><p id=\"caption-attachment-384\" class=\"wp-caption-text\">The domain has an ID token registered as well.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">Here I can see that my State-Domain (i.e. account) is available in 10 perspectives. The last one at index 9 is the current perspective.<\/p>\n<p>I can choose to time-travel all the way back to the first state. For this I type \u2018sync\u2019 followed by the perspective of my choice.<\/p>\n<div id=\"attachment_385\" style=\"width: 682px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-385\" class=\"wp-image-385 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/perviousPers-2.png\" alt=\"\" width=\"672\" height=\"116\" \/><p id=\"caption-attachment-385\" class=\"wp-caption-text\">Synchronizing with a chosen perspective.<\/p><\/div>\n<p>if I type &#8216;sync&#8217; alone, the <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong> will synchronize with the current state of the network i.e. with the most recent perspective.<\/p>\n<div id=\"attachment_386\" style=\"width: 662px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-386\" class=\"wp-image-386 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/perviousPers-3.png\" alt=\"\" width=\"652\" height=\"96\" \/><p id=\"caption-attachment-386\" class=\"wp-caption-text\">Synchronizing with the current world-view.<\/p><\/div>\n<p>Let\u00a0me see if it actually worked by checking the reported balance:<\/p>\n<div id=\"attachment_388\" style=\"width: 665px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-388\" class=\"wp-image-388 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/perviousPers-4.png\" alt=\"\" width=\"655\" height=\"199\" \/><p id=\"caption-attachment-388\" class=\"wp-caption-text\">Balance seemingly differs from the one in the past.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">Certainly it worked! \ud83d\ude01After all, it\u2019s been conceived, researched and implemented by Wizards\ud83e\uddd9. How could it not\ud83d\ude06.<\/p>\n<p>As you may see above, the values are different. It\u2019s like using a Time-Machine. Congratulations! You\u2019ve just learned not only how to escape the Sandbox, you\u2019ve already learned how to teleport yourself back and forth in time! Can Ethereum do this? Don\u2019t think so.. Let\u2019s keep going!<\/p>\n<h4>The story about Ethereum<\/h4>\n<p>Why is Ethereum being mentioned in here? Well, to get a better perspective on things in short. Folks behind Ether never managed to research and implement effective data pruning for their VM. Here such mechanics are integrated on day 1. Not only that, as you\u2019ve just seen, you may teleport yourself back and forth across states with ease.<\/p>\n<p>Accessing previous state in Ethereum is impossible in short, from the perspective of a smart-contract.<\/p>\n<p>Here are sample places where you may read up on these subjects:<\/p>\n<ul>\n<li><a href=\"https:\/\/ethereum.stackexchange.com\/questions\/10534\/do-the-ethereum-clients-store-historic-state-or-just-current-state\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ethereum.stackexchange.com\/questions\/10534\/do-the-ethereum-clients-store-historic-state-or-just-current-state<\/a><\/li>\n<li><a href=\"https:\/\/ethereum.stackexchange.com\/questions\/47215\/how-can-we-obtain-the-state-value-of-a-variable-from-previous-block-number-using\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ethereum.stackexchange.com\/questions\/47215\/how-can-we-obtain-the-state-value-of-a-variable-from-previous-block-number-using<\/a><\/li>\n<li><a href=\"https:\/\/ethereum.stackexchange.com\/questions\/29024\/how-to-get-all-historic-changes-of-a-state-variable-in-a-smart-contract\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ethereum.stackexchange.com\/questions\/29024\/how-to-get-all-historic-changes-of-a-state-variable-in-a-smart-contract<\/a><\/li>\n<\/ul>\n<p>Folks at Ether built up on Bitcoin.. well, we\u2019ve researched everything from the bottom up there\u2019s not a single line in common with other projects. We\u2019ve learned from the best and what you\u2019re seeing right now is a true peace of Art. It is\ud83d\ude4f.<\/p>\n<h4 data-pm-slice=\"0 0 []\">State-Channels and Off The Chain Transactions<\/h4>\n<p>These are already described quite a lot within the White Paper as far as theory goes. Here we are about practice.<\/p>\n<p>What\u2019s wrong with on-the-chain transactions? Is there anything wrong with these?<\/p>\n<p>As you might know, decentralized state-machines, they\u2019ve got a problem. They do not scale so well. If somebody is trying to sell you yet another decentralized computer, you might want to think twice. You need to be aware that both Bitcoin and Ethereum these are products. Somebody is trying to make money on. Either by being an owner or by trying to make returns from investments. Both of these are brands. Both can be assumed to be riding on the peoples\u2019 lack of technical knowledge to some extent. Back when Ethereum was coming out, it caught many by surprise. It actually painted visions of a decentralized computer whereas they\u2019ve ended up with a DOS-like code execution system nobody knows how to use. Sorry, there\u2019s no decentralized computer from the perspective of a typical end-user as far as Ethereum goes. There never was to be. Don\u2019t get me wrong. Folks at Ether, together with its mastermind, Vitalik, they did a lot. But all in all it can be said that just the Bitcoins\u2019 programming language got replaced by a different one.<\/p>\n<p>Let\u2019s get back to off-the chain and on-the-chain transactions.<\/p>\n<p>Be it Bitcoin, Ethereum, or even <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong>. Changes done to the decentralized system, they need to replicate across the network. Thus transactions no more are only financial transactions\u00a0sensu stricto but are closer in their meaning within the data processing realm. They can represent arbitrary authenticated operations that are to be executed by nodes maintaining the system.<\/p>\n<p>Now imagine millions of users use the platform simultaneously. What happens? It gets stuck. What if you were to reward for propagation of data packets of the entire Internet? Would it be possible? Well certainly not with the current blockchain systems.<\/p>\n<p>Enter <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong> which boards unique implementation of the researched by us State-Less Blockchain Channels, and the related Multi-Dimensional Token Pools.<\/p>\n<p>Here we are after practice not science so lets stick to it.<\/p>\n<h4>The Snake Multiplayer Game\ud83d\udc0d<\/h4>\n<p data-pm-slice=\"0 0 []\">A tutorial describing how to play the game is available\u00a0<a href=\"https:\/\/gridnet.org\/wpp\/index.php\/2021\/05\/22\/playsnake\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p>Here we are after more technicalities, we will also get to see how to cash-out the received tokens. So that to receive the actual <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span>GRIDNET Bacis Units (GBUs)<\/p>\n<p>The game, when launched, tries to access a token pool which was made available by the full-node\u2019s Operator, the one the user is connected to.<\/p>\n<p>For this to work, the operator has to do sacrifice a certain amount of assets. Those sacrificed assets were not ultimately lost, however. Those would be used to create an off-the-chain value store. The data store is represented on-the-chain by an innovative data structure nicknamed the Multi-Dimensional Token-Pool. The total cumulative value comprising the token pool is up to the value of the sacrificial transaction. Each Pool is comprised of (multiple) dimensions. You may think of each dimension as of a bank. Each such bank can be used to keep rewarding single, unique recipient. When rewarding from the given bank one keeps releasing new versions of a Transmission Token. The recipient may choose to cash-out the Transmission Token anytime but each such operations involves a fee, thus it\u2019s in the recipient\u2019s best interest to keep receiving updated versions off of Transmission Token as long as possible (until resources from a given dimension get depleted or once the recipient is not to receive additional rewards) and cash maximum value at a single processing fee.<\/p>\n<p>Sounds reasonable? It is\ud83d\ude0a.<\/p>\n<p>So. For you to be able to receive rewards by playing the Crypto-Snake\ud83d\udc0d game, the Operator sacrificed\u00a010 MILLION GBUs. Now that\u2019s a lot\u00a0\ud83d\ude43.<br \/>\nThe Operator used the receipt of the sacrificial transaction to generate a Token-Pool. What are some of the important Token Pool details?<\/p>\n<p>It would be best to take a look at help displayed by the Token-Pool generation utility:<\/p>\n<div id=\"attachment_393\" style=\"width: 676px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-393\" class=\"wp-image-393 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/tputility.png\" alt=\"\" width=\"666\" height=\"418\" \/><p id=\"caption-attachment-393\" class=\"wp-caption-text\">The Token-Pool generation utility.<\/p><\/div>\n<ul data-pm-slice=\"0 0 []\">\n<li>The value &#8211; this one is computed automatically for you. The token pool generation utility takes the receipt of a sacrificial transaction and looks it value up.<\/li>\n<li>The number of dimensions. &#8211; that parameter tells how many peers you\u2019ll be able to reward simultaneously.\u00a0The more dimensions the bigger the Token Pool\u2019s data structure and the more expensive it will be to deploy. From our research it turns out you should never be in need to use a token pool with more than 30-100 dimensions. Even when using things like a decentralized YouTube, we plan to deploy.<\/li>\n<li>Value of a single token &#8211; that also gets calculated for you automatically if you don\u2019t provide. It\u2019s the value of a single token within each of the dimensions. Note: value tokens\u00a0within each dimension are the same.<\/li>\n<\/ul>\n<h4>Let\u2019s go about generating a Token Pool of our own!<\/h4>\n<div id=\"attachment_395\" style=\"width: 679px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-395\" class=\"wp-image-395 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/s.png\" alt=\"\" width=\"669\" height=\"418\" \/><p id=\"caption-attachment-395\" class=\"wp-caption-text\">A sacrifice needs to be made.<\/p><\/div>\n<p>First I sacrifice 10000 GBUs. The QR will be shown I confirm on the mobile app.<\/p>\n<div id=\"attachment_396\" style=\"width: 673px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-396\" class=\"wp-image-396 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/sacrificed.png\" alt=\"\" width=\"663\" height=\"479\" \/><p id=\"caption-attachment-396\" class=\"wp-caption-text\">Confirming sacrificial transaction with the mobile app.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">Nice! The important thing to me is the Receipt. I\u2019ll use it while generating the Token Pool.<\/p>\n<p>Let\u2019s go about using the token-pool utility now.<\/p>\n<p>Important: We are about to issue yet another transaction. Once containing a Multi-Dimensional Token Pool which will be generated by the mobile app.<br \/>\nThus, we need to bing the <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong> into the current state. Otherwise nonce value associated with your account as seen by your <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong>, one used by the Transaction\u2019s Composer would be out of sync and the resulting transaction &#8211; rejected.\u00a0<strong>Use the \u2018sync\u2019 command now <\/strong>to synchronize with the network now.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_397\" style=\"width: 677px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-397\" class=\"wp-image-397 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/synced.png\" alt=\"\" width=\"667\" height=\"484\" \/><p id=\"caption-attachment-397\" class=\"wp-caption-text\">Time to generate the actual Token Pool.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">I\u2019ve synced and executed \u2018genpool\u2019 just to see the help screen.<\/p>\n<p>Time to begin formulating new transaction by executing the \u2018Begin Transaction\u2019 command, i.e. \u2018bt\u2019.<\/p>\n<p>and then executing the \u2018genpool\u2019 command by providing it with the sacrificial transaction,meaning the Receipt of it.<\/p>\n<p>Let\u2019s go! You\u2019ll be notified that quite a big QR Intent is to be rendered within the Terminal. The system attempts to automatically detect\u00a0the size of your Terminal and warn you or even pause\u00a0execution and wait for you to increase the Terminal\u2019s Width (by resizing its window) should <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong> detect that the width is insufficient.<\/p>\n<div id=\"attachment_399\" style=\"width: 670px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-399\" class=\"wp-image-399 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/commit.png\" alt=\"\" width=\"660\" height=\"483\" \/><p id=\"caption-attachment-399\" class=\"wp-caption-text\">Enormous QR code on the way let us not be afraid.<\/p><\/div>\n<div id=\"attachment_400\" style=\"width: 675px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-400\" class=\"wp-image-400 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/bigger.png\" alt=\"\" width=\"665\" height=\"693\" \/><p id=\"caption-attachment-400\" class=\"wp-caption-text\">Certainly the mobile app handles it just fine.<\/p><\/div>\n<p>That&#8217;s quite a BIG QR Intent indeed. Rendered using UNICODE 1.1 characters from the DOS era. The technology never ceases to amaze us.<br \/>\nThe mobile GRIDNE Token app seems to have no trouble scanning it as well.<\/p>\n<p>Once scanned you&#8217;ll be shown with a mobile screen looking like one on an iPhone below:<\/p>\n<div id=\"attachment_414\" style=\"width: 334px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-414\" class=\"wp-image-414\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/Apple-iPhone-X-Screenshot-1.png\" alt=\"\" width=\"324\" height=\"702\" \/><p id=\"caption-attachment-414\" class=\"wp-caption-text\">Looking good. Certainly the app understands.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">The app says that you can SWIPE your finger for more. And it actually means it! Let us try shall we\u00a0\ud83d\ude01 Simply swipe to the left on the upper bluish field.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_415\" style=\"width: 383px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-415\" class=\"wp-image-415\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/Apple-iPhone-X-Screenshot-2.png\" alt=\"\" width=\"373\" height=\"809\" \/><p id=\"caption-attachment-415\" class=\"wp-caption-text\">Well, indeed it does.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">What just happened? How does the app know.. how does it understand what I\u2019m about to commit? \ud83e\udd2f\u00a0Well:<\/p>\n<ul>\n<li>the mobile app boards a #GridScript decompiler of its own<\/li>\n<li>in some cases the mobile app is required to perform computations on its own so it needs to understand perfectly well what\u2019s being done and how the results of computations are about to be delivered to the network.<\/li>\n<\/ul>\n<p>Here the app, being the only trusted device on the system as per our Security-Threat models, is asked by one of the full nodes to generate a Token Pool. See, the Token Pool couldn\u2019t be generated by the full-node itself as the resulting data structure needs to contain a secret value which cannot be known to the full-node itself. See.. Wizards\ud83e\uddd9\ud83e\uddd9\u200d\u2640\ufe0f really, really.. they took their work.. seriously. They\u2019ve saved upon nothing \ud83d\ude4f<\/p>\n<p>The description which you see is generated dynamically. Really. What you\u2019re seeing is dynamically generated HTML and CSS representing the tasks to be executed by the mobile app. The app strives to provide\u00a0as accurate description as it possibly can. The cool thing about it is that the app can represent operations it has never been initially prepared for or operations that Wizards\ud83e\uddd9\ud83e\uddd9\u200d\u2640\ufe0f haven\u2019t initially envisioned.<\/p>\n<p>If you&#8217;ve kept track of\u00a0the Project\u00a0for some time already you know very well that the autonomous remote Log-Me-In functionality described\u00a0<a href=\"https:\/\/gridnet.org\/wpp\/index.php\/2021\/06\/07\/log-in-to-gridnet-os\/\" target=\"_blank\" rel=\"noopener noreferrer\">here\u00a0<\/a>has been implemented and deployed without requiring any updates to the mobile app itself. It simply worked and provided custom, new messages within the mobile app\u2019s UI.<\/p>\n<p>Let&#8217;s keep going and confirm actions\u00a0within the mobile app. An onion routed connection to the very <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong> hosting your SSH session would be initiated and established. The mobile app would keep\u00a0notifying you upon any changes to its status. Interestingly the app receives updates about both the network-layer connectivity, the decentralized state-machine operations, results of tasks related to the remote peer.. and a few others\ud83d\ude06 Quite smart it is, still everything is wrapped in a very minimalistic UI with all the details hidden away for your convenience.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_416\" style=\"width: 407px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-416\" class=\"wp-image-416\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/Apple-iPhone-X-Screenshot-3.png\" alt=\"\" width=\"397\" height=\"860\" \/><p id=\"caption-attachment-416\" class=\"wp-caption-text\">Onion Routing data to the network.<\/p><\/div>\n<p>&nbsp;<\/p>\n<p data-pm-slice=\"0 0 []\">If everything goes well, soon\u00a0enough you\u2019ll get to see confirmation within the SSH terminal that a Token Pool has been generated and delivered from the mobile app. The representation of the token Pool Delivered from the mobile app is \u2018disarmed\u2019, meaning it does not contain the secret value but it is enough to be put into the decentralized state machine\u2019s storage and validate any consecutive token you might be issuing on its behalf later on.<\/p>\n<div id=\"attachment_402\" style=\"width: 674px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-402\" class=\"wp-image-402 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/tpfrommobile.png\" alt=\"\" width=\"664\" height=\"689\" \/><p id=\"caption-attachment-402\" class=\"wp-caption-text\">Disarmed token pool generated by the mobile app has been delivered to the Terminal.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">An interesting thing to note: the <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong> has already generated, fully autonomously, source code of a transaction whose instructions instruct the decentralized state machine to register the very token pool you mobile app has just delivered. How cool is that? How amazingly sophisticated. Let us keep going, shall we?<\/p>\n<p>You may view the transaction\u2019s source code by using the previously mentioned \u2018vt\u2019 instruction. There could be a very short friction as the source code is generated. The large portion of text is the base64 encoded Token Pool your mobile app has just provided.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_403\" style=\"width: 673px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-403\" class=\"wp-image-403 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/vt.png\" alt=\"\" width=\"663\" height=\"772\" \/><p id=\"caption-attachment-403\" class=\"wp-caption-text\">Lurking into the source code of auto-generated transaction..<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>As you may see the entire transaction is 5723 bytes in length.<\/p>\n<div id=\"attachment_404\" style=\"width: 677px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-404\" class=\"wp-image-404 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/ct.png\" alt=\"\" width=\"667\" height=\"771\" \/><p id=\"caption-attachment-404\" class=\"wp-caption-text\">The wall of text is base64 encoded TokenPool data.<\/p><\/div>\n<p>&nbsp;<\/p>\n<p data-pm-slice=\"0 0 []\">Let\u2019s commit! There\u2019s nothing to wait for. Use Commit Transaction (\u2018ct\u2019). The <span style=\"letter-spacing: -.6em; padding-right: 0.4em; padding-left: 0.57em; color: #00dcff; font-weight: bold;\">\u22ee\u22ee\u22ee<\/span><strong style=\"color: #19f0fa;\">VM<\/strong> would automatically calculate the costs based on the encountered transactions. All you need to do is accept the proposed values\ud83d\ude4f.<\/p>\n<p>The <strong style=\"color: #19f0fa;\">VM<\/strong> would now show yet another QR intent which asks for your permission to sign and broadcast the just generated transaction. Once you confirm the mobile app would sign it and then onion route it across the network (end-to-end encryption for anonymity at all times).<\/p>\n<p>&nbsp;<\/p>\n<div id=\"attachment_405\" style=\"width: 677px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-405\" class=\"wp-image-405 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/ct3.png\" alt=\"\" width=\"667\" height=\"559\" \/><p id=\"caption-attachment-405\" class=\"wp-caption-text\">We need to broadcast TX instructing for registration of the Token Pool.<\/p><\/div>\n<p>You are constantly being notified about results&#8230;<\/p>\n<div id=\"attachment_406\" style=\"width: 672px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-406\" class=\"wp-image-406 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/commited3.png\" alt=\"\" width=\"662\" height=\"499\" \/><p id=\"caption-attachment-406\" class=\"wp-caption-text\">Done!<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">Presumably the transaction got published successfully and is now being processed by the decentralized network of full nodes.<\/p>\n<p>At any point you may check status of the previous transaction by using the \u2018getresult\u2019 command. If you don\u2019t provide parameter, it will check the result of the most recent transaction. You may, however, provide it with a custom receipt. The utility would contact the network and fetch result along with the stack-frame including meta-data should anything have gone wrong.<\/p>\n<div id=\"attachment_407\" style=\"width: 677px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-407\" class=\"wp-image-407 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/result4.png\" alt=\"\" width=\"667\" height=\"400\" \/><p id=\"caption-attachment-407\" class=\"wp-caption-text\">In the end token pool is stored within a file on the decentralized file-system.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">Luckily, everything went just fine. Like above you may CD into my directory i.e. use \u2018cd \/CodesInChaos\u2019 and then enter the TokenPools directory to see that the token pool under the name \u2018sample\u2019 indeed is there. What a joy! You may also use full path right away ex.\u00a0\u2018cd \/CodesInChaos\/TokenPools\u2019<\/p>\n<div id=\"attachment_409\" style=\"width: 585px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-409\" class=\"wp-image-409 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/lesstp.png\" alt=\"\" width=\"575\" height=\"360\" \/><p id=\"caption-attachment-409\" class=\"wp-caption-text\">We may see into it with parameterized Linux-like commands.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">\u2018sample\u2019 is just another file on the\u00a0<strong>GRIDNET OS\u2019 Decentralized File System<\/strong>. This very file is stored in the\u00a0<strong><strong style=\"color: #19f0fa;\">GRIDNET OS<\/strong>Eternal Storage,<\/strong>\u00a0meaning full redundancy at each and every full-node.<\/p>\n<p>You may use Linux-style \u2018less\u2019 command to view its contents. You may want to use the<strong>\u00a0-tp<\/strong>\u00a0parameter so that the binary interpretation layer kicks in and the binary code is treated as a Token-Pool with all the fields depicted as in the picture above.<\/p>\n<p>How to be using Tokens From a Token Pool will be a subject for another tutorial! Something is telling us you\u2019ll be getting to know how to use these from the GRIDNET Desktop Graphical User Interface very, very soon\u00a0\ud83d\ude01.<\/p>\n<h4>Cashing Out Of Tokens<\/h4>\n<p>So you\u2019ve played Crypto-Snake a lot and now you want to cash-out your rewards? It\u2019ve very simple.<\/p>\n<p>Say I had my current Snake Token equal to \u201cCETH71fZGK8nc6yctJBjKTzy7cG92DSsRQhGA6aUzbP5uN82p4zY1VoWo3LLzz3PvQ9uH63zz5bGts3VaZ2myS6oKDadKKYeYi4HchcivMwcqHq799z9dqPnkXajfT1\u201d<\/p>\n<p>Let\u2019s see what the xtt command shows when I try to cash it out in SandBox. We may use the\u00a0<strong>\u2018xtt\u2019<\/strong>\u00a0command, as in the picture below.<\/p>\n<div id=\"attachment_422\" style=\"width: 678px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-422\" class=\"wp-image-422 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/xtt.png\" alt=\"\" width=\"668\" height=\"82\" \/><p id=\"caption-attachment-422\" class=\"wp-caption-text\">Cashing out of Tokens generated from a Token Pool.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">so looks like I would get 10GBUs were I to wrap this code in BT &lt;-&gt; CT block and commit.<\/p>\n<p>If I want more, I can play Crypto snake further by providing this token during game start<\/p>\n<p>While playing, I gathered 2 bags of coins. The app provided me with a new token equal to:<\/p>\n<p>racTiXpHsLyVTfBzNp43A4GK1Pyfmjy3GPFZL54MU3jtm9DX6cyx1DjUxbCy6rY2C9ZcYxYjnNpb6VFEb6fXeykxjq6Nui6tgoiAW6TLDpg122R99F6qv6W74CXSKriK<\/p>\n<div id=\"attachment_423\" style=\"width: 693px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-423\" class=\"wp-image-423 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/token2.png\" alt=\"\" width=\"683\" height=\"422\" \/><p id=\"caption-attachment-423\" class=\"wp-caption-text\">having more!<\/p><\/div>\n<p>Let&#8217;s try to cash it out shall we !<\/p>\n<div id=\"attachment_424\" style=\"width: 673px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-424\" class=\"wp-image-424 size-full\" src=\"https:\/\/gridnet.org\/wpp\/wp-content\/uploads\/2021\/06\/tpcashout.png\" alt=\"\" width=\"663\" height=\"419\" \/><p id=\"caption-attachment-424\" class=\"wp-caption-text\">The system recognizes the additional reward.<\/p><\/div>\n<p data-pm-slice=\"0 0 []\">Looking good! After collecting 2 more bags of coins in single-player I now have 30GBUs to cash out. Note that it\u2019s not really worthwhile for me to do so since the fees are higher than the rewards. Gotta play Snake some more!\ud83d\ude06.<\/p>\n<p>Thank you for reading stay tuned!<\/p>\n<p>This post has been written by CodesInChaos ~one of the Wizards\ud83e\uddd9\ud83e\uddd9\u200d\u2640\ufe0f<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u22ee\u22ee\u22ee\u00a0Today we will be looking at Stateless-Channels, as described within some of our research papers and Multi-Dimensional Token Pools in particular &#8211;&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-375","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/posts\/375","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/comments?post=375"}],"version-history":[{"count":39,"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/posts\/375\/revisions"}],"predecessor-version":[{"id":441,"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/posts\/375\/revisions\/441"}],"wp:attachment":[{"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/media?parent=375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/categories?post=375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mag.gridnet.org\/index.php\/wp-json\/wp\/v2\/tags?post=375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}