502 lines
18 KiB
HTML
502 lines
18 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="generator" content="pandoc">
|
||
<title>Sudoku snark</title>
|
||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
|
||
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/reset.css">
|
||
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/reveal.css">
|
||
<style>
|
||
.reveal .sourceCode { /* see #7635 */
|
||
overflow: visible;
|
||
}
|
||
code{white-space: pre-wrap;}
|
||
span.smallcaps{font-variant: small-caps;}
|
||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||
div.column{flex: auto; overflow-x: auto;}
|
||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||
ul.task-list{list-style: none;}
|
||
ul.task-list li input[type="checkbox"] {
|
||
width: 0.8em;
|
||
margin: 0 0.8em 0.2em -1.6em;
|
||
vertical-align: middle;
|
||
}
|
||
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
|
||
</style>
|
||
<link rel="stylesheet" href="https://unpkg.com/reveal.js@^4//dist/theme/black.css" id="theme">
|
||
<style>
|
||
.reveal, .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6
|
||
{
|
||
font-family:"jetbrains-mono", "Times New Roman", Times;
|
||
}
|
||
@font-face{
|
||
font-family:jetbrains-mono;src:local("jetbrains-mono"),
|
||
url("./fonts/JetBrainsMono-Medium.woff2") format("woff2");
|
||
}
|
||
.black h2 {
|
||
background-color: #020210;
|
||
}
|
||
|
||
.reveal ul {
|
||
list-style-type: "❯";
|
||
|
||
}
|
||
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="reveal">
|
||
<div class="slides">
|
||
|
||
<section id="title-slide">
|
||
<h1 class="title">Sudoku snark</h1>
|
||
<p class="subtitle">a story by <a
|
||
href="https://kompact.io">Kompact.io</a></p>
|
||
</section>
|
||
|
||
<section>
|
||
<section id="how-it-started" class="title-slide slide level1">
|
||
<h1>How it started</h1>
|
||
|
||
</section>
|
||
<section id="there-is-a-hackathon-on-cardano" class="slide level2">
|
||
<h2>There is a hackathon on cardano 🥳 …</h2>
|
||
</section>
|
||
<section id="but-wait-there-is-a-zk-track" class="slide level2">
|
||
<h2>But wait! 🧐 There is a zk track</h2>
|
||
</section>
|
||
<section id="surely-no" class="slide level2">
|
||
<h2>Surely No!?</h2>
|
||
<ul>
|
||
<li><p>Fundamental primitives for any zk-alg are not available in
|
||
plutus</p></li>
|
||
<li><p>Midnight, the much hyped zk sidechain, is essentially in stealth
|
||
mode</p></li>
|
||
<li><p>zk on Cardano? not possible! 😵💫</p></li>
|
||
<li><p>Using some other chain for zk and bridging over … that’s
|
||
<em>bridging</em>: we want <em>zk</em></p></li>
|
||
</ul>
|
||
</section>
|
||
<section id="oh-hello-pr5231pr-5231" class="slide level2"
|
||
data-background-image="./assets/zk-pr-screenshot.png"
|
||
data-background-opacity="0.3">
|
||
<h2 data-background-image="./assets/zk-pr-screenshot.png"
|
||
data-background-opacity="0.3">… oh, hello <a
|
||
href="https://github.com/input-output-hk/plutus/pull/5231">PR#5231</a>
|
||
👀</h2>
|
||
</section>
|
||
<section id="section" class="slide level2">
|
||
<h2></h2>
|
||
<ul>
|
||
<li>A beast of a PR: 6 months, 230 commits, 319 files changed</li>
|
||
<li>Finally merged during this hackathon</li>
|
||
</ul>
|
||
<blockquote>
|
||
<p>This PR adds new built-in types and functions to Plutus Core and
|
||
PlutusTx for pairings over BLS12-381, as specified in CIP-0381</p>
|
||
</blockquote>
|
||
</section>
|
||
<section id="what-does-this-mean" class="slide level2">
|
||
<h2>What does this mean??</h2>
|
||
<ul>
|
||
<li><a href="https://cips.cardano.org/cips/cip0381/">CIP-0381</a>:
|
||
plutus support for pairings over <code>BLS12_381</code></li>
|
||
<li>In other words plutus gets the built-ins that make it possible to
|
||
begin genuine zk on Cardano</li>
|
||
</ul>
|
||
</section>
|
||
<section id="so-yes-we-can-zk-on-cardano" class="slide level2">
|
||
<h2>So Yes! 🤯 <br/> We <em>can</em> zk on cardano</h2>
|
||
</section>
|
||
<section id="first-hurdle" class="slide level2">
|
||
<h2>First hurdle</h2>
|
||
<ul>
|
||
<li>Only the primitives are provided; we need to implement a zk-alg</li>
|
||
<li>Use it as the basis for a dapp</li>
|
||
<li>And do both in a way that doesn’t break the (ex-units) bank</li>
|
||
</ul>
|
||
</section>
|
||
<section id="and-then" class="slide level2">
|
||
<h2>🤔 And then?</h2>
|
||
<ul>
|
||
<li><p>Having zk in the latest version of plutus is one thing: running a
|
||
zk dapp on cardano is quite another!</p></li>
|
||
<li><p>There is no chance of running these new primitives on Cardano
|
||
mainnet any time soon</p></li>
|
||
</ul>
|
||
</section>
|
||
<section id="not-on-l1-but-hydra" class="slide level2"
|
||
data-background-image="./assets/hydra.png"
|
||
data-background-opacity="0.3">
|
||
<h2 data-background-image="./assets/hydra.png"
|
||
data-background-opacity="0.3">Not on L1, <br/> but … hydra</h2>
|
||
<ul>
|
||
<li>Hydra is Cardano-native ‘isomorphic’ L2</li>
|
||
<li>Loosely - it can run plutus just like mainnet</li>
|
||
<li>But we could also run it with a modified version of plutus</li>
|
||
<li>Thus we could run hydra with the latest plutus and deploy our zk
|
||
dapp their</li>
|
||
</ul>
|
||
<p>No need to wait for any hardforks!</p>
|
||
</section>
|
||
<section id="so-wed-need-to" class="slide level2">
|
||
<h2>… so we’d need to: 📋</h2>
|
||
<ul>
|
||
<li>Create a zk validator</li>
|
||
<li>Create tx-building functionality</li>
|
||
<li>Bump all the Cardano libraries from plutus to hydra</li>
|
||
<li>Build + deploy</li>
|
||
</ul>
|
||
<p>(Do all this in less than three weeks, while keeping the day job
|
||
😅)</p>
|
||
</section></section>
|
||
<section>
|
||
<section id="sudoku-snark" class="title-slide slide level1">
|
||
<h1>Sudoku snark</h1>
|
||
|
||
</section>
|
||
<section id="aims" class="slide level2">
|
||
<h2>🎯 Aims</h2>
|
||
<ul>
|
||
<li>Create a non trivial zk dapp on Cardano ie demonstrable PoC</li>
|
||
<li>Initial iteration of tooling/ stack</li>
|
||
<li>Derisk more ambitious Cardano-based zk dapps</li>
|
||
</ul>
|
||
<p>And conversely, non-aims:</p>
|
||
<ul>
|
||
<li>Larp a fantastical business based on unproven tech</li>
|
||
</ul>
|
||
</section>
|
||
<section id="the-game-competitive-sudoku" class="slide level2">
|
||
<h2>The game: 🎲<br/> Competitive sudoku</h2>
|
||
<ul>
|
||
<li>Trusted entity inits competition</li>
|
||
<li>Contestants register</li>
|
||
<li>Game master sets puzzle + multiple prizes</li>
|
||
<li>Contestant claims a prize with proof of solution</li>
|
||
</ul>
|
||
<p>By the powers of zk, the claim does not disclose the solution</p>
|
||
</section>
|
||
<section id="the-snark-groth16" class="slide level2">
|
||
<h2>The Snark: Groth16</h2>
|
||
<p>Why <a href="https://eprint.iacr.org/2016/260.pdf">groth16</a>?</p>
|
||
<ul>
|
||
<li>Relatively mature</li>
|
||
<li>Relatively simple</li>
|
||
<li>Can be implemented with the new primitives in plutus</li>
|
||
<li>Has the smallest proof size</li>
|
||
</ul>
|
||
<p>All of these make it the right choice for a first zk snark alg</p>
|
||
</section>
|
||
<section id="components-tooling" class="slide level2">
|
||
<h2>Components ⚒️ tooling</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/arkworks-rs">Arkworks</a> framework:
|
||
generate groth16 setup and proofs</li>
|
||
<li>Plutus-tx: handling plutus validators</li>
|
||
</ul>
|
||
</section></section>
|
||
<section>
|
||
<section id="how-its-going" class="title-slide slide level1">
|
||
<h1>How it’s going?</h1>
|
||
|
||
</section>
|
||
<section id="links" class="slide level2">
|
||
<h2>Links</h2>
|
||
<ul>
|
||
<li>🟩 rust-lib</li>
|
||
<li>🟩 haskell-lib</li>
|
||
<li>🟨 cardano-api</li>
|
||
<li>🟨 cardano-node</li>
|
||
<li>🟥 hydra</li>
|
||
</ul>
|
||
<p><span style="font-size:1rem"> ( 🟩 done — 🟨 more progress required —
|
||
🟥 much more to do ) </span></p>
|
||
</section>
|
||
<section id="what-didnt-get-done" class="slide level2">
|
||
<h2>What didn’t get done?</h2>
|
||
<ul>
|
||
<li>By far the most time was sunk dependency-wrangling Cardano libs,
|
||
trying to bump plutus version in a Cardano node</li>
|
||
<li>We managed to have a dev cluster running but key tx building
|
||
features are missing for conway era</li>
|
||
<li>No Cardano node ==> no hydra</li>
|
||
</ul>
|
||
</section>
|
||
<section id="other-to-dos" class="slide level2">
|
||
<h2>Other to-dos 📋</h2>
|
||
<ul>
|
||
<li>Tau ceremony for setup</li>
|
||
<li>Proper implementation for poseidon hash</li>
|
||
<li>Select a fix for a replay attack <em>eg</em> additional public input
|
||
and using script context</li>
|
||
<li>Complete constraints in circuit</li>
|
||
<li>Sexy frontend <em>etc</em></li>
|
||
</ul>
|
||
</section></section>
|
||
<section>
|
||
<section id="beyond-sudoku-snark" class="title-slide slide level1">
|
||
<h1>Beyond sudoku snark</h1>
|
||
|
||
</section>
|
||
<section id="sudoku-snark-is-probably-not-the-killer-zk-app-what-is"
|
||
class="slide level2">
|
||
<h2>Sudoku snark is probably not the killer zk app <br/> What is?</h2>
|
||
</section>
|
||
<section id="privacy-on-public-ledgers" class="slide level2">
|
||
<h2>🕵️ Privacy on public ledgers</h2>
|
||
<ul>
|
||
<li>Privacy on blockchains like Cardano is a problem (see articles
|
||
<em>ad nauseum</em>)</li>
|
||
<li>zk can make it harder to track who’s transacting with whom</li>
|
||
<li>There are L1s dedicated to resolving this like <a
|
||
href="https://z.cash/">zcash</a> and <a
|
||
href="https://www.getmonero.org/">monero</a></li>
|
||
<li>There are dapps on existing chains like <a
|
||
href="https://www.railgun.org/">railgun</a> on Eth</li>
|
||
</ul>
|
||
</section>
|
||
<section id="privacy-on-cardano" class="slide level2">
|
||
<h2>Privacy on cardano</h2>
|
||
<ul>
|
||
<li>Cardano needs a privacy solution</li>
|
||
<li>This can be achieved with a zk dapp</li>
|
||
<li>There are use cases for having this both on the L1 and on L2s</li>
|
||
</ul>
|
||
<p>Sudoku snark gives us a foundation on tooling, zk gadgets, and even a
|
||
choice of snark</p>
|
||
</section>
|
||
<section id="from-here-to-there" class="slide level2">
|
||
<h2>From here to there 🧗</h2>
|
||
<ul>
|
||
<li>🟩 Merkle tree gadgets</li>
|
||
<li>🟩 Distributed lists</li>
|
||
<li>🟨 Tau ceremony or plonk</li>
|
||
<li>🟨 Hydra with latest plutus</li>
|
||
<li>🟨 Hydra with incremental de/-commits</li>
|
||
<li>🟨 A system for tx fee sponsorship</li>
|
||
<li>🟥 Wrap up into an dapp</li>
|
||
</ul>
|
||
<p><span style="font-size:1rem"> ( 🟩 easy — 🟨 more work needed — 🟥
|
||
even more work … ) </span></p>
|
||
</section></section>
|
||
<section>
|
||
<section id="why-this-should-win" class="title-slide slide level1">
|
||
<h1>Why this 🏆<br/> should win?</h1>
|
||
|
||
</section>
|
||
<section id="section-1" class="slide level2">
|
||
<h2></h2>
|
||
<ul>
|
||
<li>Sudoku snark is true to the spirit of this hackathon and track: a
|
||
genuine zk dapp running on Cardano</li>
|
||
<li>We are at the absolute bleeding edge of what is possible</li>
|
||
<li>This PoC shows fundamental components for zk dapps on Cardano are
|
||
already here</li>
|
||
<li>We have a clear roadmap from here to a killer zk dapp</li>
|
||
</ul>
|
||
</section></section>
|
||
<section>
|
||
<section id="the-team" class="title-slide slide level1">
|
||
<h1>The team</h1>
|
||
|
||
</section>
|
||
<section id="waalge" class="slide level2"
|
||
data-background-image="./assets/dp.jpg" data-background-opacity="0.3">
|
||
<h2 data-background-image="./assets/dp.jpg"
|
||
data-background-opacity="0.3"><span class="citation"
|
||
data-cites="waalge">@waalge</span></h2>
|
||
<ul>
|
||
<li>Chief of <a href="https://kompact.io">Kompact.io</a></li>
|
||
<li>2 years building around cardano (eg guchi.io)</li>
|
||
<li>Previously full stack dev, ML/NLP researcher</li>
|
||
<li>PhD in geometry</li>
|
||
</ul>
|
||
<p><a href="https://www.linkedin.com/in/dominic-algernon-wallis-123b42187/">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" height="80" preserveAspectRatio="xMidYMid meet" fill="white">
|
||
<!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
|
||
<path
|
||
d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z" />
|
||
</svg> </a> — <a href="https://twitter.com/waalge">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="80" preserveAspectRatio="xMidYMid meet" fill="white">
|
||
<!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
|
||
<path
|
||
d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z" />
|
||
</svg> </a></p>
|
||
</section>
|
||
<section id="thank-you" class="slide level2">
|
||
<h2>Thank you 🙏</h2>
|
||
<p>Any questions? Please get in touch</p>
|
||
</section></section>
|
||
</div>
|
||
</div>
|
||
|
||
<script src="https://unpkg.com/reveal.js@^4//dist/reveal.js"></script>
|
||
|
||
<!-- reveal.js plugins -->
|
||
<script src="https://unpkg.com/reveal.js@^4//plugin/notes/notes.js"></script>
|
||
<script src="https://unpkg.com/reveal.js@^4//plugin/search/search.js"></script>
|
||
<script src="https://unpkg.com/reveal.js@^4//plugin/zoom/zoom.js"></script>
|
||
|
||
<script>
|
||
|
||
// Full list of configuration options available at:
|
||
// https://revealjs.com/config/
|
||
Reveal.initialize({
|
||
// Display controls in the bottom right corner
|
||
controls: true,
|
||
|
||
// Help the user learn the controls by providing hints, for example by
|
||
// bouncing the down arrow when they first encounter a vertical slide
|
||
controlsTutorial: true,
|
||
|
||
// Determines where controls appear, "edges" or "bottom-right"
|
||
controlsLayout: 'bottom-right',
|
||
|
||
// Visibility rule for backwards navigation arrows; "faded", "hidden"
|
||
// or "visible"
|
||
controlsBackArrows: 'faded',
|
||
|
||
// Display a presentation progress bar
|
||
progress: true,
|
||
|
||
// Display the page number of the current slide
|
||
slideNumber: false,
|
||
|
||
// 'all', 'print', or 'speaker'
|
||
showSlideNumber: 'all',
|
||
|
||
// Add the current slide number to the URL hash so that reloading the
|
||
// page/copying the URL will return you to the same slide
|
||
hash: true,
|
||
|
||
// Start with 1 for the hash rather than 0
|
||
hashOneBasedIndex: false,
|
||
|
||
// Flags if we should monitor the hash and change slides accordingly
|
||
respondToHashChanges: true,
|
||
|
||
// Push each slide change to the browser history
|
||
history: false,
|
||
|
||
// Enable keyboard shortcuts for navigation
|
||
keyboard: true,
|
||
|
||
// Enable the slide overview mode
|
||
overview: true,
|
||
|
||
// Disables the default reveal.js slide layout (scaling and centering)
|
||
// so that you can use custom CSS layout
|
||
disableLayout: false,
|
||
|
||
// Vertical centering of slides
|
||
center: true,
|
||
|
||
// Enables touch navigation on devices with touch input
|
||
touch: true,
|
||
|
||
// Loop the presentation
|
||
loop: false,
|
||
|
||
// Change the presentation direction to be RTL
|
||
rtl: false,
|
||
|
||
// see https://revealjs.com/vertical-slides/#navigation-mode
|
||
navigationMode: 'default',
|
||
|
||
// Randomizes the order of slides each time the presentation loads
|
||
shuffle: false,
|
||
|
||
// Turns fragments on and off globally
|
||
fragments: true,
|
||
|
||
// Flags whether to include the current fragment in the URL,
|
||
// so that reloading brings you to the same fragment position
|
||
fragmentInURL: true,
|
||
|
||
// Flags if the presentation is running in an embedded mode,
|
||
// i.e. contained within a limited portion of the screen
|
||
embedded: false,
|
||
|
||
// Flags if we should show a help overlay when the questionmark
|
||
// key is pressed
|
||
help: true,
|
||
|
||
// Flags if it should be possible to pause the presentation (blackout)
|
||
pause: true,
|
||
|
||
// Flags if speaker notes should be visible to all viewers
|
||
showNotes: false,
|
||
|
||
// Global override for autoplaying embedded media (null/true/false)
|
||
autoPlayMedia: null,
|
||
|
||
// Global override for preloading lazy-loaded iframes (null/true/false)
|
||
preloadIframes: null,
|
||
|
||
// Number of milliseconds between automatically proceeding to the
|
||
// next slide, disabled when set to 0, this value can be overwritten
|
||
// by using a data-autoslide attribute on your slides
|
||
autoSlide: 0,
|
||
|
||
// Stop auto-sliding after user input
|
||
autoSlideStoppable: true,
|
||
|
||
// Use this method for navigation when auto-sliding
|
||
autoSlideMethod: null,
|
||
|
||
// Specify the average time in seconds that you think you will spend
|
||
// presenting each slide. This is used to show a pacing timer in the
|
||
// speaker view
|
||
defaultTiming: null,
|
||
|
||
// Enable slide navigation via mouse wheel
|
||
mouseWheel: false,
|
||
|
||
// The display mode that will be used to show slides
|
||
display: 'block',
|
||
|
||
// Hide cursor if inactive
|
||
hideInactiveCursor: true,
|
||
|
||
// Time before the cursor is hidden (in ms)
|
||
hideCursorTime: 5000,
|
||
|
||
// Opens links in an iframe preview overlay
|
||
previewLinks: false,
|
||
|
||
// Transition style (none/fade/slide/convex/concave/zoom)
|
||
transition: 'slide',
|
||
|
||
// Transition speed (default/fast/slow)
|
||
transitionSpeed: 'default',
|
||
|
||
// Transition style for full page slide backgrounds
|
||
// (none/fade/slide/convex/concave/zoom)
|
||
backgroundTransition: 'fade',
|
||
|
||
// Number of slides away from the current that are visible
|
||
viewDistance: 3,
|
||
|
||
// Number of slides away from the current that are visible on mobile
|
||
// devices. It is advisable to set this to a lower number than
|
||
// viewDistance in order to save resources.
|
||
mobileViewDistance: 2,
|
||
|
||
// Parallax background image
|
||
parallaxBackgroundImage: './assets/background.svg', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
|
||
|
||
// reveal.js plugins
|
||
plugins: [
|
||
RevealNotes,
|
||
RevealSearch,
|
||
RevealZoom
|
||
]
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|