{"id":3846,"date":"2025-11-17T20:59:12","date_gmt":"2025-11-17T15:29:12","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=3846"},"modified":"2025-11-18T04:59:40","modified_gmt":"2025-11-17T23:29:40","slug":"implementing-zero-knowledge-proof-in-golang","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2025\/11\/17\/implementing-zero-knowledge-proof-in-golang\/","title":{"rendered":"Implementing Zero-Knowledge Proof in Golang"},"content":{"rendered":"<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Zero-knowledge_proof\" target=\"_blank\" rel=\"noopener\"><em><strong>Zero-Knowledge Proofs (ZKP)<\/strong><\/em><\/a> are a fascinating area within <em><strong>Cryptography<\/strong><\/em>. These allow one party, called the <em><strong>\u201cProver\u201d<\/strong><\/em>, to convince another party, called the <em><strong>\u201cVerifier\u201d<\/strong><\/em>, that some statement is true <span style=\"text-decoration: underline;\">without revealing<\/span> the underlying information.<\/p>\n<p>There are two basic types of ZKPs: Interactive and non-interactive. The former requires a series of messages to be exchanged between the <em><strong>Prover<\/strong><\/em> and <em><strong>Verifier<\/strong><\/em>, but in the latter, the <em><strong>Prover<\/strong><\/em> sends only a single message to the <em><strong>Verifier<\/strong><\/em>. In both cases, the <em><strong>Verifier<\/strong><\/em> is convinced through the message protocol.<\/p>\n<p>In this article, I will show how to implement a simple non-interactive proof in <em><strong>Golang<\/strong><\/em>. The reason I chose <em><strong>Golang<\/strong><\/em> is because it has a good ZKP library called <a href=\"https:\/\/docs.gnark.consensys.io\" target=\"_blank\" rel=\"noopener\"><em><strong>\u201cgnark\u201d<\/strong><\/em><\/a>, an implementation of <em><strong>zk-SNARK<\/strong><\/em>. There is even a nice <a href=\"https:\/\/play.gnark.io\" target=\"_blank\" rel=\"noopener\"><em><strong>gnark<\/strong> <strong>playground<\/strong><\/em><\/a> where we can compile and run circuits in the browser.<\/p>\n<p>Here is how we can install <em><strong>gnark<\/strong><\/em>:<\/p>\n<p style=\"padding-left: 40px;\"><strong>&gt;&gt; go get github.com\/consensys\/gnark@latest<\/strong><\/p>\n<p>Let us now walk through the code. The example is to prove that a person is more than 18 years old without revealing the actual age. We use \u201c<em><strong>Circuits\u201d<\/strong><\/em> in ZKP to model the statement we want to prove. In <em><strong>Golang<\/strong><\/em>, we use a <em><strong>\u201cstruct\u201d<\/strong><\/em> for this purpose. The constraints are implemented as <em><strong>\u201ccode\u201d<\/strong><\/em> assertions:<\/p>\n<figure id=\"attachment_3847\" aria-describedby=\"caption-attachment-3847\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"3847\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/11\/17\/implementing-zero-knowledge-proof-in-golang\/circuit\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png\" data-orig-size=\"1674,760\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Circuit for Proving Age\" data-image-description=\"&lt;p&gt;Circuit for Proving Age&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Circuit for Proving Age&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit-1024x465.png\" class=\"wp-image-3847\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png?resize=550%2C250&#038;ssl=1\" alt=\"Circuit for Proving Age\" width=\"550\" height=\"250\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png?resize=300%2C136&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png?resize=1024%2C465&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png?resize=768%2C349&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png?resize=1536%2C697&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/circuit.png?w=1674&amp;ssl=1 1674w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3847\" class=\"wp-caption-text\"><strong>Circuit for Proving Age<\/strong><\/figcaption><\/figure>\n<p>In this example, the <em><strong>\u201cAgeCircuit\u201d<\/strong><\/em> contains a <em><strong>\u201cprivate\u201d<\/strong><\/em> field called <em><strong>\u201cCurrentAge\u201d<\/strong><\/em> (for simplicity, I am not using the date of birth) and three public fields &#8211; <em><strong>\u201cAadhar\u201d<\/strong><\/em>, <em><strong>\u201cMinimumAge\u201d<\/strong><\/em> (as required by the verifier) and <em><strong>\u201cIsAboveAgeThreshold\u201d<\/strong><\/em> which asserts that the person is <em><strong>above the required threshold<\/strong><\/em>. Note that <em><strong>\u201cAadhar\u201d<\/strong><\/em> field is not needed, but I have included it so that the <em><strong>Verifier<\/strong><\/em> can know that my claim is linked to my <em><strong>\u201cAadhar\u201d<\/strong><\/em>.<\/p>\n<p>The next step is to compile the circuit into a constraint system and generate the <em><strong>\u201cProving\u201d<\/strong><\/em> and <em><strong>\u201cVerifying\u201d<\/strong><\/em> keys:<\/p>\n<figure id=\"attachment_3848\" aria-describedby=\"caption-attachment-3848\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3848\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/11\/17\/implementing-zero-knowledge-proof-in-golang\/generate-keys\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png\" data-orig-size=\"1374,546\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Generating Keys\" data-image-description=\"&lt;p&gt;Generating Keys&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Generating Keys&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys-1024x407.png\" class=\"wp-image-3848\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png?resize=550%2C219&#038;ssl=1\" alt=\"Generating Keys\" width=\"550\" height=\"219\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png?resize=300%2C119&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png?resize=1024%2C407&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png?resize=768%2C305&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png?resize=400%2C160&amp;ssl=1 400w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/generate-keys.png?w=1374&amp;ssl=1 1374w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3848\" class=\"wp-caption-text\"><strong>Generating Keys<\/strong><\/figcaption><\/figure>\n<p>The third step is to create a <em><strong>\u201cwitness\u201d<\/strong><\/em> (private) and pass the actual assignment of values of the Circuit and generate the <em><strong>\u201cProof\u201d<\/strong><\/em>:<\/p>\n<figure id=\"attachment_3849\" aria-describedby=\"caption-attachment-3849\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3849\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/11\/17\/implementing-zero-knowledge-proof-in-golang\/proof\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof.png\" data-orig-size=\"1396,690\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Generating Proof\" data-image-description=\"&lt;p&gt;Generating Proof&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Generating Proof&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof-1024x506.png\" class=\"wp-image-3849\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof.png?resize=550%2C272&#038;ssl=1\" alt=\"Generating Proof\" width=\"550\" height=\"272\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof.png?resize=300%2C148&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof.png?resize=1024%2C506&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof.png?resize=768%2C380&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/proof.png?w=1396&amp;ssl=1 1396w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3849\" class=\"wp-caption-text\"><strong>Generating Proof<\/strong><\/figcaption><\/figure>\n<p>Notice that generating proof requires the <em><strong>\u201cProvingKey\u201d<\/strong><\/em>, which should not be shared publicly.<\/p>\n<p>Now that the proof has been generated, what should the prover share with the verifier? Obviously, we need to share the <em><strong>\u201cProof\u201d<\/strong><\/em> and the <em><strong>\u201cVerificationKey\u201d<\/strong><\/em>. We also need to share the <em><strong>\u201cpublic\u201d<\/strong><\/em> components of the <em><strong>\u201cwitness\u201d<\/strong><\/em>. Verifying the shared proof is then pretty straightforward:<\/p>\n<figure id=\"attachment_3850\" aria-describedby=\"caption-attachment-3850\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3850\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/11\/17\/implementing-zero-knowledge-proof-in-golang\/verify\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify.png\" data-orig-size=\"1392,580\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Verifying the Proof\" data-image-description=\"&lt;p&gt;Verifying the Proof&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Verifying the Proof&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify-1024x427.png\" class=\"wp-image-3850\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify.png?resize=550%2C229&#038;ssl=1\" alt=\"Verifying the Proof\" width=\"550\" height=\"229\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify.png?resize=300%2C125&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify.png?resize=1024%2C427&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify.png?resize=768%2C320&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/verify.png?w=1392&amp;ssl=1 1392w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3850\" class=\"wp-caption-text\"><strong>Verifying the Proof<\/strong><\/figcaption><\/figure>\n<p>Essentially, the following are the steps in coming up with the non-interactive \u00a0protocol:<\/p>\n<p style=\"padding-left: 40px;\"><strong>1) Define the circuit and corresponding assertions<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>2) Compile the circuit and generate keys<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>3) Generate proof using instantiated circuit<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>4) Verify the proof<\/strong><\/p>\n<p>Just to make this example interesting, let us try to create a <em><strong>\u201cfalse\u201d<\/strong><\/em> claim. What if the person is <span style=\"text-decoration: underline;\"><em>less than<\/em><\/span> 18 years of age, but we claim he is over 18?<\/p>\n<figure id=\"attachment_3851\" aria-describedby=\"caption-attachment-3851\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3851\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/11\/17\/implementing-zero-knowledge-proof-in-golang\/false-claim\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim.png\" data-orig-size=\"1502,1116\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Creating False Claim\" data-image-description=\"&lt;p&gt;Creating False Claim&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Creating False Claim&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim-1024x761.png\" class=\"wp-image-3851\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim.png?resize=550%2C409&#038;ssl=1\" alt=\"Creating False Claim\" width=\"550\" height=\"409\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim.png?resize=300%2C223&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim.png?resize=1024%2C761&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim.png?resize=768%2C571&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/false-claim.png?w=1502&amp;ssl=1 1502w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3851\" class=\"wp-caption-text\"><strong>Creating False Claim<\/strong><\/figcaption><\/figure>\n<p>This should fail, right? It fails as you can see in the final output below:<\/p>\n<figure id=\"attachment_3852\" aria-describedby=\"caption-attachment-3852\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3852\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/11\/17\/implementing-zero-knowledge-proof-in-golang\/output-14\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output.png\" data-orig-size=\"1470,694\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Program Output\" data-image-description=\"&lt;p&gt;Program Output&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Program Output&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output-1024x483.png\" class=\"wp-image-3852\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output.png?resize=550%2C260&#038;ssl=1\" alt=\"Program Output\" width=\"550\" height=\"260\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output.png?resize=300%2C142&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output.png?resize=1024%2C483&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output.png?resize=768%2C363&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/11\/output.png?w=1470&amp;ssl=1 1470w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3852\" class=\"wp-caption-text\"><strong>Program Output<\/strong><\/figcaption><\/figure>\n<p>The messages clearly show that the valid proof succeeds as expected, whereas the false claim fails.<\/p>\n<p>In summary, the <em><strong>Golang<\/strong><\/em> program using <em><strong>\u201cgnark\u201d<\/strong><\/em> library is quite succinct and expressive at the same time. It is a good start to exploring more complex zero-knowledge proof problems.<\/p>\n<p>You can download the main program <a href=\"https:\/\/www.rangakrish.com\/downloads\/zkp.go\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<p>Have a great week!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zero-Knowledge Proofs (ZKP) are a fascinating area within Cryptography. These allow one party, called the \u201cProver\u201d, to convince another party, called the \u201cVerifier\u201d, that some statement is true without revealing the underlying information. There are two basic types of ZKPs: Interactive and non-interactive. The former requires a series of messages to be exchanged between the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[141],"tags":[142,440,441],"class_list":["post-3846","post","type-post","status-publish","format-standard","hentry","category-golang","tag-go-language","tag-zero-knowledge-proof","tag-zkp"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-102","jetpack-related-posts":[{"id":3614,"url":"https:\/\/www.rangakrish.com\/index.php\/2025\/02\/04\/interacting-with-openai-api-using-golang\/","url_meta":{"origin":3846,"position":0},"title":"Interacting with OpenAI API using Golang","author":"admin","date":"February 4, 2025","format":false,"excerpt":"I normally use Python\u2019s LangChain framework to communicate with OpenAI API. For a change, I wanted to see if Go has any libraries to access OpenAI and other LLMs. Interestingly I found that LangChainGo\u00a0is a port of LangChain for Golang! I decided to implement a simple Completetion request in both\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Non-streaming Mode","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/02\/code1-300x227.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/02\/code1-300x227.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/02\/code1-300x227.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":928,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/05\/27\/calling-go-functions-from-lisp\/","url_meta":{"origin":3846,"position":1},"title":"Calling Go Functions from Lisp","author":"admin","date":"May 27, 2018","format":false,"excerpt":"For the past few weeks I was travelling in the USA and had the pleasure of meeting several friends, some of whom are senior developers and architects. It was interesting to learn that many of them were either using Go language in their daily work, or were passionately endorsing the\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Part of Header File","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/05\/Header-file.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/05\/Header-file.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/05\/Header-file.png?resize=525%2C300 1.5x"},"classes":[]},{"id":2736,"url":"https:\/\/www.rangakrish.com\/index.php\/2022\/03\/19\/book-review-introducing-blockchain-with-lisp\/","url_meta":{"origin":3846,"position":2},"title":"Book Review: Introducing Blockchain with Lisp","author":"admin","date":"March 19, 2022","format":false,"excerpt":"Title: Introducing Blockchain with Lisp: Implement and Extend Blockchains with the Racket Language Author: Boro Sitnikovski Publisher: Apress Year: 2021 Blockchains are a hot topic these days and interestingly, I am getting involved in a project that uses Blockchain. Languages such as C++, Java, Go and Node.js are commonly used\u2026","rel":"","context":"In &quot;Book Review&quot;","block_context":{"text":"Book Review","link":"https:\/\/www.rangakrish.com\/index.php\/category\/book-review\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2022\/03\/Blockchain-Book-300x251.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":944,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/06\/10\/calling-lisp-functions-from-go-language\/","url_meta":{"origin":3846,"position":3},"title":"Calling Lisp Functions from Go Language","author":"admin","date":"June 10, 2018","format":false,"excerpt":"In the previous post, we saw how to invoke a Go function from Lisp. In today's post, I would like to explain how to go in the other direction, namely, how to call Lisp functins from Go. There are two ways to do this. The first approach is to load\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Direct DLL Call","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/LispCall.png?resize=525%2C300 1.5x"},"classes":[]},{"id":4012,"url":"https:\/\/www.rangakrish.com\/index.php\/2026\/01\/01\/common-lisp-metaobject-protocol-classes-are-just-objects\/","url_meta":{"origin":3846,"position":4},"title":"Common Lisp Metaobject Protocol: Classes are Just Objects!","author":"admin","date":"January 1, 2026","format":false,"excerpt":"In today\u2019s popular languages such as C++, Java, Golang, Rust, Python, etc., classes are fixed constructs defined by the language. They have a definite syntax that can\u2019t be changed while programming. We are all used to this of course. But what makes Common Lisp stand out is that in that\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"A Simple Class","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2026\/01\/code1-300x42.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":963,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/06\/24\/calling-go-functions-from-lisp-part-2\/","url_meta":{"origin":3846,"position":5},"title":"Calling Go Functions from Lisp &#8211; Part 2","author":"admin","date":"June 24, 2018","format":false,"excerpt":"In my earlier article Calling Go Functions from Lisp, I explained the steps for making calls to Go functions from another language, specifically LispWorks Lisp. Today, I want to give a slightly more\u00a0 interesting example showing the use of Go channels\u00a0through exported functions. Go is widely admired for its native\u2026","rel":"","context":"In &quot;Golang&quot;","block_context":{"text":"Golang","link":"https:\/\/www.rangakrish.com\/index.php\/category\/golang\/"},"img":{"alt_text":"Go Functions","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/06\/Go-Functions.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=3846"}],"version-history":[{"count":4,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3846\/revisions"}],"predecessor-version":[{"id":3855,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3846\/revisions\/3855"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=3846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=3846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=3846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}