{"id":18798,"date":"2026-03-29T21:24:39","date_gmt":"2026-03-29T21:24:39","guid":{"rendered":"https:\/\/cryptoted.net\/index.php\/2026\/03\/29\/ambients-applied-to-ethereum-ethereum-foundation-blog\/"},"modified":"2026-03-29T21:24:39","modified_gmt":"2026-03-29T21:24:39","slug":"ambients-applied-to-ethereum-ethereum-foundation-blog","status":"publish","type":"post","link":"https:\/\/cryptoted.net\/index.php\/2026\/03\/29\/ambients-applied-to-ethereum-ethereum-foundation-blog\/","title":{"rendered":"Ambients Applied to Ethereum | Ethereum Foundation Blog"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"\">\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"part-i\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"part i permalink\" href=\"#part-i\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Part I<\/h2>\n<h5 class=\"chakra-heading css-1rc0ucf\">Sometimes Ethereum is compared to a singleton Virtual Machine. \u00a0While this is correct in some sense; I think it is a bit more. First of all what is a singleton in a distributed system? It is merely a set of values that some threshold of participants have come to consensus on. \u00a0A Virtual Machine is a computational environment that is isolated from the physical computer and from other environments.<\/h5>\n<p>A hypervisor allows the physical machine to be multiplexed into many VMs. According to this definition a common hypervisor is the web browser where webpages are VMs. Another example of a hypervisor would be Ethereum as each contract \u00a0gets its own isolated computational environment.<\/p>\n<p class=\"chakra-text css-gi02ar\">There are many differences between the common web browser and Ethereum, but one of the more interesting ones is how VMs communicate and interact with each other. Web browsers don\u2019t provide a way for VMs to directly interact while Ethereum on the other hand provides some simple mechanism for VM interaction; the opcodes CALL, DELEGATECALL, CALLCODE, CREATE. \u00a0In this post will explore the question; What other rules could exist? \u00a0Can we generalize VM interactions and provided an abstract framework for these interactions? And from this framework can we reason about distributed hypervisors?<\/p>\n<p class=\"chakra-text css-gi02ar\">Most of this post will resemble <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/en.wikipedia.org\/wiki\/Ambient_calculus\">ambient calculus<\/a> but there are several notable differences from ambient calculus and what is presented here. The diagrams can be thought of as <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/en.wikipedia.org\/wiki\/Bigraph\">bigraphs<\/a> but they should also be self explanatory. Part I will describe the rules of ambients and then apply them to Ethereum. Part II will discuss scaling in the terms of ambients as laid out by part I.<\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"what-is-an-ambient\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"what is an ambient permalink\" href=\"#what-is-an-ambient\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>What is an Ambient?<\/h2>\n<p><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image09.png\"><img decoding=\"async\" alt=\"image09\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image09.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">An ambient is a bounded place in which computation can occur. A boundary determines what is inside and what is outside an ambient. \u00a0For ambients we call this boundary a membrane. The area inside an ambient is hierarchical namespace. Objects can exist inside an ambient. The objects are addressable via the namespace. There are three base elements in ambient calculus. Objects, Namespaces and Messages.<\/p>\n<h4 class=\"chakra-heading group css-qm6a1\" id=\"hierarchical-namespaces\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"hierarchical namespaces permalink\" href=\"#hierarchical-namespaces\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Hierarchical Namespaces<\/h4>\n<p>One of the most familiar namespace is the file system tree. \u00a0Namespaces allow us to identify objects with paths or names. Namespaces here have the following properties<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">For every possible path there exists a null or an object<\/li>\n<li class=\"css-0\">At any point in the namespace you can move up or down. This is what is implied by hierarchical.<\/li>\n<li class=\"css-0\">Every path has a root associated with it. The root uniquely identifies the content for all the paths below the root. You can think of the root as a pointer to the content of the path.<\/li>\n<li class=\"css-0\">Paths can be read from or written to<\/li>\n<li class=\"css-0\">Messages can be sent along paths to objects<\/li>\n<\/ul>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"object-types\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"object types permalink\" href=\"#object-types\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Object Types<\/h3>\n<p><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image07.png\"><img decoding=\"async\" alt=\"image07\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image07.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">What is an object? It is just a value. In real life computing its just some data. \u00a0This data can be interpreted in several different ways. Any Object can be read as data. The pink circle is some data that exists in the grey ambient.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image12.png\"><img decoding=\"async\" alt=\"image12\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image12.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">Objects can also be interpreted as ambients. This allows ambients to have sub-ambients. Here the orange and grey circles are ambients.<\/p>\n<p class=\"chakra-text css-gi02ar\">\u00a0<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image16.png\"><img decoding=\"async\" alt=\"image16\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image16.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">Objects can also be interpreted as ports. Two or more ports form a I\/O channel. Channels allow messages to be sent to ambients in a different namespaces. Channels can be thought of as tunnels through an ambient\u2019s membrane. Both the entrance and exit ports must exist somewhere in a namespace. \u00a0Here the green objects represent ports.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image06.png\"><img decoding=\"async\" alt=\"image06\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image06.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">Lastly messages can also be considered to be an object. Messages are \u00a0special since they are defined as objects in motion or thought of as objects with velocity.<\/p>\n<p class=\"chakra-text css-gi02ar\">To Recap; Objects can be the following types<\/p>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>Objects :: =\n     Data\n     Port\n     Ambient\n     Message\n\n<\/pre>\n<\/div>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"messages\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"messages permalink\" href=\"#messages\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Messages<\/h3>\n<p>As stated above messages are objects that are in transit. Messages can be sent through a namespace and through channels. Messages have the following properties that are set by the systems message handler. They are not all intrinsically part of the message but as you will see later they make working with messages easier.<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">To &#8211; The path to the destination of the message. This is immutable.<\/li>\n<li class=\"css-0\">From &#8211; The sender of the message. This is immutable.<\/li>\n<li class=\"css-0\">Type &#8211; The type of message. This is immutable.<\/li>\n<li class=\"css-0\">Data &#8211; The message&#8217;s body. This is immutable.<\/li>\n<li class=\"css-0\">Heading &#8211; The destination relative to its current position. If `Heading` is `null` then the message has arrived at its destination and will travel no further. This is not directly encoded in the message but instead set by the systems message handler. This is mutable.<\/li>\n<li class=\"css-0\">Direction &#8211; Which direction the message is traveling. It can either be going \u2018out\u2019 of the ambient or going \u2018in\u2019 to the ambient. This is mutable.<\/li>\n<\/ul>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"message-types\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"message types permalink\" href=\"#message-types\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Message Types<\/h3>\n<p>Message have the following types which have corresponding commands used to send them.<\/p>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>       Set(path, value) - Sets a path to a given value<\/pre>\n<\/div>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>       Get(path) - Gets a value of the given path<\/pre>\n<\/div>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>       SetRoot(path, root) - sets the root of `path` to `root`<\/pre>\n<\/div>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>       GetRoot(path) - Gets the path\u2019s root<\/pre>\n<\/div>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>       Call(path, data) - Sends a message along the given path<\/pre>\n<\/div>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>       Connect(to, from, options) - creates a channel between two paths.<\/pre>\n<\/div>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"deleting\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"deleting permalink\" href=\"#deleting\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Deleting<\/h3>\n<p>It might not be immediately obvious how to delete an ambient or other objects. To do this we use the `Set` and `SetRoot` message.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image11.png\"><img decoding=\"async\" alt=\"image11\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image11.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">The <span class=\"chakra-text css-ons8vw\">Set<\/span> message sets the value of a path. \u00a0Setting a path to null is equivalent to deleting \u00a0the contents of that path. For example <span class=\"chakra-text css-ons8vw\">Set(\u2018pinkAmbient\u2019, null) <\/span> Here the pink ambient is set to null. \u00a0Note the the orange ambient was not deleted.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image01.png\"><img decoding=\"async\" alt=\"image01\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image01.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">The <span class=\"chakra-text css-ons8vw\">SetRoot<\/span> message sets the root of a path. If the root is set to <span class=\"chakra-text css-ons8vw\">null<\/span> all the path values below the root will become null. For example <span class=\"chakra-text css-ons8vw\">CopyRoot(\u2018pinkAmbient\u2019, null) <\/span> will set the pink ambient\u2019s root to null which will also cause the orange ambient be to null.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image05.png\"><img decoding=\"async\" alt=\"image05\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image05.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">Of course if we did something like SetRoot(\u2018a\u2019, \u2018pinkAmbientsRoot\u2019) we would copy the pink Ambient and all of it contents to path \u201ca\u201d<\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"iterating-the-through-a-namespace\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"iterating the through a namespace permalink\" href=\"#iterating-the-through-a-namespace\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Iterating the through a Namespace.<\/h2>\n<p>In many cases it useful to iterate through all the ambients in a given namespace. One way we could approach this is to `get` each path in the namespace. But the problem is that most namespaces are infinite. \u00a0A better way would be to provide an explicit iteration method. \u00a0Let&#8217;s add a message<\/p>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>   Next(path) - Given a path return the next non-null path in the namespace.<\/pre>\n<\/div>\n<p>This implies that namespaces all must have an order. \u00a0Also this provides us with a nice way to build more complicated ambient operations like merging two or more ambients. \u00a0We also need this to build type checking.<\/p>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"membrane-computing\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"membrane computing permalink\" href=\"#membrane-computing\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Membrane computing<\/h3>\n<p><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image02-1.png\"><img decoding=\"async\" alt=\"image02\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image02-1.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">The ambient\u2019s border is its membrane. It can filter message coming into and going out of it. \u00a0For example the if the grey ambient sends a <span class=\"chakra-text css-ons8vw\">Set(\u2018blueAmbient\u2019, null) <\/span> \u00a0message to the path of the \u2018blueAmbient\u2019 it will go through the membrane of the orange ambient. The orange ambient can decided whether or not to let the message pass through.<\/p>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"\" data-group=\"false\"\/>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"-1\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\" 1 permalink\" href=\"#-1\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a><\/h3>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"a-membrane-api\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"a membrane api permalink\" href=\"#a-membrane-api\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>A Membrane API<\/h3>\n<p>Lets walk through a small example of what programming ambients might look like.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image00.png\"><img decoding=\"async\" alt=\"image00\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image00.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">Ambient A is trying send a message to \u00a0ambient B but the message has to go through Ambient C. Since A is a sub-ambient of C, C can control this message. Here is what an api for dealing with messages might look like. \u00a0Let say that we have a function \u2018onMessage\u2019 that gets ran whenever the ambient gets a message. \u00a0Here is what C membrane could look like.<\/p>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>\/**\n* Allow any message to pass through the membrane except messages from Ambient D\n* @method onMessage\n* @param message - the message that is leaving the ambient\n* @retruns Boolean\n*\/<\/pre>\n<\/div>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>function onMessage(message) {\n  if(Message.sender != \u201dA\u201d &amp;&amp; Message.direction == \u2018out\u2019){\n    Message.heading = \u2018D\u2019\n  }\n}<\/pre>\n<\/div>\n<p class=\"chakra-text css-gi02ar\">C filters any messages coming from the path \u2018A\u2019 that are going out of it. \u00a0Instead of letting the message go to its intended location C \u00a0reroutes the message to location \u201cD\u201d. \u00a0Notice how C set the heading on the message. If C set Message.heading to <span class=\"chakra-text css-ons8vw\">null<\/span> then the message would stop there. \u00a0C can only decide where to forward the message or to stop it.<\/p>\n<p class=\"chakra-text css-gi02ar\">The ability of ambients to filter and decide which message can travel through them is an important one. \u00a0\u00a0This is also known as Membrane computing. It will allow you to build flexible and easily composable contracts. Especially when it comes to administration of sub-contracts.<\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"mapping-ambients-to-a-ethereum\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"mapping ambients to a ethereum permalink\" href=\"#mapping-ambients-to-a-ethereum\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Mapping ambients to a Ethereum<\/h2>\n<p>Now that we have the basics of ambients let&#8217;s apply them to a one of our favorite data structures, the <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/github.com\/ethereum\/wiki\/wiki\/Patricia-Tree\">merkle tree<\/a>. \u00a0To start you might have already recognized the fact that a contract in Ethereum is like an ambient and the namespace is provided by the merkle tree.<\/p>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>Namespace ::=the merkle tree<\/pre>\n<\/div>\n<p>This could be visualized like this<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image17.png\"><img decoding=\"async\" alt=\"image17\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image17.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">In Ethereum each ambient has an address that is 20 bytes long and looks like the following 0x1158c3c9a70e85d8358972810ed984c8e6ffcf0f. \u00a0\u00a0Ethereum ambients have storage that allow them store store arbitrary values permanently. \u00a0Storage is accessed and manipulated with the SSTORE and SLOAD opcodes. \u00a0The equivalent to these \u00a0are the set and get messages. Also command Call is equivalent.<\/p>\n<p class=\"chakra-text css-gi02ar\">SetRoot, GetRoot and Connect do not have equivalents in Ethereum currently. SetRoot and GetRoot would read from and manipulate the underlying mekle trie.<\/p>\n<p class=\"chakra-text css-gi02ar\">Now we are going to deviate from \u00a0current Ethereum \u00a0to Ethereum + Ambients. \u00a0Let us say the contract 0x1158c3c9a70e85d8358972810ed984c8e6ffcf0f sets the value \u2018doge\u2019 at the addresses \u2018coin\u2019 \u00a0which is <span style=\"color:#ff0000\">636f696e<\/span> in hex. \u00a0The address 0x1158c3c9a70e85d8358972810ed984c8e6ffcf0f\/<span style=\"color:#ff0000\">636f696e<\/span> would then contain the value \u00a0\u2018doge\u2019. \u00a0\u00a0Also \u2018doge\u2019 could also be interpreted as code if a Call was made to that path.<\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"personal-accounts\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"personal accounts permalink\" href=\"#personal-accounts\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Personal Accounts<\/h2>\n<p><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image10.png\"><img decoding=\"async\" alt=\"image10\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image10.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">Lets use a personal Ethereum account as an example. \u00a0For convenience we are going to say the address of the account is \u201caccountA\u201d which will be represented as the grey ambient. \u00a0This ambient would hold the basic signature validation code as seen in the <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/github.com\/ethereum\/EIPs\/issues\/28\">currency and crypto abstraction<\/a>. If the user wanted to place a spending limits on herself then she could create a \u201cSavings Account\u201d which would only permit a certain amount of ether to be spent per day. \u00a0Furthermore the user could create her own custom Name Reg or other financial apps. The hierarchical nature of the ambients allows you to build up administrative \u201czone\u201d. They can make code very modular since the \u201csaving account\u201d and other contracts don\u2019t \u00a0need to have any code dedicated to checking \u00a0if the user is an admin or checking other credential since that could be done by the accountA\u2019s ambient.<\/p>\n<p>In this section we will explore some ideas about scalability in terms of ambients.<br \/>\nThe basic idea of scalability is fairly simple. Most methods proposed so far involve these properties:<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Separating some part of the state into a shard that is processed independent of the other shards<\/li>\n<li class=\"css-0\">Some sort of cross validation; where some portion of a shard\u2019s work is checked by other shards which is usually triggered by cross shard communication.<\/li>\n<\/ul>\n<p>We are also assuming we have a Proof of Stake algorithm like Casper and this algorithm is implemented in a set of ambients. Along with casper we have a currency ambient that tracks the amount of ether each account ambient has. These ambients are grouped together into the system ambient. There maybe many more ambients in the system ambient but for now we will just consider these.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image14.png\"><img decoding=\"async\" alt=\"image14\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image14.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">For now we will simply assume that casper works and produces the correct state for the \u201cEthereum Ambient\u201d.<\/p>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"sharding\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"sharding permalink\" href=\"#sharding\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Sharding<\/h3>\n<p>If Ethereum is successful, the volume of transaction will increase over time. \u00a0After a while a high volume of transactions will cause the price of gas to increase. At a certain threshold determined by a Threshold function the Casper ambient will \u00a0produce a shard. \u00a0It should be noted that only from the casper ambient\u2019s perspective is Ethereum sharded. Everyone else sees Ethereum as one continued namespace extending through many ambients.<\/p>\n<p class=\"chakra-text css-gi02ar\">There is some threshold that is needed to create a shard in Casper. This is not the focus of this post but we can image some of the parameters it might be based off of. It could use gasPrice to transaction ratio. Or could it use a voting system or a bidding system or combination of all them.<\/p>\n<p class=\"chakra-text css-gi02ar\">Besides the Threshold function we will assume the following about Casper:<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Anyone can contest a state transition.<\/li>\n<li class=\"css-0\">Validators are randomly assigned to shards. These form a validation group that run Casper for that shard.<\/li>\n<li class=\"css-0\">Validator may be assigned to more than one shard<\/li>\n<li class=\"css-0\">New shards must be initially validated by all validators<\/li>\n<li class=\"css-0\">The total amount in bond in a validation group of a shard should be equivalent to what the shard is worth.<\/li>\n<\/ul>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"creation-of-shards\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"creation of shards permalink\" href=\"#creation-of-shards\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Creation of Shards<\/h3>\n<ol role=\"list\" class=\"css-vgl4zd\">\n<li class=\"css-0\">For now we will assume that new shards will start out as an empty ambient. \u00a0But keep in mind this might not always be the case- for example a particularly successfully dapp could perhaps pay the Casper contract enough to make it worthwhile for the validator to create a shard out of it. \u00a0But for now it is empty.<\/li>\n<li class=\"css-0\">\u00a0The first thing that happens to the new shard ambient is the system contracts are copied to it. But we don\u2019t want an exact copy of the current system ambient. This is because it contains the current state. We want an empty currency contract and an empty Casper contract, etc. \u00a0To do this the Ethereum ambient must have an \u201cabstract\u201d system ambient from which we then copy. We can image the abstract system ambient would have a message handler that only allowed messages that were copying it. It could looks something like this:\n<div class=\"chakra-stack css-1jx0in4\">\n<pre>function onMessage(message) {\n   \/\/ disallows messages getting any subambient\n   \/\/ roots from the abstract system\n  \u00a0if(message.type !== `getRoot ` \u00a0|| message.headed !== \u2018\u2019){\n     \u00a0message = null \/\/ kills the message\u00a0\n  }\n}<\/pre>\n<\/div>\n<p>The new shard would send a `getRoot` to the abstract system. Then it would use `setRoot` internally to copy the abstract system its namespace.<a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image15.png\"><img decoding=\"async\" alt=\"image15\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image15.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/li>\n<li class=\"css-0\">\u00a0Part of the threshold function might be pledges from other ambients to move to a new shard once it is created. When the new shard is created, all the accounts that pledged to move are automatically moved to the new shard. This is done after the system ambient is in place. The accounts are also copied with the `CopyRoot` command.<\/li>\n<li class=\"css-0\">After they have been copied their original address is replaced by a port (created by the \u201cConnect\u201d command) creating a channel to their new account on the new shard.<\/li>\n<li class=\"css-0\">The currency contract then sets the amount of ether that the shard has to the sum of the accounts that pledge to move.<\/li>\n<li class=\"css-0\">Lastly the in the new shards currency, the contract is populated by the values of the copied accounts.<\/li>\n<\/ol>\n<p><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image03.png\"><img decoding=\"async\" alt=\"image03\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image03.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"fractal-chains\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"fractal chains permalink\" href=\"#fractal-chains\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Fractal chains?<\/h2>\n<p><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image08.jpg\"><img decoding=\"async\" alt=\"image08\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image08.jpg\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">The end result will be that the top level ambients no longer \u201csee\u201d the individual accounts that are in the new shard, instead it only see the value of the sum of the account on the new shard ($82 in the diagram). While the new shard\u2019s currency contract keeps track of the individual accounts in the shard. This resembles a fractal in the way that part of the whole is encoded in every section of the structure.<\/p>\n<p class=\"chakra-text css-gi02ar\">Also if anyone uses the old address of an ambient that moved, their messages will be forwarded to them via the channels. There are some disadvantages to using the channels; 1) its will be more costly 2) there will be higher latency.<\/p>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"financial-isolation---counterfeiting-attacks\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"financial isolation   counterfeiting attacks permalink\" href=\"#financial-isolation---counterfeiting-attacks\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Financial Isolation &#8211; Counterfeiting Attacks<\/h3>\n<p>The shards can be seen forming a hierarchy; each shard ambient keeping track of its accounts and the sum of the accounts in its children shards.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image04.png\"><img decoding=\"async\" alt=\"image04\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image04.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">This creates a strong guarantee of the correctness of account balances. No shard can create counterfeit currency and send it to another shard. Furthermore the security is additive. Meaning that the more shards that a message crosses the stronger the guarantee that it is correct. We are assuming that every validation group will check that transaction going through it. If a transaction is going from shard C to C.A.B then shards C, C.A and C.A.B all will check the transaction and ask the shard C for merkle proof of the sender\u2019s account. If the transaction was \u00a0found to be invalid after the validator\u2019s approved it then the validators in all three groups would lose their deposits. If accounts were defrauded they would first be refunded from the validators deposits.<\/p>\n<p class=\"chakra-text css-gi02ar\">Let&#8217;s consider a long range counterfeit attack. This is where a validation group on a shard creates an account with an invalid amount of currency associated with it and then\u00a0they just leave it in the shard. If they ever try to move it from the shard the parent validation group will request a complete transaction log that shows how the accounts got its money. At this point the attack would fail unless the parent validation group was also compromised. And in a long range attack the attackers wait until the parent validation group is compromised. The best way to counter this is to make each validation group responsible for the complete history of its shard and not to release the bonds to unbonded validators after several epochs. This gives the \u00a0current validation group an incentive to check the previous validation groups work.<\/p>\n<p class=\"chakra-text css-gi02ar\">One way in which a validation group can check the previous validation group work quickly is to just sum the transaction graph. We can think of all messages that transfer currency as forming a directed graph. Since we know the global amount of currency that the shard has, a validation group just needs to sum up the total amount the accounts had for each block in the previous epoch and check it against the known global amount.<\/p>\n<p class=\"chakra-text css-gi02ar\">To recap, several properties that can increase security are:<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Give the Parent Validation group an incentive to check the work of their children.<\/li>\n<li class=\"css-0\">Give validator an incentive to check previous work<\/li>\n<\/ul>\n<h2 class=\"chakra-heading group css-1kpzc4q\" id=\"validation-group-groups-hierarchical-validation-groups\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"validation group groups hierarchical validation groups permalink\" href=\"#validation-group-groups-hierarchical-validation-groups\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Validation Group Groups (Hierarchical validation groups)<\/h2>\n<p>Validators may have to put up a very high bond to participate in validation. \u00a0The amount of bond needed is a function of the target number of validators which is a function of the number of shards that exists.<\/p>\n<p class=\"chakra-text css-gi02ar\">But this poses a problem since if there were a higher number of validators it would be harder to coordinate a bribe attack on a shard but on the other hand Casper can become inefficient when there are large number of validators. One way this might be solved is to have validators themselves composed of validation groups. The validation group would run in a separate ambient on a separate blockchain from Ethereum.<\/p>\n<p class=\"chakra-text css-gi02ar\">In the validation group ambient, work is further subdivided into smaller chunks. Each individual validator would get assigned several ambients from the shard that validator group was assigned to. This should effectively allow even a small device to participate in validation increasing the total number of participants that briber would have to potentially coordinate with.<\/p>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"channels-outside-the-ethereum-ambient\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"channels outside the ethereum ambient permalink\" href=\"#channels-outside-the-ethereum-ambient\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>Channels outside the Ethereum ambient<\/h3>\n<p>To do this the validation group would create a new ambient that was connected by a channel to the validator group\u2019s ambient. You might wonder how it is possible to link to an ambient outside of Ethereum. But underneath its straightforward.<\/p>\n<p class=\"chakra-text css-gi02ar\"><a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image13.png\"><img decoding=\"async\" alt=\"image13\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2016\/02\/image13.png\" class=\"chakra-image css-hw6q2r\"\/><\/a><\/p>\n<p class=\"chakra-text css-gi02ar\">Initially there would only be a validators account controlled by multisig on the Ethereum blockchain. Then the validators would create their own blockchain (represented as an ambient) which would have the same system ambients and Casper ambients as Ethereum. After creation, the validator group would connect the two ambients with a channel. Any message entering or exiting the ports the must be agreed upon by all the validators, so the channel should also be protected by a multisig. The code for the multisig would exist in the ports message handler. The channel could only be followed by those running both sets of ambients. Nodes running just the Ethereum ambient would see the channel but would not be able to follow it.<\/p>\n<p class=\"chakra-text css-gi02ar\">This provides a pattern that could be elsewhere as it provides a generic way to connect arbitrary ambients to the Ethereum blockchain. These ambients could stand for the state of your personal computer or an arbitrary feed of data. Beyond the examples given here, there are many other design patterns that make thinking in ambients useful. While there are still many lacunae ambients could be a useful model for computational environments. \u00a0Ambients adds a new dimension to Ethereum\u2019s hypervisor. Quite literally too. It allows for contract to be even more modular and provides for a convenient way to create \u00a0administrative domains and model many everyday situations.<\/p>\n<h4 class=\"chakra-heading group css-qm6a1\" id=\"notes-and-problems\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"notes and problems permalink\" href=\"#notes-and-problems\"><svg viewbox=\"0 0 24 24\" focusable=\"false\" class=\"chakra-icon css-173jpr1\"><g fill=\"currentColor\"><path d=\"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z\"\/><path d=\"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z\"\/><\/g><\/svg><\/a>NOTES and PROBLEMS<\/h4>\n<p>Here are some additional things to think about.<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">SetRoot would have to fail if the root didn\u2019t exist in the current namespace. If SetRoot was explicitly used the parent namespace (..\/<root>) then that tree would be copied to the namespace. If this happened between shards the tree would be serialized into a transaction.<\/root><\/li>\n<li class=\"css-0\">Message\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">All messages are assumed to be async. messages can timeout.<\/li>\n<li class=\"css-0\">Messages all have a response. The response need to be recoded as transaction on requesting shard and the responding shard.<\/li>\n<li class=\"css-0\">Blocks would need two parts; in transaction and out transactions.<\/li>\n<\/ul>\n<\/li>\n<li class=\"css-0\">Capture and delete &#8211; \u00a0The sibling ambient sets a value to a path above another sibling with code for to create an ambient that deletes all of its sub-ambients.\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Solution 1 any action that might affect a sibling ambient must go through its message handler<\/li>\n<li class=\"css-0\">Solution 2 an ambient could define a message handle for all internal message that explicitly disallowed certain types of messages.<\/li>\n<li class=\"css-0\">Solution 3 reintroduce\u00a0capabilities as presented in ambient calculus<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/blog.ethereum.org\/en\/2016\/02\/01\/2458\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part I Sometimes Ethereum is compared to a singleton Virtual Machine. \u00a0While this is correct in some sense; I think it is a bit more. First of all what is a singleton in a distributed system? It is merely a set of values that some threshold of participants have come to consensus on. \u00a0A Virtual [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":18498,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[24],"tags":[],"kronos_expire_date":[],"class_list":["post-18798","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ethereum"],"_links":{"self":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/posts\/18798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/comments?post=18798"}],"version-history":[{"count":0,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/posts\/18798\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/media\/18498"}],"wp:attachment":[{"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/media?parent=18798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/categories?post=18798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/tags?post=18798"},{"taxonomy":"kronos_expire_date","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/kronos_expire_date?post=18798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}