<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Eryx - Medium]]></title>
        <description><![CDATA[Potenciamos con tecnología - Medium]]></description>
        <link>https://medium.com/eryxcoop?source=rss----c873b442fd8f---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Eryx - Medium</title>
            <link>https://medium.com/eryxcoop?source=rss----c873b442fd8f---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 17:18:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/eryxcoop" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bringing Zero-Knowledge Capabilities to Cardano]]></title>
            <link>https://medium.com/eryxcoop/at-eryx-we-believe-zero-knowledge-technology-is-becoming-a-foundational-layer-for-the-future-of-194b14916fe4?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/194b14916fe4</guid>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cardano]]></category>
            <dc:creator><![CDATA[Aclaramut]]></dc:creator>
            <pubDate>Tue, 26 May 2026 18:30:59 GMT</pubDate>
            <atom:updated>2026-05-26T18:32:17.618Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iE8ePIbf6XHAHBEB5gLP1w.png" /></figure><p>At Eryx, we believe zero-knowledge technology is becoming a foundational layer for the future of blockchain — and Cardano should be part of that future.</p><p>Today, building ZK applications on Cardano is still harder than it should be. Experienced ZK teams often face missing infrastructure that must be built from scratch. And for developers who are not ZK specialists, the barrier is much higher: the tools are complex, the workflows are unfamiliar, and there are not enough reusable components to make ZK feel accessible.</p><p>But it should not be that way.</p><p>If Cardano wants to support private voting, anonymous credentials, ZK-based DeFi, verifiable off-chain computation, and other next-generation applications, builders need reusable open-source tools they can rely on.</p><p>ZK should become accessible infrastructure: powerful enough for cryptographers, but simple enough for Cardano builders to use.</p><p>That is what we want to help build for Cardano. Open, practical ZK capabilities that lower the barrier for developers and make it possible for better, more private, and more useful applications to reach real users.</p><h3>Key infrastructure</h3><p>The proposal includes four open-source components:</p><p><strong>A PLONK verifier in Aiken<br></strong>PLONK is a widely used zero-knowledge proving system. By implementing a SnarkJS-compatible verifier in Aiken, Cardano smart contracts will be able to verify proofs generated with common ZK tools like Circom and SnarkJS.</p><p>This makes it possible to move sensitive or expensive logic off-chain and prove the result on Cardano. Developers could use it for anonymous credentials, ZK-based DeFi, compliance proofs, or applications where users need to prove something without revealing everything behind it.</p><p><strong>RISC Zero integration for Cardano<br></strong>RISC Zero is a zkVM: a tool that lets developers prove that a program was executed correctly, without running the whole program on-chain. In practice, this means complex logic can happen off-chain, while Cardano only verifies a small proof of the result. It also adds privacy: the computation itself can remain hidden, while only the final result and its validity are revealed.</p><p>This would make it easier to build scalable and private applications on Cardano, from verifiable computation and complex DeFi logic to privacy-preserving workflows and cross-chain systems — using regular programming languages instead of requiring every team to manually design specialized cryptographic proofs.</p><p>It could also make existing RISC Zero-based tools relevant to Cardano. For example, Zeth uses RISC Zero to prove that Ethereum blocks were executed correctly. If Cardano can verify RISC Zero proofs, Cardano applications could eventually read and trust Ethereum activity through proofs instead of relying on third parties. In simple terms, this could help Cardano become more interoperable with Ethereum, enabling cross-chain state verification and future zk-powered bridge infrastructure.</p><p><strong>Aiken-ZK library extensions<br></strong>We have already developed<em> aiken-zk</em>, a tool that helps Aiken developers integrate ZK proof verification into validators without needing to be ZK experts.</p><p>This proposal will make it production-ready: easier to install, easier to use, better documented, more reliable, and friendlier to <strong>AI-assisted development workflows</strong>. The goal is to make ZK feel less like specialized cryptography work and more like a practical tool that regular Cardano developers can use.</p><p><strong>Semaphore V4 for Cardano<br></strong>Semaphore is a private signaling protocol: it lets users prove group membership and send a valid signal without revealing their identity.</p><p>This primitive has already been used in large-scale identity systems such as Worldcoin / World ID, where zero-knowledge proofs help users prove uniqueness or eligibility without linking each action back to their identity.</p><p>Bringing Semaphore to Cardano would make similar privacy-preserving patterns available to Cardano applications: private voting, anonymous feedback, membership proofs, sybil-resistant coordination, and governance tools.</p><p>We will adapt Semaphore to Cardano and implement the Aiken validators needed so developers can use it as a reusable privacy building block.</p><h3>Unlock new capabilities</h3><p>With these components, Cardano developers will be able to build applications that are currently difficult or impossible to implement: private governance, ZK-based DeFi, anonymous identity systems, verifiable off-chain computation, and privacy-preserving user flows.</p><p>For users, this means more privacy and better applications.<br>For developers, it means better tools and fewer barriers.<br>For Cardano, it means a stronger foundation for the next generation of decentralized applications.</p><h3>The future</h3><p>The goal is simple: make zero-knowledge technology practical, reusable, and accessible for the Cardano ecosystem. ZK should not remain a distant research promise — it should become part of the everyday toolkit for building on Cardano.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=194b14916fe4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/at-eryx-we-believe-zero-knowledge-technology-is-becoming-a-foundational-layer-for-the-future-of-194b14916fe4">Bringing Zero-Knowledge Capabilities to Cardano</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[zkLogin: Zero-Knowledge Authentication with Web2 Credentials on Cardano]]></title>
            <link>https://medium.com/eryxcoop/zklogin-zero-knowledge-authentication-with-web2-credentials-on-cardano-fc2735e6e9f5?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc2735e6e9f5</guid>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[circom]]></category>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cardano]]></category>
            <dc:creator><![CDATA[Bruno Weisz]]></dc:creator>
            <pubDate>Mon, 30 Mar 2026 18:27:53 GMT</pubDate>
            <atom:updated>2026-03-30T18:27:51.778Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XyOQnEW9pePR5FABFW-FWQ.png" /></figure><p>Managing a crypto wallet has always required users to either <strong>safeguard a seed phrase</strong> or <strong>trust a third party</strong> to do it for them. The first option can easily lead to permanently lost funds, while the second means giving up control to an external service that could be compromised or corrupted. But <strong>what if you could access your Cardano wallet with your Google account</strong>, the same way you log into your favorite app,, without ever giving up control of your funds or even exposing your identity? That’s exactly what <strong>zkLogin</strong> protocol is for.</p><h4>OpenId: the key to web2 authentication</h4><p>Before getting into zkLogin itself, is useful to understand one of the most widely used authentication protocols on the internet today: <strong>OpenID Connect</strong>. Chances are you have used it without even knowing it. It’s the technology behind that familiar “Sign in with Google” button that pops up when you try to log into a new app or website. Instead of creating yet another username and password, OpenID lets a trusted provider like Google confirm your identity to a third party application. Conveniently, it&#39;s something most internet users interact with daily, and the base over which we implemented the zkLogin protocol in Cardano.</p><h4>The zkLogin protocol</h4><p>The core idea is simple: instead of managing a private key or trusting a third party with your funds, <strong>you authenticate with your Google account and your wallet is unlocked</strong>. But making this work on a blockchain, securely and privately, is far from trivial. Let’s break down how it actually works.</p><p>At this point you might be wondering: if your Google account is used to access your wallet, doesn’t that mean anyone watching the blockchain can link your Google identity to your Cardano address? This is exactly the problem that zero-knowledge proofs solve. A <strong>zero-knowledge proof</strong> is a cryptographic technique that allows someone to prove they know something without revealing what that something is. In the context of zkLogin, it allows the protocol to prove that a valid Google login was used to authorize a transaction, without putting any of your Google credentials on the blockchain. Nobody watching the chain can tell which Google account controls a given address.</p><p>Note that when we say “your wallet is unlocked” is an abstraction of what actually happens. There’s a lot of detail that you can find in the <a href="https://github.com/eryxcoop/zklogin-aiken/blob/main/report/report.pdf">technical report</a>, if the reader wants to dig deeper.</p><h4>How is zkLogin secure?</h4><p>One of the most important aspects of zkLogin is how it handles trust. The protocol is designed in a way that no single external party ever has enough information to act on your behalf. Think of it as a puzzle where each piece is held by a different actor, and no single actor holds enough pieces to complete it.</p><p>Google knows your identity but has no knowledge of your salt or your Cardano address. The <strong>salt</strong> is a private value that creates an extra layer of separation between your Google identity and your on-chain address. It needs to be stored somewhere, and zkLogin is flexible about this: it can be managed by the user directly, like stored securely on their device, or delegated to an external salt service, a server that stores your salt and retrieves it when needed. Crucially, the salt service only ever sees the salt and nothing else, so even if it were compromised, an attacker would still be missing all the other pieces. And vice versa: even if someone had access to your Google credentials, without the salt they could not derive your wallet address.</p><p>The proof generation service, which does the heavy cryptographic operations, never sees the private key used to sign your transactions. Besides, the user has the option to perform those operations locally. The session credentials live exclusively on the user’s device and expire automatically: the protocol doesn’t enforce the wallet to have a backend server that could be compromised, everything can happen in the user’s device.</p><p>This means that even in a worst case scenario where one of these services is compromised, an attacker still cannot take control of your funds. This is a fundamentally different security model from both traditional self-custody wallets, where losing your private key means losing everything, and custodial wallets, where a compromised third party means the same.</p><h4>Where does zkLogin come from?</h4><p>zkLogin was originally designed and deployed on the SUI blockchain, where it is embedded directly into the core protocol. This means SUI nodes natively understand and verify zkLogin proofs as part of the transaction validation process. Cardano, on the other hand, does not have this kind of native support, and changing the core protocol to add it was not the direction we wanted to take.</p><p>Instead, we found a way to implement zkLogin entirely on top of Cardano’s existing infrastructure. The key insight was to embed the user’s identity into a smart contract, called a validator in Cardano, and use that contract’s address as the user’s wallet address. The zero-knowledge proof verification happens inside this validator, requiring no changes to the Cardano protocol itself, which makes it significantly more practical to deploy and adopt.</p><h4>What should we do next?</h4><p>The current implementation of zkLogin for Cardano covers the full end-to-end authentication flow and sending and receiving transactions with zkLogin addresses, but there is a lot of room to grow. One natural next step is supporting additional OpenID providers beyond Google, such as Apple, Microsoft or GitHub, which would make zkLogin accessible to a much broader audience, and more importantly, let each person choose the provider they already trust.</p><p>Another important future contribution is making zkLogin addresses wallet-independent. In the current design, the user’s address is tied to the specific wallet or application they used to create it. Slight modifications in the protocol could decouple the address from the wallet, so that users can access their funds from any compatible application without being locked into a single provider.</p><p>There is also the question of staking. Cardano allows ADA holders to delegate their funds to stake pools and earn rewards, but the current zkLogin address structure makes this complicated. Future versions of the protocol aim to solve this, allowing zkLogin users to participate in staking just like any other Cardano user, without giving up the privacy and security guarantees that zkLogin provides.</p><p>Finally, OpenID providers periodically rotate their public keys for security reasons. The protocol needs to handle these rotations gracefully so that long-lived wallets remain functional without requiring any action from the user.</p><h4>Conclusion</h4><p>zkLogin represents a meaningful step forward for the Cardano ecosystem. By combining the familiarity of Web2 authentication with the security and privacy guarantees of zero-knowledge cryptography, it opens the door to a new kind of user experience.</p><p>The barrier to entry for Web3 has always been high. Seed phrases, private keys and custodial trade-offs have kept many potential users on the sidelines. zkLogin doesn’t eliminate all of those challenges overnight, but it offers a concrete and privacy-preserving alternative that feels familiar from day one.</p><h4>Useful Links</h4><p><a href="https://github.com/eryxcoop/zklogin-aiken">zkLogin in Cardano repository</a></p><p><a href="https://eryx.co/">Eryx website</a></p><p><a href="http://crypto.eryx.co/">Eryx crypto website</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc2735e6e9f5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/zklogin-zero-knowledge-authentication-with-web2-credentials-on-cardano-fc2735e6e9f5">zkLogin: Zero-Knowledge Authentication with Web2 Credentials on Cardano</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Appyx Comm: un posible modelo para las interacciones frontend-backend]]></title>
            <link>https://medium.com/eryxcoop/appyx-comm-un-posible-modelo-para-las-interacciones-frontend-backend-6dad57840d7f?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/6dad57840d7f</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Julian Diaz]]></dc:creator>
            <pubDate>Wed, 24 Sep 2025 15:31:25 GMT</pubDate>
            <atom:updated>2025-09-24T15:31:12.103Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Obu6pDEkdRB_4vYO6HleQQ.png" /></figure><h3>Introducción</h3><p>En la actualidad, donde predominan los sistemas web y mobile, un problema recurrente que tenemos que resolver los desarrolladores es realizar peticiones desde el frontend hacia el backend. Este problema consiste en saber a donde realizar estas peticiones (url), de qué forma hacerlas y de qué manera interpretar las posibles respuestas. Estas respuestas van a tener un formato específico dependiendo del servicio al cual le realizamos la petición. Además, nos vamos a encontrar con que el servicio nos devuelva distintos tipos de errores, por ejemplo, un error interno (500) o un error por una petición inválida (400), y queramos comunicarle lo ocurrido al usuario de nuestro sistema.</p><p>A partir de una <a href="https://aws.amazon.com/es/what-is/restful-api/#:~:text=La%20API%20RESTful%20es%20una,llevar%20a%20cabo%20varias%20tareas.">API Rest</a> de ejemplo, mostraremos como nuestra biblioteca <a href="https://eryxcoop.github.io/appyx-comm/">Appyx Comm</a> viene a resolver este problema. Para ello, usaremos como ejemplo una posible petición a la API, contando las ventajas y deudas pendientes de la solución propuesta. Estos problemas son intrínsecos al desarrollo web e independientes del lenguaje, aunque hoy en día predomina el uso de Javascript. Por este motivo, es el lenguaje utilizado en la biblioteca y en este artículo.</p><h3>Peticiones a un servicio</h3><p>A continuación, vamos a presentar una forma simple y clara de cómo modelar las peticiones que debemos hacer, por ejemplo, desde un frontend a un servicio (backend). Para ello, vamos a utilizar como ejemplo la obtención de las provincias argentinas desde un servicio gubernamental existente llamado <a href="https://datosgobar.github.io/georef-ar-api/">Georef</a>.</p><p>Para poder interactuar con un servicio lo primero que debemos hacer es resolver a qué URL tenemos que realizar la petición, definir el método de la misma, qué parámetros tenemos que enviarle y cual es el formato de la respuesta. En nuestro ejemplo, para obtener el listado de provincias tenemos que realizar una petición GET a la URL <a href="https://apis.datos.gob.ar/georef/api/provincias?orden=nombre&amp;max=10">https://apis.datos.gob.ar/georef/api/provincias</a>.</p><p>Para ello, proponemos representar y organizar esta información mediante un objeto que represente cómo realizar una petición. A este objeto lo llamamos endpoint, en nuestro ejemplo <em>ObtenerProvinciasEndpoint</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s7ZoNQ4DbcYUNAwgTigSsQ.png" /></figure><p>Cabe mencionar que para poder interactuar con un servicio muchas veces debemos autenticarnos, si bien nuestro objetos endpoints tienen soporte para ello, por una cuestión de simplicidad no ahondaremos en detalles sobre cómo resolvimos este punto.</p><p>Podemos ver que el endpoint tiene definido en <em>ownResponses</em> las posibles respuestas que obtendremos al realizar la petición al mismo. Se devuelve una instancia de <em>ApiErrorResponse</em> en el caso en el que el servidor responda con un error, lo cual nos permitirá saber fácilmente si la petición falló y cuáles fueron los errores. Para saber qué clase de respuesta se debe instanciar, cada una de ellas implementa un método <em>understandThis</em>, el cual determina si corresponde instanciar dicha clase para la respuesta obtenida. En este caso, el <em>understandThis</em> se implementa en la superclase porque es un comportamiento común a las respuestas exitosas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YVutTn4BNhmmwCHOQV-U1w.png" /></figure><p>Una vez que sabemos de qué forma hacer una petición y qué respuestas podemos esperar del servicio en cuestión, nos queda efectivamente implementarla. Para organizar las peticiones a nuestro servicio decidimos crear un objeto que llamamos <em>Client</em> o <em>Interlocutor</em>, en el cual centralizamos todos los endpoints definiendo un método para cada petición. Estos métodos conocen a cada instancia de los endpoint con los cuales interactuamos y, como vimos, definen el servicio al cual se realizará la petición. Siguiendo con nuestro ejemplo, el código del <em>Client</em> con su respectivo método para obtener las provincias nos quedaría de la siguiente manera:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eFyp9SmlpnHMOOHP" /></figure><p>El método <em>_callEndpoint</em> que vemos en el código se encarga de comunicarse con un objeto llamado <em>Requester</em>, responsable de realizar el fetch luego de construir la petición HTTP a partir de los datos provistos por el endpoint. Un detalle interesante de este objeto es que permite ser intercambiado por otro que simula las peticiones y devuelve respuestas predefinidas en el método <em>_defaultResponse</em> del endpoint. Esta flexibilidad de la biblioteca puede ser aprovechada para realizar tests o pruebas de QA sin depender de la API. Además, este requester realiza peticiones usando la biblioteca fetch, pero podría ser intercambiada por cualquier otra.</p><p>Una vez realizada la petición, el <em>Client</em> nos devolverá una promise que, de satisfacerse, nos permitirá obtener la respuesta del servicio que definimos anteriormente en el endpoint (alguna instancia de <em>ProvinciasSuccessfulResponse</em> o <em>ApiErrorResponse</em>), y a partir de ella obtener las provincias. A modo de ejemplo, podemos ver un caso de uso muy sencillo en un método render de un componente React en el cual renderizamos de cierta forma el caso exitoso y de otra el caso de error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CpSpw78SofBoG8f9" /></figure><h3>Conclusiones</h3><p>La motivación para crear esta biblioteca fue hacer explícito e intuitivo el manejo de las peticiones a un servicio. Como comentamos, al implementar una determinada petición se resuelven siempre cosas similares. Buscamos que con el modelo los pasos a seguir sean autoexplicativos y, por lo tanto, que nos guíen en la solución. Esto lo logramos al reificar las entidades que interactúan entre sí, además de ordenar el conocimiento y mejorar la legibilidad de nuestro código.</p><p>Con este fin, modelamos algunas clases a partir de las cuales subclasificamos, como es el caso de los endpoints y de las responses, donde organizamos el conocimiento sobre estas entidades. Dicha jerarquía nos sirve como documentación para saber qué necesitamos definir y en dónde, concentrándonos en lo importante sin tener que reinventar la rueda constantemente.</p><p>En este artículo no abordamos el análisis sobre el manejo de los errores ni como nuestra solución resuelve este caso recurrente. Quienes quieran ver con mayor detalle el modelo de objetos que proponemos, así como este último punto, pueden acceder al <a href="https://eryxcoop.github.io/appyx-comm/">repositorio</a> y a la <a href="https://blog.eryx.co/appyx-comm/">documentación</a> oficial.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dad57840d7f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/appyx-comm-un-posible-modelo-para-las-interacciones-frontend-backend-6dad57840d7f">Appyx Comm: un posible modelo para las interacciones frontend-backend</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aiken-zk tutorial]]></title>
            <link>https://medium.com/eryxcoop/aiken-zk-tutorial-d11b440a7d1a?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/d11b440a7d1a</guid>
            <category><![CDATA[cardano]]></category>
            <category><![CDATA[aiken]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Bruno Weisz]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 15:13:21 GMT</pubDate>
            <atom:updated>2025-09-18T15:13:16.258Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lc7wbm3mGmIVJZoNZ1xZNg.png" /></figure><p>In this post we’re going to cover all the workflow of deploying an aiken contract in a Cardano network, allowing the usage of <em>offchain</em> computation. We’ll use zero knowledge proofs to implement this, with our custom tool: <strong>Aiken-zk</strong>. We’re going to go through a toy use case, but that reflects all the important things you need to know to use our tool to the next level.</p><p>This tool was developed in the context of the <a href="https://projectcatalyst.io/funds/13/cardano-open-developers/designing-an-api-for-zk-snark-proof-verification-in-aiken-eryx">Designing an API for ZK-Snark proof verification in Aiken</a> grant of the Catalyst13 fund. It’s built on top of the <a href="https://aiken-lang.org/">Aiken language</a>, acting as a pre-compilation phase of the Aiken code. Besides, it provides extra tools programmers can use to generate proofs and deploy the validators.</p><p>Aiken-zk allows you to use public pre-made functions (like adding two numbers, multiplying, subtracting, computing fibonacci, merkle tree verification, hash functions, etc.) but also allows you to define your own functions using <a href="https://docs.circom.io/background/background/">Circom</a>. In this tutorial we will cover both paths, starting with a custom use case: <em>check that the first element of a list is certain number</em>.</p><p>This tutorial is meant for you to follow along, so let’s get started!</p><p>First, go to our <a href="https://github.com/eryxcoop/cardano-zk-aiken">repository</a>, clone the project, then go to the README and install the listed dependencies, following the linked instructions. The dependencies include Rust, Node, npm, snark.js, Circom and Aiken. Right after that you need to install aiken-zk: go inside the aiken-zk sub-folder and run from your terminal cargo install --path . (point included). This will install aiken-zk globally. Now that you installed everything, it’s time to start building!</p><p>Go to any directory you want your project on and run aiken-zk new my_project. If everything goes fine this will create a sub-folder called my_project . Go inside that folder, and you will notice a specific folder structure.</p><pre>.<br>├── aiken.toml<br>├── ceremony.ptau<br>├── circuit_inputs<br>├── curve_compress<br>├── deployment<br>├── templates<br>├── validators<br>└── validators_with_offchain</pre><h4>Custom circuit using Circom</h4><p>The first thing you need to do is creating the custom circom file. Create a file in the root called compare_head.circom and copy the following content:</p><pre>pragma circom 2.1.9;<br><br>template Indexing() {<br>    signal input l[2];<br>    signal input val;<br>    l[0] === val;<br>}<br>component main {public [l, val]} = Indexing();</pre><p>Is a simple code: it recieves 2 input signals (one of which is a list with 2 elements) and checks that the first element in that list equals the other input. In this case, both inputs are public. When we’re working with custom circuits in aiken-zk keep in mind that you should allways define the main component. Don’t worry about the inputs for that circuit, we’ll talk about them later.</p><h4>Aiken code with “offchain” computation</h4><p>The next step is to reference the circom file within our aiken code. For that we first need an Aiken code. We’ll create a file inside the validators_with_offchain directory, let’s call it compare_head.ak . Then, copy the following into the file:</p><pre>use cardano/transaction.{OutputReference, Transaction,}<br>pub type ZK&lt;redeemer_type&gt; {<br>  redeemer: redeemer_type,<br>  proofs: List&lt;Proof&gt;,<br>}<br>type Redeemer = Void<br>validator example {<br>  spend(<br>    _datum: Option&lt;Void&gt;,<br>    redeemer: ZK&lt;Redeemer&gt;,<br>    _own_ref: OutputReference,<br>    _self: Transaction,<br>  ) {<br>    let l = [1,2]<br>    let val = 1<br>    expect _redeemer = offchain custom(&quot;compare_head.circom&quot;, [@l, val])<br>    True<br>  }<br>  else(_) {<br>    fail<br>  }<br>}<br>test test_example() {<br>  let proof: Proof = Proof {<br>                      piA: &quot;complete with generated piA&quot;,<br>                      piB: &quot;complete with generated piB&quot;,<br>                      piC: &quot;complete with generated piC&quot;,<br>                     }<br>  test_proof_is_valid(proof)<br>}<br>fn test_proof_is_valid(proof: Proof) -&gt; Bool {<br>  let utxo_reference = OutputReference { transaction_id: &quot;&quot;, output_index: 0 }<br>  example.spend(<br>    Some(Void),<br>    ZK { redeemer: Void, proofs: [proof] },<br>    utxo_reference,<br>    Transaction { ..transaction.placeholder, inputs: [], outputs: [] },<br>  )<br>}</pre><p>Notice that the expression</p><pre>offchain custom(&quot;compare_head.circom&quot;, [@l, val])</pre><p>is not valid Aiken code. When we’re using custom circom circuits, from the Aiken source code we should provide a list with all the <strong>public</strong> inputs only. These public inputs can only be simple variables or numeric literals.</p><p>Notice that we’re using an extra @to indicate that the variable lis, in fact, a variable containing a list. We’re not using this in the variable valsince it’s a single number. In general, you should make sure that the amount of public inputs in the aiken file matches with the amount in the main circom component. Also, as a side note, don’t change the name of the redeemer variable.</p><p>However, before being compiled by Aiken itself, it should be pre-compiled by our tool, aiken-zk. aiken-zk will transform the previous code in valid Aiken code, inserting a validation script for the referenced circuit. To do that, run the command</p><p>aiken-zk build validators_with_offchain/compare_head.ak validators/compare_head_final.ak</p><p>This will create a new aiken file in validators/compare_head_final.ak which has an embedded Groth16 verification key for the circom code we defined in compare_head.circom (and is also valid Aiken code).</p><p>It should look something like</p><pre>use aiken/collection/list<br>use ak_381/groth16.{Proof, SnarkVerificationKey, groth_verify}<br>use cardano/transaction.{OutputReference, Transaction,}<br><br>pub type ZK&lt;redeemer_type&gt; {<br>  redeemer: redeemer_type,<br>  proofs: List&lt;Proof&gt;,<br>}<br>type Redeemer = Void<br>validator example {<br>  spend(<br>    _datum: Option&lt;Void&gt;,<br>    redeemer: ZK&lt;Redeemer&gt;,<br>    _own_ref: OutputReference,<br>    _self: Transaction,<br>  ) {<br>    let l = [1,2]<br>    let val = 1<br>    expect _redeemer = zk_verify_or_fail(redeemer, [Many(l), Single(val)])<br>    True<br>  }<br>  else(_) {<br>    fail<br>  }<br>}<br>fn zk_verify_or_fail(<br>        zk_redeemer: ZK&lt;Redeemer&gt;,<br>        public_inputs: List&lt;ZKInputType&gt;<br>    ) -&gt; ZK&lt;Redeemer&gt; {<br>        let vk: SnarkVerificationKey =<br>            SnarkVerificationKey {<br>                nPublic: 2,<br>                vkAlpha: #&quot;85e3f8a13a670514351a68677ea0e2fc51150daeea496b85a34d97751695e26b2ae4f1a5a3b60e17bb7bfd6d474154c5&quot;,<br>                vkBeta: #&quot;b1abf58f58af5981cd24f996e53626a4157eeed4aa814498885b3a547c35d5efb877834602508255c030708552b353e21631f16475e35b977e39a068ac9fb5bc4c25d383139b721da0a878b663c4df52c94a51f7c06a019bb40324713d2bbf0f&quot;,<br>                vkGamma: #&quot;93e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8&quot;,<br>                vkDelta: #&quot;b824005d651bf6d38362f30967f78a33381fde734ebd5687265d2b250f54aa5b10860c1e0cd522e375a7f04178efe69c0747d9ee650176e8376346111c82fd997c3b16604ef241edd84843e9d84a3fd3833bcb2308b5ce4dfa9f465b18dbec7c&quot;,<br>                vkAlphaBeta: [],<br>                vkIC: [<br>                #&quot;b42a4610c5c2722df0cae5b696d0e212dd41e471a5246217751ae313dceba2b4d25c1be296ee8e00454027b7c4a45208&quot;,<br>                #&quot;8027291e03baad211b040544b6f4b1dc08b0bcb3228f2454df242b16bd485f49ac7d2a7775e19984bb063c5659b6fd87&quot;,<br>                #&quot;8cd46f20c5538bb855c3747d45239aea4f5c7d8cf296e72ff926aa63532cd21e616d7e71b3e11712abdb0adc588fc369&quot;,<br>                #&quot;92860410fedf7cd20ac120951b318150bf82a8b4802a03120cd0ce2bd61c849d86ddfd29feb157b3a0af9be601eadab9&quot;,<br>                ],<br>            }<br>        expect Some(proof) = list.head(zk_redeemer.proofs)<br>        let flattened_public_inputs: List&lt;Int&gt; = list.flat_map(public_inputs, fn(item) {<br>            when item is {<br>              Single(x) -&gt; [x]<br>              Many(xs) -&gt; xs<br>            }<br>        })<br>        if !groth_verify(vk, proof, flattened_public_inputs) {<br>          fail<br>          Void<br>        } else {<br>          Void<br>        }<br>        expect Some(proofs) = list.tail(zk_redeemer.proofs)<br>        ZK { redeemer: zk_redeemer.redeemer, proofs }<br>    }</pre><p>There’s a lot to unwrap here, so let’s go in order. The first thing to notice is that the previous line</p><pre>offchain custom(&quot;compare_head.circom&quot;, [@l, val])</pre><p>was replaced by a valid Aiken line</p><pre>zk_verify_or_fail(redeemer, [Many(l), Single(val)])</pre><p>The last line is calling to an automatically created function which verifies the computation using a Groth16 verification key. All the weird numbers you’re seeing in the new code are the elliptic curve points that make the Groth16 Verification Key.</p><h4>Building with Aiken</h4><p>Now we’re going to use the original Aiken compiler to build the automatically generated code. For this, you just need to run aiken build<br>without changing your directory (meaning, in the same directory that the aiken.tomlfile is located, which should be the same one that contains the validatorsdirectory). If the build is successfull, we can move to the next steps.</p><h4>Generating the proof</h4><p>Now we want to generate a proof of execution to test our tool before deploying anything (we don’w want to lock funds that we may never unlock again). If you know something about zero knowledge provers, you also should know that a proof of execution requires that the user provide specific inputs, so we’re gonna save them into a new file. Let’s create a circuit_inputs/input_compare_head.json file with the contents</p><pre>{<br> “l”: [1, 2],<br> “val”: 1<br>}</pre><p>These values will be used to generate the proof of the circom circuit, and the public ones must match with the values provided in aiken. In this case we don’t have any private parameters, but if there were, their values should also be placed here. These values will be used to resolve the Groth16 witnesses and ultimately generate the proof.</p><h4>Aiken testing</h4><p>Execute the following command to generate the proof to use in the Aiken test:</p><p>aiken-zk prove aiken compare_head.circom verification_key.zkey circuit_inputs/input_compare_head.json proof.ak</p><p>You should replace the generated proof on the Aiken test. This means that you should copy the contents of proof.ak into the test_example method of validators/compare_head_final.ak, replacing the placeholders. After that, run</p><pre>aiken check</pre><p>to verify that the test is passing.</p><h4>Locking and unlocking funds with MeshJS</h4><p>Now that you’ve your aiken code built and you know the proof is working as expected, you can enter to the deploymentsubdirectory to deploy the validator to the Preview Network. We will lock and unlock 1 ADA, using the verification of the proof as a condition for unlocking.</p><p>But first, you should have an address with its private key to interact with the blockchain. We’re using Mesh.js, so let’s see how we can do this.</p><h4>Using an address to deploy into preview testnet</h4><p>First, go to the deployment directory and run</p><pre>npx tsx generate-credentials.ts</pre><p>This will create 2 files in that directory: me.sk and me.addr , the secret key and its corresponding addres. You should give funds to that address through a <a href="https://docs.cardano.org/cardano-testnets/tools/faucet">faucet</a>. Lastly, you should create a <a href="https://blockfrost.io/">Blockfrost</a> account and project, which should give you an unique BLOCKFROST_PROJECT_ID . In your terminal, run</p><pre>export BLOCKFROST_PROJECT_ID=&lt;your_blockfrost_project_id&gt;</pre><p>and you’re ready to continue the tutorial.</p><h4>Locking funds</h4><p>Let’s start by running the following command to lock 1 ADA, that will only be unlocked when the proof verifies on-chain:</p><pre>npx tsx lock_complex_token.ts</pre><p>It can happen sometimes that you must run this command a few times until it works, for network reasons. If everything goes as expected, you should see a message like</p><pre>1 tADA locked into the contract at Tx ID: &lt;transaction-hash&gt;</pre><p>Save the transaction hash for the next step: you will need it to unlock the funds. Then, go back to the root directory.</p><h4>Unlocking funds</h4><p>Time to unlock. Run the following command to generate the typescript library that contains the proof:</p><pre>aiken-zk prove meshjs custom_circuits/compare_head.circom <br>verification_key.zkey circuit_inputs/inputs_compare_head.json <br>deployment/zk_redeemer.ts</pre><p>This will generate a proof and wrap it in some typescript code so it’s easy to use in the unlocking script. Go to deployment/unlock_complex_token.ts and import the just generated typescript code. In other words, add the following line at the top:</p><pre>import {mZKRedeemer} from “./zk_redeemer”;</pre><p>In general, this function should be imported anywhere you want to use the spendfunction, in case you’re not using our example code. Use the imported function to wrap the redeemer. The spend should change from</p><pre>await contract.spend(validatorScriptIndex, txHashFromDeposit, mVoid());</pre><p>to</p><pre>await contract.spend(validatorScriptIndex, txHashFromDeposit, mZKRedeemer(mVoid()))</pre><p>Finally, unlock the contract running the following command. Replace `lockTxHash` with the hash that you copied in the lock step:</p><pre>npx tsx unlock_complex_token.ts lockTxHash</pre><p>It can happen sometimes that you must run this command a few times until it works</p><p>If everything went as planned, the address you used should’ve recovered the locked ADA, seeing a message like</p><pre>1 tADA unlocked from the contract at Tx ID: &lt;transaction-hash&gt;</pre><h4>Using an example circuit instead of a custom</h4><p>The steps to use one of our example circuits instead of a custom Circom circuit are very similar. The main difference is that you should not create a xx.circom file in the root, but it will be rather be automatically generated by aiken-zk in the root of the project under the name output.circom after the execution of the build command. The syntax for the example functions can be found in the readme of the <a href="https://github.com/eryxcoop/cardano-zk-aiken">repository</a>.</p><p>The main difference is that the parameters of the functions are fixed, so the compiler knows how many are there and if they’re lists or not. You also have to fill all the inputs, even if they are private. Let’s see an example with addition:</p><pre>offchain addition(priv, priv, 7)</pre><p>In that example, we’re saying that “we know two numbers that add up to 7” without revealing those two numbers. The values of those numbers should be filled as inputs to the proof generation, but they will never be public.</p><p>Another example could be</p><pre>offchain sha256(128, priv, out)</pre><p>where we’re saying that we will pass an input of 128 bits, not reveal that input, and the output will equal the contents of the out variable. Note that we didn’t need to include the @ for the second and third argument this time since the function already knows what kinds of parameters it receives.</p><h3>Conclusions</h3><p>We’ve seen a full workflow of how <strong>aiken-zk</strong> works. It’s a tool built on top of aiken and has many dependencies that you should be aware of. Zero Knowledge in general has to be very precise to work so don’t get frustrated if you got stuck at some point in the tutorial.</p><p>We did our best to abstract the most dark parts of this, but there’s always work to be done to simplify the life of programmers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d11b440a7d1a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/aiken-zk-tutorial-d11b440a7d1a">Aiken-zk tutorial</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MCP for AI Cardano Explorer Assistants]]></title>
            <link>https://medium.com/eryxcoop/mcp-for-ai-cardano-explorer-assistants-f89bbd7e7933?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/f89bbd7e7933</guid>
            <category><![CDATA[cardano]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[mcp-protocol]]></category>
            <category><![CDATA[criptography]]></category>
            <dc:creator><![CDATA[Frodriguez]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 19:23:51 GMT</pubDate>
            <atom:updated>2025-09-17T19:23:37.069Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15_5_zMbigs_t0kBD0xBjg.png" /></figure><p>Co-authored with <a href="https://medium.com/u/b511cf3ae2fd">Julian Ezequiel Arnesino</a></p><p>At Eryx, we’ve been thinking about how to make Cardano easier to explore for newcomers. The Cardano blockchain, while powerful, is still a new and evolving technology. Resources are scattered or incompletely documented, making them difficult to understand and use (especially without prior experience).</p><p>What if there was an assistant that could guide you through Cardano? Our AI-driven explorer assistant would act as a user-friendly guide into the Cardano world, offering clear, accessible explanations and simplified interactions with the blockchain. By translating complex blockchain concepts into everyday language and vice-versa, the assistant would allow less tech-savvy users to navigate and engage with Cardano.</p><p><em>If you want to know more about our full vision for the Project Catalyst Proposal, you can read all about it </em><a href="https://projectcatalyst.io/funds/14/cardano-open-developers/mcp-for-ai-cardano-explorer-assistants-eryx"><em>here</em></a><em>.</em></p><h3>What is MCP?</h3><p>MCP (Model Context Protocol) is an open-source standard created by <a href="https://www.anthropic.com/">Anthropic</a> that aims to facilitate and standardize the connection of AI applications to external systems.</p><p>Pretty much like humans, a large language model cannot use specific tools or APIs unless you provide a standarized interface to use it. For example, if you want an LLM to use Spotify, Excel or any other apps, you have to clearly state how to do specific commands (e.g.: move to the next song, or write to a cell)</p><p>The 3 main components in a MCP architecture are:</p><ul><li><strong>Host</strong>: Application that interacts with one or multiple MCP clients. For example: Cursor, Windsurf, Claude Desktop, and more.</li><li><strong>Client</strong>: Tool that connects the LLMs with one or more MCP servers, getting context for the host to use.</li><li><strong>Server</strong>: A program that provides context to MCP clients that interact with it by exposing its tools and answering its requests.</li></ul><h3>MCP Server</h3><p>Since our Cardano proposal is based in the creation of a MCP Server, we wanted to go a bit deeper into what it is and what you should consider when creating one.</p><p>An MCP server provides structured access to data or functionality (e.g., a database, API, or local file system). Each server has to describe what tools and resources it exposes, in order to connect with the client.</p><p>MCP servers can run both locally in your machine (a preferred choice if you are working with sensitive data) or in the cloud.</p><p>Now, extensions like <a href="https://github.com/tadata-org/fastapi_mcp">fastapi-mcp</a> make it really easy to, for example, make your normal FastAPI server a mcp server. Exposing what used to be regurl application/JSON endpoints and and fitting them to the MCP protocol.</p><p>When creating your own MCP server, you must remember that it may not only be used by a person, but an AI agent as well. For people, you should specify what problem your server solves (for example, it lets you interact with Cardano). For AI agents, precise, well-written tool names and descriptions are key for it to find the right solution to its user’s queries.</p><h4>Good practices</h4><ul><li>Write clear documentation for your tools.</li><li>Specify which values are expected to be returned and it what format.</li><li>Specify each parameter’s type and format.</li><li>Don’t overload your server adding a million tools. Not only could it confuse the end user in what is that your server does, but also make it more costly to use.</li><li>Analyze the use of your tools after deployment. Are any pair of tools usually called together? Combining both of them may be a better and simpler solution.</li></ul><h4>Testing</h4><p>As with all software development, testing is a key part of this. If your MCP server has a tool that, for example, returns the last transactions made in Cardano, writing a unit test verifying that it returns the expected transactions is the minimum you should do.</p><p>On top of that, you should also test if the tools that you are exposing are called and used correctly by MCP clients. Test user interaction to see if tools are being called and used as expected.</p><h4>Error handling</h4><p>Pay attention to how your tools respond to expected and unexpected errors. As we said before, errors will not be directly seen by the user, but by the AI agent he is employing. Avoid generic messages like<em> ‘Something went wrong’</em> and try to answer (if possible) with a call to action which helps fixing what went wrong: <em>‘You cannot perform this action because your token has expired, log in and try again’</em>.</p><h3>Closing up</h3><p>In this article we got to explain the basic idea of what MCP is, and what to consider when developing your own MCP server.</p><p>If you are interested in our proposal and seeing it being developed, you can go and vote now <a href="https://projectcatalyst.io/funds/14/cardano-open-developers/mcp-for-ai-cardano-explorer-assistants-eryx">here</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f89bbd7e7933" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/mcp-for-ai-cardano-explorer-assistants-f89bbd7e7933">MCP for AI Cardano Explorer Assistants</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Noirky2: how we made a Plonky2 proving backend for Noir]]></title>
            <link>https://medium.com/eryxcoop/noirky2-how-we-made-a-plonky2-proving-backend-for-noir-a2fbce7a490b?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/a2fbce7a490b</guid>
            <category><![CDATA[plonk]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[plonky2]]></category>
            <dc:creator><![CDATA[Bruno Weisz]]></dc:creator>
            <pubDate>Mon, 11 Aug 2025 13:01:48 GMT</pubDate>
            <atom:updated>2025-08-11T13:01:47.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-4Gq-JKJa13SamaRtFQCg.png" /></figure><p><em>This article is meant for curious developers who want to dive deeper into how the Noir programming Language works, or want to adapt a new proving system to be used with Noir. Right now (October 2024) there are implementations for the following proving systems although some of them need to be updated: Barretenberg, Plonky2, Halo2, Groth16, Marlin, Nova and HyperNova.</em></p><p><em>In Eryx we made a Plonky2 backend called Noirky2. Now, there are so many things we wish we had known from the start. Besides, a lot changed in Noir structurally in the process and that’s why so many backends need updating: the specification changed recently.</em></p><h3>Introduction</h3><p>Before starting, let’s say that most of what we did is specific to the Plonky2 proving system, so it won’t be useful when explaining how to do it in general. The idea is to extract abstract concepts and discuss the parts of the process that apply to every (or some) proving system.</p><p>Let’s start by talking about the Noir workflow. In the following image, you can see a simplified representation of the steps taking place from the written Noir program to the generation of the proofs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fCtdfbFNetgvOT7L.jpg" /><figcaption>From writing Noir code to generating a Plonky2 proof: the entire workflow</figcaption></figure><p>The steps are the following (you can check out the map on each step so you don’t lose track):</p><ul><li>You start by <strong>writing a Noir program</strong> and, since the idea is to generate a proof of execution with some inputs (private and public) we need to supply input values for the main function (the entry point).</li><li>When you run the <strong><em>nargo execute</em></strong> command the compiler will do two things:<br>- Compile your code into ACIR representation and write it in a file.<br>- Resolve the values of all the variables in the ACIR and write them in a file.<br>It’s important to note that nargo can generate the ACIR representation of the program <em>before</em> any inputs are provided since the circuit is independent of the execution with concrete inputs.</li><li>Finally you run the <strong><em>nargo prove</em></strong> command directly from the Noirky2 backend, which will read the mentioned files containing the program and the variables’ values. With that, the backend should:<br>- Create a Plonky2 circuit.<br>- Provide that circuit with the generated inputs.<br>- Generate a Plonky2 proof and write it in a file.</li></ul><h4>What just happened?</h4><p>Many things are happening here, so let’s start by talking about the ACIR standard (the <strong>ACIR program</strong> part of the workflow). ACIR stands for <strong>Abstract Circuit Intermediate Representation</strong>, and it’s the intermediate set of instructions that every Noir program compiles to. There are two distinct but similar things: on the one hand, we have the <a href="https://github.com/noir-lang/noir/tree/a87c655c6c8c077c71e3372cc9181b7870348a3d/acvm-repo/acir">ACIR standard</a> in an abstract sense, the specification of its instructions and how they should be interpreted. On the other hand there’s the ACIR implementation in <a href="https://www.rust-lang.org/es">rust</a>. Luckily for us, Plonky2 is also implemented in Rust, so we took the ACIR implementation from Noir and used it as a dependency in Noirky2. This is not the case for proving systems that are not written in Rust, so deserializing the instructions produced by the Nargo compilation will be the first challenge for other proving systems.</p><p>Nargo compiles Noir source code into an ACIR representation which is composed of <strong>opcodes</strong>. You can think of these opcodes as restrictions over the set of variables, or instructions that conveniently represent our program. For example, think about predicates of the form <em>“x + y should equal 7”</em>. These opcodes are not self-contained because they predicate over variables that Noir calls <strong>witnesses</strong>. These will be the “variables” of our circuit in this representation, and the one important thing to mention is that they can’t be rewritten: a variable takes only one value throughout its life and that’s it. This comes from the idea that all the mentioned predicates must be mathematically valid at the same time, therefore in ACIR, we don’t have variables like the ones in most programming languages.</p><p>The other thing Nargo does is execute the ACIR circuit with the provided inputs. Yes! This happens in such an early stage. This results in a complete assignment of values to the previously mentioned witnesses. Let’s say the opcodes mention witness w₀, w₁, w₂, w₃ and w₄, some of which are inputs, and some are intermediate variables of the program. During execution, Nargo resolves the value of each witness (remember the value is static and cannot change) and outputs it. We call this assignment the <em>Witness Stack</em>.</p><p>Each of the mentioned products (circuit and witness assignment) is then serialized and saved locally. Why? Well, we said that we wanted to have a decoupled workflow and this is the way Nargo achieves it. Now any proving backend can read the file where the ACIR circuit and the witness values were written, parse them, and build a circuit for its own prover. That’s easy to say, but how difficult it is? To answer that, we need to look at what an ACIR Opcode looks like.</p><h3>ACIR standard</h3><p>The opcode types are <em>AssertZero</em>, <em>MemoryInit</em>, <em>MemoryOp</em> (read or write), <em>BrilligCall</em> and <em>BlackBoxFunction</em>. That’s it. Well, not quite, there are lots of blackbox functions, but you get the idea.</p><p>In an ACIR there’s the concept of Witness. We can think of a Witness as an immutable variable in the circuit. All the opcodes operate over these witnesses which are numbered from 0 to N. Here you can see an example fragment of an ACIR code: the opcodes are presented as boxes. The high-level operations this representation provides, and the witness, are presented as arrows that are inputs and outputs of these boxes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dJ7siNPa0lpWV_O-.jpg" /><figcaption>Example of an ACIR with input and output witnesses</figcaption></figure><p>On the other hand, moving to our example backend, Plonky2 circuits operate over the concept of Targets and Gates. At some level of abstraction these are similar to Witnesses and Opcodes in ACIR, respectively. Throughout the construction of the Plonky2 circuit, we’ll need a mapping between Witnesses and some Targets, more specifically we’ll need an injective function <em>F: Witness -&gt; Target</em>. Why? Because two different opcodes can refer to the same witness. In those cases, we’ll want to refer to the same targets while we’re building the circuit. Besides, to generate the Plonky2 proof we need to provide some concrete values to the input targets. The goal here is to build a Plonky2 circuit equivalent to the ACIR provided, while keeping enough information to assign concrete values taken from the Witness Stack to the input targets of the Plonky2 circuit.</p><p>To clarify a bit more on the difference between ACIR and the Plonky2 circuit we need to build, here are some important aspects:</p><ul><li>For each different Noir program a different ACIR code is generated, thus a new Plonky2 circuit should be created too.</li><li>The opcodes in ACIR can be somewhat abstract, but Plonky2 (as other proving system implementations) requires a specific circuit created with its API that can be more low-level and require more targets than the number of witnesses the opcode did. That’s why the mapping between Witnesses and Targets is unidirectional (there can be more targets than witnesses, and probably will).</li></ul><p>Now, let’s dive into the different opcode types.</p><h4>AssertZero</h4><p><strong>AssertZero</strong> is the most important opcode and the one you can build most of your programs with. An AssertZero opcode adds the constraint that <em>P(W)=0</em>, where <em>W=(w₁,…,wₙ)</em> is a tuple of witnesses, and is a multi-variate polynomial of total degree at most 2. The coefficients of the polynomial are known values that define the opcode. A general expression of AssertZero opcode is the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*H36rw0tK_iaAn4k19a2UdA.png" /></figure><p>For example, such an AssertZero opcode is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*et0M1QIO7yhnI9k5qrwSGg.png" /></figure><p>At the end of the day this is just saying that the witnesses (<em>wᵢ</em>) should satisfy that equation. A witness can be referenced by more than one opcode since what ACIR models is actually a system of equations with many variables.</p><p><strong>Translation to Plonky2</strong></p><p>In the backend, translating this opcode is as simple as making use of the ArithmeticGate in Plonky2. Luckily we don’t need to do this directly, since Plonky2 provides a CircuitBuilder object with an API designed to make arithmetic operations between targets in an easy and object-oriented way. We will use operations like:</p><ul><li>add(t1: Target, t2: Target)</li><li>mul(t1: Target, t2: Target)</li><li>mul_const(t1: Target, c: FieldElement)</li><li>assert_zero(t: Target)</li></ul><p>Other ZK libraries will have its own way of implementing these operations.</p><h4>Memory Init, Read &amp; Write</h4><p>Their primary goal is to represent memory read and write operations over slots that are only known at runtime. That means, indexes and values will be given at the time of generating the proof, not when the circuit is built. This means that our circuit must address the fact that <strong>any</strong> slot of memory can change with a write operation. To say that a slot of memory can change is also a bit confusing since witnesses in ACIR and Targets in Plonky2 are immutable. So, how do we represent memory operations in this context?</p><p><strong>Translation to Plonky2</strong></p><p>Our solution was to represent each block of memory as an array of Plonky2 targets. Initializing a block of memory with the <em>MemoryInit</em> opcode is equivalent to creating an array of Targets indexed by the block ID the opcode specifies. The opcode has the following information:</p><ul><li>Block ID: used to identify the memory block.</li><li>Witnesses: an array of witnesses that hold the initial values of the memory block’s slots.</li></ul><p>The <strong>Reading Opcode</strong> has the following information:</p><ul><li>Block Id: index of the memory block we’re reading from.</li><li>Index: witness that holds the value of the block index we want to read from.</li><li>Value: witness where the value of the memory read will be stored.</li></ul><p>In other words, Value:= SelectedBlock[Index]. To implement this we used the Plonky2 RandomAccessMemory gate through the CircuitBuilder’s random_access() method.</p><p>Finally, the <strong>Write Opcode</strong> has the following information:</p><ul><li>Block Id: the memory block index we’re writing into.</li><li>Index: witness that holds the index we want to write into.</li><li>Value: witness that holds the value we want to write.</li></ul><p>You can think of this operation as SelectedBlock[Index]:= Value. Note that Value means very different things in both opcodes. This operation is a bit tricky since Index is not known when building the circuit. During circuit construction we have arrays of targets representing our memory blocks, and these targets have unchangeable values during circuit execution. Therefore, at each write operation we need to create an entirely new array and constrain its values to be the same as the previous ones, except for the position we’re changing. As you can imagine, this operation is rather expensive, but we won’t deep dive into this implementation because it’s too closely coupled with Plonky2. You can check the <a href="https://github.com/eryxcoop/acvm-backend-plonky2/blob/main/plonky2-backend/src/circuit_translation/memory_translator.rs">source code</a>.</p><h4>Black Box Functions</h4><p>Black Box Functions are operations just as abstract as Memory Operations. The idea is that in Noir we sometimes want to use some complex algorithm and it can generate a lot of arithmetic restrictions to solve it. Sometimes it can be more efficient to pass the responsibility of building that circuit to the prover backend. This is a subtle application of the <a href="https://xyproblem.info/">XY problem</a>. Instead of ACIR giving its own idea to the backend on how to solve the problem, it just says “Hey, I want to prove I’ve executed this algorithm, can you generate the circuit for it? Here’s the specification.” and then the backend builds the circuit. Some examples are the SHA256 compression function, the ECDSA signature verification, and bitwise operations over different size words (AND &amp; XOR).</p><p>A lot can be said about the implementation of bitwise operations in a Plonky2 circuit, but we’ll save those details for another article. The important thing is to understand the philosophy behind blackbox functions and why they’re important.</p><h4>Brillig</h4><p>Brillig is a kind of opcode that shouldn’t be here. But really, this opcode does not generate any constraint in the circuit, they are rather the result of <a href="https://noir-lang.org/docs/noir/concepts/unconstrained">unconstrained Noir function calls</a> and we should do nothing with them, except assign the hint values to the prover circuit before generating the proof.</p><h3>Finite field</h3><p>One of the biggest problems was the finite field Nargo uses to solve the witness values. All operations use the BN254 curve prime, a 254-bit prime number. This is also Barretenberg’s prime. Tha’ts the default proving system of Noir. But Plonky2 uses the Goldilocks prime, a 64-bit prime number 2⁶⁴-2³²+1. As you can see, the BN254 curve prime doesn’t fit into Goldilocks, it would take 4 Goldilocks field elements to represent a single BN254 field element.</p><p>At the time this backend was being implemented, Noir didn’t have a way to select which finite field to use in its calculations, and this was a problem for us since the Witness Stack was full of values and results calculated in a different field. Our solution was to fork the Noir repository and create a different Field Element to be used by Nargo’s ACVM (Abstract Circuit Virtual Machine), that’s also why to use Noirky2 is necessary to use the forked version of Noir (or just, you know, use the <a href="https://hub.docker.com/layers/bweisz/acvm-backend-plonky2/0.3/images/sha256-e7337bfe6ea1d288ea445a98d78def556b2f0dd24a3b5e1a8975653a9c4f48ec?context=repo">dockerized version</a>).</p><p>The usage of a different field size has another downside, which is the restriction over the integer size you can use in your Noir programs. Right now, when using Noirky2 you should not exceed the u32 or i32 size. This problem may or may not arise for proving systems other than Plonky2, depending on its field size.</p><h3>Conclusion</h3><p>There are many things to consider when building a prover backend for Noir. We scratched the surface in this article but as always the devil is in the details, and there are many details. I hope now you have a general view of what this is all about. This topic is complex by design, and that’s part of the challenge.</p><h3>External references for deep diving into the topic</h3><ul><li><a href="https://noir-lang.org/docs">Noir documentation</a></li><li><a href="https://docs.rs/crate/plonky2/latest/source/plonky2.pdf">Plonky2 original paper</a></li><li><a href="https://github.com/noir-lang/noir/tree/a87c655c6c8c077c71e3372cc9181b7870348a3d/acvm-repo/acir">ACIR specification in Noir repository</a></li><li><a href="https://github.com/eryxcoop/acvm-backend-plonky2">Noirky2 repository</a></li><li><a href="https://eryxcoop.github.io/acvm-backend-plonky2/opcodes/foreword.html">Noirky2 repository documentation</a></li><li><a href="https://github.com/noir-lang/noir">Noir source code</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2fbce7a490b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/noirky2-how-we-made-a-plonky2-proving-backend-for-noir-a2fbce7a490b">Noirky2: how we made a Plonky2 proving backend for Noir</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proof of Innocence in Cardano: Zero-Knowledge, Privacy and Compliance]]></title>
            <link>https://medium.com/eryxcoop/proof-of-innocence-in-cardano-zero-knowledge-privacy-and-compliance-c9e71d3d20f2?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/c9e71d3d20f2</guid>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cardano]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Julian Ezequiel Arnesino]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 13:01:06 GMT</pubDate>
            <atom:updated>2025-08-04T12:41:06.368Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qwne55xBfgzcyocwxcHxWA.png" /></figure><p>Co-authored with <a href="https://medium.com/u/966fdc1304bf">Carolina Lang</a>.</p><p>In this article, we’ll tell you about how, together with <a href="https://www.encoins.io/">Encoins</a> and <a href="https://modulo-p.io/">Modulo-P</a>, we developed an implementation of the Proof of Innocence protocol for Cardano, funded by Project Catalyst. The solution is based on zero-knowledge proofs (ZKPs) and is designed to integrate with different mixers, strengthening privacy on the blockchain.</p><h3>A small introduction</h3><h4>The problem</h4><p>Mixers on blockchain help preserve anonymity by breaking the link between the source and destination of funds. However, they can also be used to <strong>hide the origin of illicit assets</strong>.</p><h4>The proposed solution</h4><p>The Proof of Innocence (PoI) protocol solves this dilemma by allowing users to prove that their funds are not linked to criminal activities, all <strong>without revealing their identity</strong>, using blacklists maintained by trusted organizations.</p><h3>The Proof of Innocence protocol</h3><h4>How it works</h4><p>Thinking generically, there are many ways to prove innocence. In particular, when we talk about Proof of Innocence within the context of a blockchain, we’re thinking about proving that a certain transaction doesn’t belong to a given set of malicious transactions, which is published on-chain. We call this a <em>proof of exclusion</em>.</p><p>If the transaction ID is public, checking whether it is malicious or not is trivially done by comparing it against the whole list. However, there is a privacy problem with this approach: if you disclose the transaction (and in particular, the origin address) anyone can calculate all the balances for that account. To prove the origin addresses of transactions are not malicious without revealing the transaction ID directly, we use <em>zero-knowledge</em> proofs.</p><h4>How it’s used on mixers</h4><p>The objective of mixers is to increase privacy in token flow and exchange, so they are required to be accompanied by compliance mechanisms to meet money flow regulations.</p><p>The scope of this protocol, exemplified in the use case of mixers, is described by the following pipeline.</p><ol><li>Relevant authorities (e.g. US’s <a href="https://ofac.treasury.gov/">OFAC</a>) emit lists with addresses or transactions that are sanctioned, or flagged as illicit. They aim to prohibit people from dealing with money originating from addresses or transactions in these <em>blacklists</em>.</li><li>Users who take an interest in demonstrating the legitimacy of their money’s origin use this protocol to <strong>prove that it does not come from flagged addresses or transactions</strong>. They may also restrict the flow of their money to systems that use this protocol.</li><li>If any doubt arises regarding their money’s origin, they have the “proof of innocence” given by our protocol.</li></ol><p>Note that the authorities are passive agents in the system. They do not actively interact with it. The users are just taking preventive action to avoid handling money from already known illicit origins, which would be reason enough for these authorities to prosecute them. Only if suspicion or doubts arise do authorities get actively involved.</p><h4>Existing implementations</h4><p>First, there is Railgun. Railgun’s PoI circuits are coupled with its overall solution. This means that when the proof is generated, it is directly linked to a transaction and other values closely tied to the operation of Railgun’s smart contracts. This has an advantage: it prevents a situation where the proof is incorrectly linked to the wrong transaction. However, it also creates a dependency between PoI and its specific use case. As a result, the solution can’t be easily ported to another context without significant modifications.</p><p>Railgun is a case study that offered us valuable insights for implementing a Proof of Innocence solution for Cardano. The key challenge, however, is the coupling between PoI proofs and Railgun transactions. Adapting it for Cardano would require rethinking much of the circuit’s design to remove Railgun-specific elements. That said, it still serves as a solid foundation for exploring new ideas.</p><p>There is also Spillways, which is a decentralized protocol for private transactions on the Ethereum blockchain. They <a href="https://spillways.gitbook.io/documentation/protocol/proof-of-innocence">claim</a> to implement proof of innocence, but we found no evidence of that in the several repositories they made public (at the time of implementing our solution).</p><p>Finally, there is Privacy Pools. An iteration of Tornado Cash, a mixer that originally did not have a PoI mechanism. At some point, Tornado Cash was banned in the USA because of its usage for money laundering. Chainway attempted to add a compliance mechanism to it (before Privacy Pools), so we looked into it as a part of the PoI implementation ecosystem.</p><h3>What we did on Cardano</h3><h4>Our solution</h4><p>In addition to the theoretical aspects of a PoI solution for a blockchain, there are some implementation issues that are particular to Cardano.</p><p>These come from different sources:</p><ul><li>Cardano has <strong>limited computational power</strong>, in computational and storage units, and some proving systems have proof sizes that might be too large.</li><li><strong>Many primitives are still missing</strong>. Even with the recent advances in the cryptographic primitives that were included in recent versions of Aiken and Plutus, there’s still work to do, and this means that some approaches will be more straightforward to implement than others.</li><li>Cardano uses the <strong>UTxO model</strong>, and most of the current implementations of PoI are on Ethereum, where the Accounts model is used. This too calls for some adaptations.</li></ul><p>We selected <strong>Groth16</strong> as the proving system, according to the aforementioned limitations. It’s efficient in terms of verification burden and proof size, which lets us fit a proof in a transaction and verify it with a validator, all within the blockchain’s processing and memory limitations. At the same time, it’s practical. We already had an implementation of the system’s verifier, and we can leverage the elliptic curve BLS12–381, already supported by Cardano.</p><p>We presented two possible architectures that take different approaches, to be used as inspiration for an actual implementation (according to each project’s needs). The first one is a decoupled version of the Proof of Innocence protocol, which works as a standalone validator. The second one is a circuit that each use case has to import as a software library.</p><h4>More technical challenges</h4><p>Finally, we considered challenges or issues that one might encounter when designing a solution that is specific to Cardano, in order to help with the ramp-up of a new implementation.</p><p>For instance, linking the proven innocent transaction ID with the one used by the mixer is necessary. If the transaction ID is hidden in the proof, we needed a way for the mixer to prove that it is the same transaction ID used for the fund anonymization. We achieve this by using a hash of the ID, which we can handle publicly.</p><p>Another problem that may arise is that hashing the transaction ID directly might allow users to execute a brute force attack by hashing all transaction IDs they might think related to the mixer. Adding a <em>salt </em>value to the hashing of the transaction ID solves this. The proof is then interpreted as follows.</p><blockquote>I have knowledge of a private transaction ID <strong>txid</strong> and a secret salt number <strong>s</strong>, such that <strong>txid</strong> is not in this public list of transaction IDs, and that <strong>txid ⊕ s</strong> hashes to this public value <strong>h(txid ⊕ s)</strong>.</blockquote><p>More possible problems were explored and commented on. More information in this <a href="https://github.com/eryxcoop/cardano-zk-proof-of-innocence/blob/main/research/Research%20and%20Preliminary%20Specification.md">research document</a> we wrote for the first milestone.</p><h3>Finishing notes</h3><p>The implementation of the protocol in Cardano was successful. We made it open-source via <a href="https://github.com/eryxcoop/cardano-zk-proof-of-innocence/tree/main">this repository</a>. You can clone it and follow the <a href="https://github.com/eryxcoop/cardano-zk-proof-of-innocence/blob/main/README.md">README</a> file to set up the tool and run the commands.</p><p>This helped us prove that Cardano products and applications can implement their own version of the protocol, inspired by ours, to help <strong>achieve compliance while preserving privacy</strong>.</p><p>As for Eryx, this development allowed us to explore the limits of ZKPs within the Cardano environment and collaborate with other ecosystem actors.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9e71d3d20f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/proof-of-innocence-in-cardano-zero-knowledge-privacy-and-compliance-c9e71d3d20f2">Proof of Innocence in Cardano: Zero-Knowledge, Privacy and Compliance</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of GPU Parallelization (Applied to Cryptography Primitives)]]></title>
            <link>https://medium.com/eryxcoop/the-power-of-gpu-parallelization-applied-to-cryptography-primitives-957015c4b892?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/957015c4b892</guid>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Julian Ezequiel Arnesino]]></dc:creator>
            <pubDate>Tue, 15 Jul 2025 13:03:07 GMT</pubDate>
            <atom:updated>2025-07-15T13:03:06.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JU2PYYQV58Y9c_9FQ2ow4g.png" /></figure><h3>Introduction</h3><p>GPUs can handle many simultaneous calculations. They have three main applications:</p><ol><li>Data-intensive computations.</li><li>Complex algebraic operations.</li><li>Image or signal processing.</li></ol><p>The third one, of course, is the original purpose for GPUs.</p><p>How do GPUs parallelize? In this article, we’ll focus on CUDA, Nvidia’s architecture for GPU computing. GPUs parallelize by splitting our program’s computation between threads. The GPU will run these threads concurrently and process as many in parallel as it can.</p><p>There are many architecture-specific features to help us, too.</p><ul><li>How threads are grouped in blocks and warps, and how they interact.</li><li>The use of different memory types.</li><li>Consecutive memory access operations.</li><li>Locks and atomic operations.</li></ul><p>All this power, however, does not come without its share of responsibility. There are several factors to consider when programming for GPUs.</p><ol><li>The GPU and CPU have separate memory spaces:<br>- One cannot access the other’s memory.<br>- Copying data from one to the other is very expensive.</li><li>Memory accessing is not trivial.<br>- GPUs shine when memory access is consecutive, and coalesced.<br>- Memory optimizations usually depend on consecutive access.</li></ol><p>Now, the sudden rise in practical applications for cryptography theory concepts in recent years caused some to research and develop specialized hardware. As of the writing of this article, the research of zero-knowledge and cryptography hardware resulted in and is focused on FPGAs and ASICs.</p><h3>Case Study</h3><p>In order to see these concepts at work, we showcase the parallelization of an algorithm used in a state-of-the-art zero-knowledge prover.</p><ol><li>We explain its sequential version.</li><li>We show how to adapt it for parallelization.</li><li>We compare both versions.</li></ol><p>The algorithm in question is named <em>batch inverse</em>. Its purpose is to calculate the multiplicative inverse in the field for a batch of numbers.</p><h3>Parallel algorithm (adapted Montgomery’s trick)</h3><p>Montgomery’s trick is a well-known and widely-applied reduction method to optimize the inversion of batch field elements. We wrote a short article on it, if you want some context.</p><p><strong><em>[REF TO MOTGOMERY’S TRICK MEDIUM ARTICLE]</em></strong></p><p>It starts with an array of elements to invert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/1*wTqLzqGAogDNIR5qv8rdTA.png" /></figure><p>But we’ll assume the length of the array is a power of two. This is easy to assume since we can always pad the array until it reaches the next power of two, and then discard the padded values in the end.</p><p>This version of the algorithm computes accumulated products in a binary tree shape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6fTil0X28AA3U8Jy.png" /></figure><p>Observe that, in the same level of the tree, all multiplications are independent. Therefore, they can be parallelized.</p><p>In the next step, we compute the field inversion for the final accumulated product, using the extended Euclidean algorithm. This will be the only time we use this expensive operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*EQaT1H_sVjtJQI1AbD5JQg.png" /></figure><p>And, just like Montgomery’s original idea, we can use the partial accumulated products to pull apart the components of our inversion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*7kubR9hHPX8oizkyUqqCgQ.png" /></figure><p>We used the previously calculated inversion to our advantage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*E_u050JM6vT5_m0Jn_UCYw.png" /></figure><p>Then, we continue pulling apart the rest of the products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cKpwODmIXVcZ29tI.png" /></figure><p>In this tree, it is also true that each operation in the same level can be parallelized.</p><p>This leaves us with every element’s inversion. But how does it compare to the original trick? Well, for an array with 𝓃 elements:</p><ul><li>A naïve implementation would need 𝓃 field inversions.</li><li>Montgomery’s trick needs 3(𝓃 <strong>− </strong>1) field multiplications and only one field inversion.<br>- Needs 𝓃 <strong>− </strong>1 multiplications to compute the accumulated products.<br>- Needs one field inversion for the final accumulated product.<br>- Needs 2(𝓃 <strong>− </strong>1) multiplications to invert each element.</li></ul><p>Just like the original algorithm for Montgomery’s reduction.</p><h3>Performance comparison</h3><p>Even while being equal in terms of time complexity, the use of GPU to parallelize the adapted trick clearly makes a difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UShdY-DdmKFj54KG.png" /><figcaption>GPU vs CPU+AVX: batch field inversion</figcaption></figure><p>And the difference is ridiculous, even when compared against an AVX-optimized CPU algorithm (AVX being a single-instruction-multiple-data architecture).</p><p>The next chart shows how this difference scales proportionally to the amount of elements involved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9tzjr0mszIr48Idc.png" /><figcaption>GPU vs CPU+AVX: batch field inversion</figcaption></figure><p>The following graph depicts the time taken for the Stwo prover to compute a proof. Stwo is a Circle STARKs prover self-described as the fastest at the time of writing. The times shown are for the accumulated proving time of CPU with AVX against GPU for the different stages of the proving algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ipZXKvGPWoBjVAso.png" /><figcaption>GPU vs CPU+AVX: Stwo prover performance</figcaption></figure><p>Once again, the difference is made more than clear. Stwo is made for proving traces of programs. These benchmarks were not run for a real trace, but for a simulated one, using a variant of the Fibonacci sequence.</p><h3>Conclusions</h3><p>The main takeaways from all this are the following.</p><ol><li>GPU parallelization is a very powerful tool to make our algorithms quicker and cheaper to run. Harnessing GPU power is nowadays vital for the computation of cryptography primitives.</li><li>A simple heuristic goes a long way in leveraging the potential of both high-performance and commodity hardware GPUs. In most cases, a parallelization would consist of implementing a loop with threads, which would not require any adaptations, like the one shown here.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=957015c4b892" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/the-power-of-gpu-parallelization-applied-to-cryptography-primitives-957015c4b892">The Power of GPU Parallelization (Applied to Cryptography Primitives)</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Montgomery’s Trick for Batch Galois Field Inversion]]></title>
            <link>https://medium.com/eryxcoop/montgomerys-trick-for-batch-galois-field-inversion-9b6d0f399da2?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/9b6d0f399da2</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[Julian Ezequiel Arnesino]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 13:03:23 GMT</pubDate>
            <atom:updated>2025-07-10T13:03:22.639Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PzuJNvtn72hkYPv8_KWGMQ.png" /></figure><p>We present an efficient way of inverting many field elements at once.</p><h3>Motivation</h3><p>The objective is to invert a batch or array of field elements. In a naïve approach, one would invert each element in the array. This would mean applying the extended Euclidean algorithm for each element to compute its inverse. However, since field inversion is an expensive operation, we will use something called <em>Montgomery’s trick</em>.</p><h3>Step-by-step</h3><p>It starts with an array of elements to invert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pXx6qr5FPsFAk3XqqEOK_Q.png" /></figure><p>It then computes the accumulated products up to each element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CB-Wje2J5KOn-gzbwG77Aw.png" /></figure><p>This could be done with as many products as there are elements in the array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_AvpuXoPkD3m-aWS-aQpVA.png" /></figure><p>In the next step, we compute the field inversion for the final accumulated product, using the extended Euclidean algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ZcIBqtJ_BzmEyuDmQz8zg.png" /></figure><p>This will be the only time we use this expensive operation.</p><p>Now, we want to calculate the inversion of each element from the inversion of the final accumulated product. The trick uses the previously accumulated products for this, as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yeSORTSahVx5axu-Vow50Q.png" /></figure><p>How does that work? Well, we could explain it by imagining the field inversion as a division. This is an intuitive representation only, since there is no such thing as division in <strong>𝔽ₚ</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ki8FbbzhbT9VKLVjxTOf8A.png" /></figure><p>The inversion of the accumulated product is equal to the product of all the individual inverses. By multiplying it with the elements we don’t want, those inversions are canceled out, and only the element we want remains.</p><p>Now it can calculate the inversion of the previous accumulated product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gPuwBJ4MkAQFoQmtYs5Obw.png" /></figure><p>The same idea applies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GCIAqzqvB99yqaYmXHV9A.png" /></figure><p>This idea would now be sequentially repeated for the remaining elements in the array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ySGpPVWM51DpbQXofNTwA.png" /></figure><p>Which leaves us with every element’s inversion.</p><h3>Comparison</h3><p>But why have we done all this? Well, for an array with 𝓃 elements:</p><ul><li>A naïve implementation would need 𝓃 field inversions.</li><li>Montgomery’s trick needs 3(𝓃 <strong>− </strong>1) field multiplications and only one field inversion.<br>- Needs 𝓃 <strong>− </strong>1 multiplications to compute the accumulated products.<br>- Needs one field inversion for the final accumulated product.<br>- Needs 2(𝓃 <strong>− </strong>1) multiplications to invert each element.</li></ul><p>Knowing how expensive the extended Euclidean algorithm is, we will gladly take the trade.</p><h3>Conclusion</h3><p>This trick offers a powerful optimization when working with batch inversion in a finite field. By reducing the number of expensive field inversions from one per element to just one overall (at the cost of a manageable number of field multiplications) we reached a computationally lighter solution.</p><p>Now we know how to batch invert field elements efficiently! This is of particular value in cryptography applications, where field operations are very frequent.</p><p>In our next article, we will showcase a cryptography application of this algorithm, and an adaptation for it to be parallelized using GPU!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b6d0f399da2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/montgomerys-trick-for-batch-galois-field-inversion-9b6d0f399da2">Montgomery’s Trick for Batch Galois Field Inversion</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Zero-Knowledge Bridge: Privacy-Preserving Interoperability on Cardano]]></title>
            <link>https://medium.com/eryxcoop/building-a-zero-knowledge-bridge-privacy-preserving-interoperability-on-cardano-76b2ae4a54cd?source=rss----c873b442fd8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/76b2ae4a54cd</guid>
            <category><![CDATA[zksnark]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cardano]]></category>
            <category><![CDATA[zkbridge]]></category>
            <dc:creator><![CDATA[Carolina Lang]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 13:03:18 GMT</pubDate>
            <atom:updated>2025-07-07T13:03:16.065Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxXc4og0AIJM8dxMiO2p-A.png" /></figure><p>At Eryx, we believe privacy should be native to interoperability. As the Cardano ecosystem grows, so does the need to exchange assets and information across chains — but without sacrificing user confidentiality. That’s where Zero-Knowledge (ZK) bridges come in.</p><h3>Why a ZK Bridge?</h3><p>Cross-chain bridges are usually a weak point in blockchain security, as they’re prone to exploits and rely on trusted third parties. Our vision is to develop a ZK-powered bridge that can be used to transfer funds and computation between different chains without revealing unnecessary information — and that integrates smoothly with Cardano’s architecture.</p><p>We aim to build the foundation for a zero-knowledge (ZK) bridge that will allow Cardano to connect with other blockchains in a secure and trustless way.</p><p>This is crucial both to bring more liquidity to the ecosystem and to accelerate the expansion of zero-knowledge capabilities on Cardano.</p><p>Our approach focuses on composability and transparency. The architecture is modular, which allows it to integrate with other ZK-enabled systems and be reused for multiple cross-chain scenarios Verifiers will be implemented natively on Cardano using Aiken.</p><h3>How it works</h3><p>Our ZK bridge design replaces trusted intermediaries with zero-knowledge proofs, enabling cross-chain interactions based on verifiable claims. Here’s a simplified flow of an interaction between two chains (A and B):</p><blockquote>A user locks tokens or initiates an action on Chain A.</blockquote><blockquote>A ZK proof of said action’s occurrence in chain A is issued off-chain.</blockquote><blockquote>This proof is submitted to Chain B, where it’s verified on-chain using a native verifier written in Aiken.</blockquote><blockquote>Upon successful verification, Chain B takes a corresponding action (e.g., minting wrapped tokens).</blockquote><p>The key here is that no sensitive user data or transaction details are exposed in the process — only the existence of the action in chain A is proven.</p><h3>What’s Next</h3><p>We are currently in the early research and feasibility stage of the project. Our focus is on understanding the boundaries of what’s possible within Cardano’s extended UTxO model and its evolving smart contract capabilities. This includes identifying the cryptographic guarantees required for cross-chain claims, mapping out potential use cases, and exploring how to implement fast verifiers within Aiken and Plutus V3. Throughout this process, we aim to stay grounded in Cardano’s principles — developing in the open, sharing what we learn, and collaborating with other ecosystem teams.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76b2ae4a54cd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eryxcoop/building-a-zero-knowledge-bridge-privacy-preserving-interoperability-on-cardano-76b2ae4a54cd">Building a Zero-Knowledge Bridge: Privacy-Preserving Interoperability on Cardano</a> was originally published in <a href="https://medium.com/eryxcoop">Eryx</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>