{"id":18840,"date":"2026-03-31T03:38:40","date_gmt":"2026-03-31T03:38:40","guid":{"rendered":"https:\/\/cryptoted.net\/index.php\/2026\/03\/31\/stateful-turing-complete-policies-ethereum-foundation-blog\/"},"modified":"2026-03-31T03:38:40","modified_gmt":"2026-03-31T03:38:40","slug":"stateful-turing-complete-policies-ethereum-foundation-blog","status":"publish","type":"post","link":"https:\/\/cryptoted.net\/index.php\/2026\/03\/31\/stateful-turing-complete-policies-ethereum-foundation-blog\/","title":{"rendered":"Stateful Turing-Complete Policies | Ethereum Foundation Blog"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"\">\n<p class=\"chakra-text css-gi02ar\">One of the major security challenges of the internet over the last twenty years has consistently been the rather simple problem of securing user accounts. Right now, users have accounts with hundreds of websites, and dozens of passwords, leading to <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.pcworld.com\/article\/257045\/6_5m_linkedin_passwords_posted_online_after_apparent_hack.html\">large<\/a> <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.digitaltrends.com\/web\/most-common-hacked-ashley-madison-passwords-revealed\/\">numbers<\/a> of <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.pcworld.com\/article\/257045\/6_5m_linkedin_passwords_posted_online_after_apparent_hack.html\">hacks<\/a> as individual websites, often run by people not particularly skilled in the finer points of cryptography and internet security, find themselves exploited by increasingly clever hackers, and users frequently deal with the complexity of remembering hundreds of passwords by either <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/gizmodo.com\/the-25-most-popular-passwords-of-2014-were-all-doomed-1680596951\">making them simple<\/a> or <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.pcworld.com\/article\/219303\/password_use_very_common_research_shows.html\">making them all the same<\/a> &#8211; with often very <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.itproportal.com\/2013\/05\/29\/hackers-crack-over-16000-passwords-90-cent-success\/\">unfortunate results<\/a>. Over time, a patchwork of ad-hoc solutions has certainly developed, including the use of one&#8217;s email account as a universal backup, and &#8220;password manager&#8221; software like Lastpass, though at high cost: such solutions either retain much of the underlying complexity of password-bsaed access or give centralized companies very high degrees of control over your online life.<\/p>\n<p class=\"chakra-text css-gi02ar\">There are many calls to <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.latimes.com\/business\/technology\/la-fi-tn-yahoo-mail-password-20151014-story.html\">get<\/a> <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/qz.com\/437920\/is-it-time-to-finally-get-rid-of-the-password\/\">rid<\/a> <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.markus-jakobsson.com\/getting-rid-of-passwords-possible-now\">of<\/a> <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/www.engadget.com\/2015\/06\/09\/governments-join-fido-alliance\/\">passwords<\/a>, but the question is: what do we replace them with? There are many ideas, ranging from &#8220;one single password to rule them all&#8221; to smartphone authentication to specialized hardware devices and biometrics and all sorts of multi-factor M-of-N policies, but even these more complex constructions so far have typically been application-specific: many banks now give you a specialized access device to log into your bank account, but if you trust its security you cannot also use it to access your email. In general, we see that the problem of how to best manage user access control and minimize key loss and theft risks is complex enough that it never will be solved &#8220;once and for all&#8221;, and so the best way to solve it is to allow a free market of solutions to flourish and let each user pick which ones work best for them; however, the way to make that actually happen is by <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/www.youtube.com\/watch?v=foEwoWRYIu4\">unbundling<\/a> the &#8220;access control solutions&#8221; market from the &#8220;services&#8221; market. That is to say, exactly what we are to a large extent <em class=\"chakra-text css-0\">not<\/em> doing right now.<\/p>\n<p><center><br \/>\n<img decoding=\"async\" alt=\"\" src=\"https:\/\/blog.ethereum.org\/images\/posts\/2015\/11\/kartenleser-mit-access-card.jpeg\" class=\"chakra-image css-hw6q2r\"\/><br \/>\n<small><br \/>\nThe hardware access device to my UBS bank account. Remind me, why can&#8217;t I also use this to secure my domains on Namecheap?<br \/>\n<\/small><br \/>\n<\/center><\/p>\n<p class=\"chakra-text css-gi02ar\">So how do we do that? The first step is to introduce some well-placed use of the ultimate abstraction: Turing-complete code. Rather than, at the protocol level, allowing users to specify a password, or providing a pre-selected set of providers, or even a standard which relies on talking to a server of the user&#8217;s choice, allow access policies to be specified in code to be executed in a deterministic virtual machine (where the EVM is a good a start as any). Code can include digital signature verifications using <em class=\"chakra-text css-0\">any<\/em> cryptographic algorithm (so you get forward-compatibility with quantum-safe crypto for free), potentially including keys held on the user&#8217;s computer, keys directly derived <a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/2014\/10\/23\/information-theoretic-account-secure-brainwallets\">from a password<\/a>, keys held on a hardware device or any arbitrary policy including any combination of the above. This way, innovation can happen in access-control mechanisms <em class=\"chakra-text css-0\">without any need<\/em> for websites (or other systems requiring authentication) to do anything to accomodate new changes. Additionally, the system neatly allows <em class=\"chakra-text css-0\">organizations<\/em> to use the scheme using multi-person access controls right away, without any further need for integration.<\/p>\n<p class=\"chakra-text css-gi02ar\">The next step is Turing-complete operation-dependent code. For many applications, you want the ability to authorize some users to carry out some operations but not others; for example, you may want to authorize a sysadmin to change the IP address that a domain name points to, but not sell the domain outright. To accomodate this, the abstraction needs to change. A simple &#8220;Turing-complete-code as signature&#8221; setup might have the following form:<\/p>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre><pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>VM<\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">(<\/span><span>code, server-provided nonce ++ signature<\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">)<\/span><span> ?<\/span><span class=\"token\" style=\"color:rgb(127, 219, 202)\">=<\/span><span> <\/span><span class=\"token\" style=\"color:rgb(247, 140, 108)\">1<\/span><span>\n<\/span><\/code><\/pre>\n<\/div>\n<p class=\"chakra-text css-gi02ar\">Where <span class=\"chakra-text css-ons8vw\">VM<\/span> is a virtual machine that runs code, taking a server-provided nonce and a signature as input, and the verification check is to see whether or not the output is 1. A simple example of <span class=\"chakra-text css-ons8vw\">code<\/span> that could be put in is an elliptic curve digital signature verifier. To allow different authorization requirements depending on the operation, you want:<\/p>\n<div class=\"chakra-stack css-1jx0in4\">\n<pre><pre style=\"color:white;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:0.5em 0;overflow:auto;background:#011627\"><code class=\"language-bash\" style=\"color:#d6deeb;font-family:Consolas, Monaco, &quot;Andale Mono&quot;, &quot;Ubuntu Mono&quot;, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none\"><span>VM<\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">(<\/span><span>code, server-provided nonce ++ operation_data ++ signature<\/span><span class=\"token\" style=\"color:rgb(199, 146, 234)\">)<\/span><span> ?<\/span><span class=\"token\" style=\"color:rgb(127, 219, 202)\">=<\/span><span> <\/span><span class=\"token\" style=\"color:rgb(247, 140, 108)\">1<\/span><span>\n<\/span><\/code><\/pre>\n<\/div>\n<p class=\"chakra-text css-gi02ar\">A signature would need to be provided with every operation that the user wants to carry out (this has the benefit of providing definite, third-party-verifiable, proof that an operation was authorized); the operation data (imagine the function name and the arguments encoded in an <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"https:\/\/github.com\/ethereum\/wiki\/wiki\/Ethereum-Contract-ABI\">Ethereum-style ABI<\/a>) would be added as an argument for the virtual machine, and the signature would have to be over both the nonce and the operation data.<\/p>\n<p class=\"chakra-text css-gi02ar\">This gets you quite far, but in some cases not far enough. One simple example is this: what if you want to give someone permission to withdraw small amounts of money but not large amounts, ie. a withdrawal limit? In that case, the problem that you must overcome is simple: what if someone limited by a withdrawal cap of $100 tries to evade it by simply running a script to withdraw $90 over and over again? To solve this, you need a smarter withdrawal limit; essentially, something like &#8220;maximum $100 per day&#8221;. Another natural case is key revocation: if a key gets hacked or lost, you want to replace it, and you want to make sure that the world finds out that your policy was changed so that attackers cannot try to impersonate you under your old policy.<\/p>\n<p class=\"chakra-text css-gi02ar\">To get past this last hump, we need to go one step further: we need Turing-complete operation-dependent <em class=\"chakra-text css-0\">stateful<\/em> policies; that is to say, operations should be able to change the state of the policy. And here is where not just cryptography, but specifically blockchains come in. Of course, you could just have a central server manage the whole thing, and many people are perfectly fine with trusting a central server, but <a class=\"chakra-link css-vezwxf\" href=\"https:\/\/blog.ethereum.org\/2015\/04\/13\/visions-part-1-the-value-of-blockchain-technology\">blockchains are moderately valuable<\/a> here because they are more convenient, provide a credible story of neutrality, and are easier to standardize around. Ultimately, as it would be quite harmful for innovation to permanently choose &#8220;one blockchain to rule them all&#8221;, the thing that we want to standardize is a mechanism by which users can download modules to support <em class=\"chakra-text css-0\">any<\/em> blockchain or centralized solution as they wish.<\/p>\n<p class=\"chakra-text css-gi02ar\">For blockchain-based applications, having a stateful policy enforced right on the blockchain makes natural sense; there is no need to involve yet another special class of intermediaries, and people can start doing it right now. The abstraction of an &#8220;account&#8221; that Ethereum offers makes it extremely easy to work with this approach: if your application works with simple users holding private keys, it also works for just about every kind of individual, multiparty, hardware-driven, military-grade or whatever other policy users will come up with in the future.<\/p>\n<p class=\"chakra-text css-gi02ar\">For other applications, users may want privacy, both in the state-changing operations that they perform and even in the nature of their policy at any one particular time. For this reason, you likely want a solution like <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/oblivm.com\/hawk\">Hawk<\/a>, where the blockchain still ensures the security of the process but, thanks to the wonders of zero-knowledge-proof technology, <em class=\"chakra-text css-0\">knows nothing about what is being secured<\/em>; before Hawk is implemented, simpler forms of cryptography such as ring signatures may suffice.<\/p>\n<h3 class=\"chakra-heading group css-xuzltg\" id=\"other-applications\" data-group=\"true\"><a class=\"chakra-link css-128fqrf\" aria-label=\"other applications permalink\" href=\"#other-applications\"><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>Other Applications<\/h3>\n<p class=\"chakra-text css-gi02ar\">Account security is the first, and most basic, application for the concept of code as policy, there are also others. One simple one is a domain name registry. Onename, one of the popular &#8220;decentralized name registry&#8221; services, is currently planning on implementing a feature where top-level domains can choose fee policies for subdomains based on the number of letters, consonants and vowels. This is useful, but of course economically ugly: there are definitely hundreds of characteristics other than letters, consonants and vowels that can influence a domain name price, and people may even want to experiment with other registration strategies like <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/github.com\/ethereum\/dapp-bin\/tree\/master\/ether_ad\">different types of auctions<\/a>.<\/p>\n<p class=\"chakra-text css-gi02ar\">Once again, an even nicer solution is to apply some simple modularity: let people create their own namespace in stateful Turing-complete code. If you are doing this on a platform where stateful Turing-complete code exists, you can just allow an address to control a subdomain, and then, tada, you support stateful Turing-complete subdomain policies already. This is the essence of object-oriented programming: expose an interface, and allow other objects, which can have arbitrarily complex internal code, satisfy that interface.<\/p>\n<p class=\"chakra-text css-gi02ar\">A further one is private stock trading. Particularly in the case of privately held companies, stock trading is not, and cannot, be completely free and unrestricted the way that trading of cryptocurrencies is; companies often want to have restrictions such as:<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\">Giving employees shares and allowing them to sell them only after some period of time<\/li>\n<li class=\"css-0\">Requiring new shareholders to be approved by existing shareholders, with the possibility of such approvals coming with a cap on how many shares can be owned by that specific holder<\/li>\n<li class=\"css-0\">Forced-buyout procedures<\/li>\n<li class=\"css-0\">Restricting the maximum rate at which stocks are sold (ie. withdrawal limits) or requiring waiting periods or offering specific other holders right of first refusal<\/li>\n<\/ul>\n<p class=\"chakra-text css-gi02ar\">Sure, you can create a private blockchain-based stock trading platform for one client, and provide the restrictions that that one client wants. But what if other clients want different restrictions? You may as well nip the problem in the bud, at least at the &#8220;core application layer&#8221;, and solve it once and for all by&#8230; allowing each individual stock, represented as a sub-currency, to have <a target=\"_blank\" rel=\"noopener\" class=\"chakra-link css-vezwxf\" href=\"http:\/\/github.com\/ethereum\/dapp-bin\/tree\/master\/private_market\">restrictions represented<\/a> as stateful Turing-complete code.<\/p>\n<p class=\"chakra-text css-gi02ar\">This functionality can be represented in the &#8220;token&#8221; API by extending it, for example, as follows:<\/p>\n<ul role=\"list\" class=\"css-1ars4k6\">\n<li class=\"css-0\"><span class=\"chakra-text css-ons8vw\">getMinimumBalance(account)<\/span>: get the minimum balance that an account can hold at the current time<\/li>\n<li class=\"css-0\"><span class=\"chakra-text css-ons8vw\">getMaximumBalance(account)<\/span>: get the maximum balance that an account can hold at the current time<\/li>\n<\/ul>\n<p class=\"chakra-text css-gi02ar\">In short, applications don&#8217;t have policies; applications interact with <em class=\"chakra-text css-0\">objects<\/em> (user accounts, currencies, etc), and objects have policies. Alternatively, even shorter:<\/p>\n<p><center><br \/>\n<img decoding=\"async\" alt=\"\" src=\"https:\/\/i.imgur.com\/u2IZBtj.jpg\" class=\"chakra-image css-hw6q2r\"\/><br \/>\n<\/center><\/p>\n<p class=\"chakra-text css-gi02ar\">Are you building a blockchain-based financial derivatives application, and someone is asking you to add a feature to allow a vote between multiple data feed providers instead of just one? Don&#8217;t even think about it; instead, just set one data feed provider address, and allow users to come up with their own policies; the upside is that whatever code they use or write, they&#8217;ll be able to use to more securely provide data feeds for the arbitration dapp as well. Are you building a DNS system, and someone is asking you to introduce support for specific auction types for subdomains? Don&#8217;t to it at the root DNS level; instead, allow subdomains to be addresses, and allow users to invent their own auction algorithms; whatever algorithms they invent, they&#8217;ll be able to use for their registry for decentralized chat usernames as well.<\/p>\n<p class=\"chakra-text css-gi02ar\">This is the benefit of abstraction: account security policy design can become a self-contained field of study to itself, and whatever new solutions exist can instantly be applied everywhere. Some people will want to trust a third party; others will want to have a multi-signature authorization between five of their own different devices, and some will want a key to themselves with the option for three of five friends to come together to reset the key to a new one. Some will want an access policy where, if they make no transactions within twelve months, they are presumed dead and a lawyer will gain access in order to be able to execute on their will &#8211; for <i>all<\/i> of their digital assets. And some will want a policy which gives one key full control for applications that declare themselves low-security but two of three keys for applications that declare themselves high-security. Name registry pricing policy design can become self-contained as well &#8211; as can digital asset ownership restriction policy, a field that would interest everyone from small and large traditional corporations to community-based DAOs. And that is the power of a stateful Turing-complete code.<\/p>\n<\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/blog.ethereum.org\/en\/2015\/11\/09\/stateful-turing-complete-policies\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the major security challenges of the internet over the last twenty years has consistently been the rather simple problem of securing user accounts. Right now, users have accounts with hundreds of websites, and dozens of passwords, leading to large numbers of hacks as individual websites, often run by people not particularly skilled in [&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-18840","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\/18840","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=18840"}],"version-history":[{"count":0,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/posts\/18840\/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=18840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/categories?post=18840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/tags?post=18840"},{"taxonomy":"kronos_expire_date","embeddable":true,"href":"https:\/\/cryptoted.net\/index.php\/wp-json\/wp\/v2\/kronos_expire_date?post=18840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}