diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..92ad0ab8e --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +zkkit.pse.dev \ No newline at end of file diff --git a/assets/highlight.css b/assets/highlight.css new file mode 100644 index 000000000..bcf3e8fd5 --- /dev/null +++ b/assets/highlight.css @@ -0,0 +1,127 @@ +:root { + --light-hl-0: #795E26; + --dark-hl-0: #DCDCAA; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #A31515; + --dark-hl-2: #CE9178; + --light-hl-3: #0000FF; + --dark-hl-3: #569CD6; + --light-hl-4: #008000; + --dark-hl-4: #6A9955; + --light-hl-5: #001080; + --dark-hl-5: #9CDCFE; + --light-hl-6: #800000; + --dark-hl-6: #808080; + --light-hl-7: #800000; + --dark-hl-7: #569CD6; + --light-hl-8: #000000FF; + --dark-hl-8: #D4D4D4; + --light-hl-9: #E50000; + --dark-hl-9: #9CDCFE; + --light-hl-10: #0000FF; + --dark-hl-10: #CE9178; + --light-hl-11: #AF00DB; + --dark-hl-11: #C586C0; + --light-hl-12: #0070C1; + --dark-hl-12: #4FC1FF; + --light-hl-13: #098658; + --dark-hl-13: #B5CEA8; + --light-hl-14: #267F99; + --dark-hl-14: #4EC9B0; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); + --hl-12: var(--light-hl-12); + --hl-13: var(--light-hl-13); + --hl-14: var(--light-hl-14); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); + --hl-12: var(--dark-hl-12); + --hl-13: var(--dark-hl-13); + --hl-14: var(--dark-hl-14); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --hl-10: var(--light-hl-10); + --hl-11: var(--light-hl-11); + --hl-12: var(--light-hl-12); + --hl-13: var(--light-hl-13); + --hl-14: var(--light-hl-14); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --hl-10: var(--dark-hl-10); + --hl-11: var(--dark-hl-11); + --hl-12: var(--dark-hl-12); + --hl-13: var(--dark-hl-13); + --hl-14: var(--dark-hl-14); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +.hl-9 { color: var(--hl-9); } +.hl-10 { color: var(--hl-10); } +.hl-11 { color: var(--hl-11); } +.hl-12 { color: var(--hl-12); } +.hl-13 { color: var(--hl-13); } +.hl-14 { color: var(--hl-14); } +pre, code { background: var(--code-background); } diff --git a/assets/main.js b/assets/main.js new file mode 100644 index 000000000..d0aa8d5f9 --- /dev/null +++ b/assets/main.js @@ -0,0 +1,59 @@ +"use strict"; +"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/assets/navigation.js b/assets/navigation.js new file mode 100644 index 000000000..501e1c0d3 --- /dev/null +++ b/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WXW0/bMBTHv0ueYQw02MbT1goGgrJqrfYAQpVJThMriR3ZDmuZ+O5z0qRxEt+qPed/fufSc3Gf/gYCNiK4DL69pccpFichZmGJBQ+OggKJRH7JaVRmwE9Wb+lKKlat4kMi8kzKUkyi4PLs/WjEgiji6LigHHBEiZlY61atbsA9CsIEZxEDElw+7V1McPxQ5i/AOqrYFmbmXj+gf/z6+fRcjX0vxDw5lC1NXPg5xUR4cmutC7jAMUGiZOAJ3etd4Ejm8wrz8iXD4R1sO/y6JKHAlBhdDCz7ji4+KT64DGYGnKMYDuArVhb2q4xivdWUx8kfWI58PGtaPWZUJKcX5h5vBF7NPd1NWB1BpkyibAdgaxRqsH2TgZfzCyXiHzuLOaN07YVWDWxgOQOycOFCMExiUze20J7YOTR1K43KoSf3xF7Tk/1GWQlLSXOxB3IX/fHuOxNYVtU48S24U7qYL6Xslwk5Pfti6+iW26ktk1Iw+mqdj5ZWC50j50PaKb0mC+fCPFXyo9dE3c6WHSTMEOcDiBT0QbJkSjD3gIiT0YhsHPn5BvHkuimMqS2aiFSpqy+kfAYszWAw2FqwovTgPtDIOBkNsJK4SE15fPPXyD09eNZhrNbzdU2ZobetoH/U58ewNfcSrwa9l+plpa7ynSYIE2v8Hdxg6CyV3mxS7Qs1q/EIO103DK/hbm/ucdHPdljMVrcqNMnpKzpHYQqRtYoDqmLhfsbtLA/CqzbOw0QQS9ubYLx5Aw99I5eLGAgwJKybf+CgNfmvGzBgHnAKuO0UcM9TsLCt8QqysK/wKyLY9hfwQuak1E7zgKpgPbXt9aRdWgaoeWX1kNMq+2ozG/ungnUqV8PUudhQtcCLMpON6iRVIhfN55pUwEPOSO/fzhg1+kszJtguZoXwOZcLLN+xJLb+dq3GxapfrDZQLXBRwgTC9AY2tuGuYK3OsiViENeYcTGleU7JVQY5EHXN6cF6K7ubWxLB5uf6HnHxQMkjMNrYeTgz2lpcJrBZ0gkmLnyrs6BSkOd1XkEcrL1Qs0Wf/wE0iVHN4xEAAA==" \ No newline at end of file diff --git a/assets/search.js b/assets/search.js new file mode 100644 index 000000000..2e60af5c1 --- /dev/null +++ b/assets/search.js @@ -0,0 +1 @@ +window.searchData = "data:application/octet-stream;base64,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"; \ No newline at end of file diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 000000000..07a385b73 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,1394 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-icon-background: var(--light-color-background); + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + --light-color-link: #1f70c2; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: var(--light-color-ts-variable); + --light-color-ts-method: var(--light-color-ts-function); + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: var(--light-color-ts-type-alias); + --light-color-ts-accessor: var(--light-color-ts-property); + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + --dark-color-link: #00aff4; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: var(--dark-color-ts-variable); + --dark-color-ts-method: var(--dark-color-ts-function); + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: var(--dark-color-ts-type-alias); + --dark-color-ts-accessor: var(--dark-color-ts-property); + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } +} + +html { + color-scheme: var(--color-scheme); +} + +body { + margin: 0; +} + +:root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); +} + +:root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1 > a, +h2 > a, +h3 > a, +h4 > a, +h5 > a, +h6 > a { + text-decoration: none; + color: var(--color-text); +} + +h1 { + font-size: 1.875rem; + margin: 0.67rem 0; +} + +h2 { + font-size: 1.5rem; + margin: 0.83rem 0; +} + +h3 { + font-size: 1.25rem; + margin: 1rem 0; +} + +h4 { + font-size: 1.05rem; + margin: 1.33rem 0; +} + +h5 { + font-size: 1rem; + margin: 1.5rem 0; +} + +h6 { + font-size: 0.875rem; + margin: 2.33rem 0; +} + +.uppercase { + text-transform: uppercase; +} + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +.container { + max-width: 1700px; + padding: 0 2rem; +} + +/* Footer */ +.tsd-generator { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: 3.5rem; +} + +.tsd-generator > p { + margin-top: 0; + margin-bottom: 0; + padding: 0 1rem; +} + +.container-main { + margin: 0 auto; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } +} +@keyframes fade-in-delayed { + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fade-out-delayed { + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } +} +@keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } +} +@keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } +} +body { + background: var(--color-background); + font-family: "Segoe UI", sans-serif; + font-size: 16px; + color: var(--color-text); +} + +a { + color: var(--color-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; +} + +code, +pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; +} + +pre { + position: relative; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + border: 1px solid var(--color-accent); +} +pre code { + padding: 0; + font-size: 100%; +} +pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; +} +pre:hover > button, +pre > button.visible { + opacity: 1; +} + +blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; +} + +.tsd-typography { + line-height: 1.333em; +} +.tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; +} +.tsd-typography .tsd-index-panel h3, +.tsd-index-panel .tsd-typography h3, +.tsd-typography h4, +.tsd-typography h5, +.tsd-typography h6 { + font-size: 1em; +} +.tsd-typography h5, +.tsd-typography h6 { + font-weight: normal; +} +.tsd-typography p, +.tsd-typography ul, +.tsd-typography ol { + margin: 1em 0; +} +.tsd-typography table { + border-collapse: collapse; + border: none; +} +.tsd-typography td, +.tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); +} +.tsd-typography thead, +.tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); +} + +.tsd-breadcrumb { + margin: 0; + padding: 0; + color: var(--color-text-aside); +} +.tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; +} +.tsd-breadcrumb a:hover { + text-decoration: underline; +} +.tsd-breadcrumb li { + display: inline; +} +.tsd-breadcrumb li:after { + content: " / "; +} + +.tsd-comment-tags { + display: flex; + flex-direction: column; +} +dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; +} +dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; +} +dl.tsd-comment-tag-group dd { + margin: 0; +} +code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; +} +h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; +} + +dl.tsd-comment-tag-group dd:before, +dl.tsd-comment-tag-group dd:after { + content: " "; +} +dl.tsd-comment-tag-group dd pre, +dl.tsd-comment-tag-group dd:after { + clear: both; +} +dl.tsd-comment-tag-group p { + margin: 0; +} + +.tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; +} +.tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; +} + +.tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; +} +.tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; +} +.tsd-filter-input { + display: flex; + width: fit-content; + width: -moz-fit-content; + align-items: center; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + cursor: pointer; +} +.tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; +} +.tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; +} +.tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; +} +.tsd-filter-input input[type="checkbox"]:focus + svg { + transform: scale(0.95); +} +.tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg { + transform: scale(1); +} +.tsd-checkbox-background { + fill: var(--color-accent); +} +input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); +} + +.tsd-theme-toggle { + padding-top: 0.75rem; +} +.tsd-theme-toggle > h4 { + display: inline; + vertical-align: middle; + margin-right: 0.75rem; +} + +.tsd-hierarchy { + list-style: square; + margin: 0; +} +.tsd-hierarchy .target { + font-weight: bold; +} + +.tsd-panel-group.tsd-index-group { + margin-bottom: 0; +} +.tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; +} +@media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } +} +.tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; +} + +.tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; +} + +.tsd-anchor { + position: relative; + top: -100px; +} + +.tsd-member { + position: relative; +} +.tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; +} + +.tsd-navigation.settings { + margin: 1rem 0; +} +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.5rem); +} +.tsd-navigation a, +.tsd-navigation summary > span, +.tsd-page-navigation a { + display: inline-flex; + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); +} +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { + text-decoration: underline; +} +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; +} +.tsd-navigation li, +.tsd-page-navigation li { + padding: 0; + max-width: 100%; +} +.tsd-nested-navigation { + margin-left: 3rem; +} +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; +} +.tsd-small-nested-navigation { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; +} + +.tsd-nested-navigation > li > a, +.tsd-nested-navigation > li > span { + width: calc(100% - 1.75rem - 0.5rem); +} + +.tsd-page-navigation ul { + padding-left: 1.75rem; +} + +#tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; +} +#tsd-sidebar-links a:last-of-type { + margin-bottom: 0; +} + +a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} +.tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ +} +.tsd-accordion-summary, +.tsd-accordion-summary a { + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + + cursor: pointer; +} +.tsd-accordion-summary a { + width: calc(100% - 1.5rem); +} +.tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} +.tsd-index-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-kind-icon path { + transform-origin: center; + transform: scale(1.1); +} +.tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; +} + +.tsd-panel { + margin-bottom: 2.5rem; +} +.tsd-panel.tsd-member { + margin-bottom: 4rem; +} +.tsd-panel:empty { + display: none; +} +.tsd-panel > h1, +.tsd-panel > h2, +.tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; +} +.tsd-panel > h1.tsd-before-signature, +.tsd-panel > h2.tsd-before-signature, +.tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; +} + +.tsd-panel-group { + margin: 4rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} + +#tsd-search { + transition: background-color 0.2s; +} +#tsd-search .title { + position: relative; + z-index: 2; +} +#tsd-search .field { + position: absolute; + left: 0; + top: 0; + right: 2.5rem; + height: 100%; +} +#tsd-search .field input { + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); +} +#tsd-search .field label { + position: absolute; + overflow: hidden; + right: -40px; +} +#tsd-search .field input, +#tsd-search .title, +#tsd-toolbar-links a { + transition: opacity 0.2s; +} +#tsd-search .results { + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); +} +#tsd-search .results li { + background-color: var(--color-background); + line-height: initial; + padding: 4px; +} +#tsd-search .results li:nth-child(even) { + background-color: var(--color-background-secondary); +} +#tsd-search .results li.state { + display: none; +} +#tsd-search .results li.current:not(.no-results), +#tsd-search .results li:hover:not(.no-results) { + background-color: var(--color-accent); +} +#tsd-search .results a { + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; +} +#tsd-search .results a:before { + top: 10px; +} +#tsd-search .results span.parent { + color: var(--color-text-aside); + font-weight: normal; +} +#tsd-search.has-focus { + background-color: var(--color-accent); +} +#tsd-search.has-focus .field input { + top: 0; + opacity: 1; +} +#tsd-search.has-focus .title, +#tsd-search.has-focus #tsd-toolbar-links a { + z-index: 0; + opacity: 0; +} +#tsd-search.has-focus .results { + visibility: visible; +} +#tsd-search.loading .results li.state.loading { + display: block; +} +#tsd-search.failure .results li.state.failure { + display: block; +} + +#tsd-toolbar-links { + position: absolute; + top: 0; + right: 2rem; + height: 100%; + display: flex; + align-items: center; + justify-content: flex-end; +} +#tsd-toolbar-links a { + margin-left: 1.5rem; +} +#tsd-toolbar-links a:hover { + text-decoration: underline; +} + +.tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; +} + +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + +.tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; +} + +.tsd-signature-type { + font-style: italic; + font-weight: normal; +} + +.tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; +} +.tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; +} +.tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; +} + +ul.tsd-parameter-list, +ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; +} +ul.tsd-parameter-list > li.tsd-parameter-signature, +ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; +} +ul.tsd-parameter-list h5, +ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; +} +.tsd-sources { + margin-top: 1rem; + font-size: 0.875em; +} +.tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; +} +.tsd-sources ul { + list-style: none; + padding: 0; +} + +.tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: 1px var(--color-accent) solid; + transition: transform 0.3s ease-in-out; +} +.tsd-page-toolbar a { + color: var(--color-text); + text-decoration: none; +} +.tsd-page-toolbar a.title { + font-weight: bold; +} +.tsd-page-toolbar a.title:hover { + text-decoration: underline; +} +.tsd-page-toolbar .tsd-toolbar-contents { + display: flex; + justify-content: space-between; + height: 2.5rem; + margin: 0 auto; +} +.tsd-page-toolbar .table-cell { + position: relative; + white-space: nowrap; + line-height: 40px; +} +.tsd-page-toolbar .table-cell:first-child { + width: 100%; +} +.tsd-page-toolbar .tsd-toolbar-icon { + box-sizing: border-box; + line-height: 0; + padding: 12px 0; +} + +.tsd-widget { + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: + opacity 0.1s, + background-color 0.2s; + vertical-align: bottom; + cursor: pointer; +} +.tsd-widget:hover { + opacity: 0.9; +} +.tsd-widget.active { + opacity: 1; + background-color: var(--color-accent); +} +.tsd-widget.no-caption { + width: 40px; +} +.tsd-widget.no-caption:before { + margin: 0; +} + +.tsd-widget.options, +.tsd-widget.menu { + display: none; +} +input[type="checkbox"] + .tsd-widget:before { + background-position: -120px 0; +} +input[type="checkbox"]:checked + .tsd-widget:before { + background-position: -160px 0; +} + +img { + max-width: 100%; +} + +.tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + vertical-align: middle; + color: var(--color-text); +} + +.tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; +} + +.tsd-anchor-link:hover > .tsd-anchor-icon svg { + visibility: visible; +} + +.deprecated { + text-decoration: line-through !important; +} + +.warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); +} + +.tsd-kind-project { + color: var(--color-ts-project); +} +.tsd-kind-module { + color: var(--color-ts-module); +} +.tsd-kind-namespace { + color: var(--color-ts-namespace); +} +.tsd-kind-enum { + color: var(--color-ts-enum); +} +.tsd-kind-enum-member { + color: var(--color-ts-enum-member); +} +.tsd-kind-variable { + color: var(--color-ts-variable); +} +.tsd-kind-function { + color: var(--color-ts-function); +} +.tsd-kind-class { + color: var(--color-ts-class); +} +.tsd-kind-interface { + color: var(--color-ts-interface); +} +.tsd-kind-constructor { + color: var(--color-ts-constructor); +} +.tsd-kind-property { + color: var(--color-ts-property); +} +.tsd-kind-method { + color: var(--color-ts-method); +} +.tsd-kind-call-signature { + color: var(--color-ts-call-signature); +} +.tsd-kind-index-signature { + color: var(--color-ts-index-signature); +} +.tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); +} +.tsd-kind-parameter { + color: var(--color-ts-parameter); +} +.tsd-kind-type-literal { + color: var(--color-ts-type-literal); +} +.tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); +} +.tsd-kind-accessor { + color: var(--color-ts-accessor); +} +.tsd-kind-get-signature { + color: var(--color-ts-get-signature); +} +.tsd-kind-set-signature { + color: var(--color-ts-set-signature); +} +.tsd-kind-type-alias { + color: var(--color-ts-type-alias); +} + +/* if we have a kind icon, don't color the text by kind */ +.tsd-kind-icon ~ span { + color: var(--color-text); +} + +* { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); +} + +*::-webkit-scrollbar { + width: 0.75rem; +} + +*::-webkit-scrollbar-track { + background: var(--color-icon-background); +} + +*::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); +} + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem 0; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/classes/_zk_kit_imt.IMT.html b/classes/_zk_kit_imt.IMT.html new file mode 100644 index 000000000..b9f295616 --- /dev/null +++ b/classes/_zk_kit_imt.IMT.html @@ -0,0 +1,87 @@ +IMT | ZK-kit

An IMT (aka Incremental Merkle Tree) is a type of data structure used in cryptography and +computer science for efficiently verifying the integrity of a large set of data, +especially in situations where new data is added over time. It is based on the concept +of a Merkle tree, and its key feature is its ability to efficiently update the tree +when new data is added or existing data is modified. +In this implementation, the tree is constructed using a fixed IMT#depth +value, and a list of IMT#zeroes (one for each level) is used to compute the +hash of a node when not all of its children are defined. The number of children for each +node can also be specified with the IMT#arity parameter.

+

Constructors

  • It initializes the tree with an hash function, the depth, the zero value to use for zeroes +and the arity (i.e. the number of children for each node). It also takes an optional parameter +to initialize the tree with a list of leaves.

    +

    Parameters

    • hash: IMTHashFunction

      The hash function used to create nodes.

      +
    • depth: number

      The tree depth.

      +
    • zeroValue: any

      The zero value used to create zeroes.

      +
    • arity: number = 2

      The number of children for each node.

      +
    • leaves: any[] = []

      The list of initial leaves.

      +

    Returns IMT

Properties

_arity: number

The number of children per node.

+
_depth: number

The depth of the tree, which is the number of edges from the node to the +tree's root node.

+

The hash function used to compute the tree nodes.

+
_nodes: any[][]

The matrix where all the tree nodes are stored. The first index indicates +the level of the tree, while the second index represents the node's +position within that specific level.

+
_zeroes: any[]

A list of zero values calculated during the initialization of the tree. +The list contains one value for each level of the tree, and the value for +a given level is equal to the hash of the previous level's value. +The first value is the zero hash provided by the user. +These values are used to calculate the hash of a node in case some of its +children are missing.

+

Accessors

  • get arity(): number
  • The number of children per node.

    +

    Returns number

    The number of children per node.

    +
  • get depth(): number
  • The depth of the tree, which equals the number of levels - 1.

    +

    Returns number

    The depth of the tree.

    +
  • get leaves(): any[]
  • The leaves of the tree. They can be retrieved from the first +level of the tree using IMT#_nodes. The returned +value is a copy of the array and not the original object.

    +

    Returns any[]

    The list of tree leaves.

    +
  • get root(): any
  • The root of the tree. This value doesn't need to be stored as +it is always the first and unique element of the last level of the tree. +Its value can be retrieved in IMT#_nodes.

    +

    Returns any

    The root hash of the tree.

    +
  • get zeroes(): any[]
  • The list of zero values calculated during the initialization of the tree.

    +

    Returns any[]

    The list of pre-computed zeroes.

    +

Methods

  • It creates a IMTMerkleProof for a leaf of the tree. +That proof can be verified by this tree using the same hash function.

    +

    Parameters

    • index: number

      The index of the leaf for which a Merkle proof will be generated.

      +

    Returns IMTMerkleProof

    The Merkle proof of the leaf.

    +
  • It deletes a leaf from the tree. It does not remove the leaf from +the data structure, but rather it sets the leaf to be deleted to the zero value.

    +

    Parameters

    • index: number

      The index of the leaf to be deleted.

      +

    Returns void

  • It returns the index of a leaf. If the leaf does not exist it returns -1.

    +

    Parameters

    • leaf: any

      A leaf of the tree.

      +

    Returns number

    The index of the leaf.

    +
  • The leaves are inserted incrementally. If 'i' is the index of the last +leaf, the new one will be inserted at position 'i + 1'. Every time a +new leaf is inserted, the nodes that separate the new leaf from the root +of the tree are created or updated if they already exist, from bottom to top. +When a node has only one child (the left one), its value is the hash of that +node and the zero value of that level. Otherwise, the hash of the children +is calculated.

    +

    Parameters

    • leaf: any

      The new leaf to be inserted in the tree.

      +

    Returns void

  • It updates a leaf in the tree. It's very similar to the IMT#insert function.

    +

    Parameters

    • index: number

      The index of the leaf to be updated.

      +
    • newLeaf: any

      The new leaf to be inserted.

      +

    Returns void

  • It verifies a IMTMerkleProof to confirm that a leaf indeed +belongs to the tree.

    +

    Parameters

    Returns boolean

    True if the leaf is part of the tree, and false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/_zk_kit_imt.LeanIMT.html b/classes/_zk_kit_imt.LeanIMT.html new file mode 100644 index 000000000..89a1e624b --- /dev/null +++ b/classes/_zk_kit_imt.LeanIMT.html @@ -0,0 +1,74 @@ +LeanIMT | ZK-kit

Class LeanIMT<N>

The LeanIMT is an optimized binary version of the IMT. +This implementation exclusively supports binary trees, eliminates the use of +zeroes, and the tree's LeanIMT#depth is dynamic. When a node doesn't have the right child, +instead of using a zero hash as in the IMT, the node's value becomes that +of its left child. Furthermore, rather than utilizing a static tree depth, +it is updated based on the number of LeanIMT#leaves in the tree. This approach +results in the calculation of significantly fewer hashes, making the tree more efficient.

+

Type Parameters

  • N = bigint

Constructors

Properties

Accessors

Methods

Constructors

  • It initializes the tree with a given hash function and an optional list of leaves.

    +

    Type Parameters

    • N = bigint

    Parameters

    • hash: LeanIMTHashFunction<N>

      The hash function used to create nodes.

      +
    • leaves: N[] = []

      The list of leaves.

      +

    Returns LeanIMT<N>

Properties

The hash function used to compute the tree nodes.

+
_nodes: N[][]

The matrix where all the tree nodes are stored. The first index indicates +the level of the tree, while the second index represents the node's +position within that specific level. The last level will always contain +a list with a single element, which is the root. +Most of the attributes of this class are getters which can retrieve +their values from this matrix.

+

Accessors

  • get depth(): number
  • The depth of the tree, which equals the number of levels - 1.

    +

    Returns number

    The depth of the tree.

    +
  • get leaves(): N[]
  • The leaves of the tree. They can be retrieved from the first +level of the tree using LeanIMT#_nodes. The returned +value is a copy of the array and not the original object.

    +

    Returns N[]

    The list of tree leaves.

    +
  • get root(): N
  • The root of the tree. This value doesn't need to be stored as +it is always the first and unique element of the last level of the tree. +Its value can be retrieved in LeanIMT#_nodes.

    +

    Returns N

    The root hash of the tree.

    +
  • get size(): number
  • The size of the tree, which the number of its leaves. +It's the length of the first level's list.

    +

    Returns number

    The number of leaves of the tree.

    +

Methods

  • It returns true if the leaf exists, and false otherwise

    +

    Parameters

    • leaf: N

      A leaf of the tree.

      +

    Returns boolean

    True if the tree has the leaf, and false otherwise.

    +
  • It returns the index of a leaf. If the leaf does not exist it returns -1.

    +

    Parameters

    • leaf: N

      A leaf of the tree.

      +

    Returns number

    The index of the leaf.

    +
  • The leaves are inserted incrementally. If 'i' is the index of the last +leaf, the new one will be inserted at position 'i + 1'. Every time a +new leaf is inserted, the nodes that separate the new leaf from the root +of the tree are created or updated if they already exist, from bottom to top. +When a node has only one child (the left one), its value takes on the value +of the child. Otherwise, the hash of the children is calculated.

    +

    Parameters

    • leaf: N

      The new leaf to be inserted in the tree.

      +

    Returns void

  • This function is useful when you want to insert N leaves all at once. +It is more efficient than using the LeanIMT#insert method N times because it +significantly reduces the number of cases where a node has only one +child, which is a common occurrence in gradual insertion.

    +

    Parameters

    • leaves: N[]

      The list of leaves to be inserted.

      +

    Returns void

  • It updates a leaf in the tree. It's very similar to the LeanIMT#insert function.

    +

    Parameters

    • index: number

      The index of the leaf to be updated.

      +
    • newLeaf: N

      The new leaf to be inserted.

      +

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/_zk_kit_smt.SMT.html b/classes/_zk_kit_smt.SMT.html new file mode 100644 index 000000000..afa16888f --- /dev/null +++ b/classes/_zk_kit_smt.SMT.html @@ -0,0 +1,95 @@ +SMT | ZK-kit

SparseMerkleTree class provides all the functions to create a sparse Merkle tree +and to take advantage of its features: SMT.add, SMT.get, +SMT.update, SMT.delete, SMT.createProof, +SMT.verifyProof. +To better understand the code below it may be useful to describe the terminology used:

+
    +
  • nodes: every node in the tree is the hash of the two child nodes (H(x, y));
  • +
  • root node: the root node is the top hash and since it represents the whole data +structure it can be used to certify its integrity;
  • +
  • leaf nodes: every leaf node is the hash of a key/value pair and an additional +value to mark the node as leaf node (H(x, y, 1));
  • +
  • entry: a tree entry is a key/value pair used to create the leaf nodes;
  • +
  • zero nodes: a zero node is an hash of zeros and in this implementation H(0,0) = 0;
  • +
  • siblings: the children of a parent node are siblings;
  • +
  • path: every entry key is a number < 2^256 that can be converted in a binary number, +and this binary number is the path used to place the entry in the tree (1 or 0 define the +child node to choose);
  • +
  • matching node: when an entry is not found and the path leads to another existing entry, +this entry is a matching entry and it has some of the first bits in common with the entry not found;
  • +
  • depth: the depth of a node is the length of the path to its root.
  • +
+

Constructors

  • Initializes the SparseMerkleTree attributes.

    +

    Parameters

    • hash: HashFunction

      Hash function used to hash the child nodes.

      +
    • bigNumbers: boolean = false

      BigInt type enabling.

      +

    Returns SMT

Properties

bigNumbers: boolean
entryMark: Node
nodes: Map<Node, ChildNodes>
root: Node
zeroNode: Node

Methods

  • Adds a new entry in the tree. It retrieves a matching entry +or a zero node with a top-down approach and then it updates all the +hashes of the nodes in the path of the new entry with a bottom-up approach.

    +

    Parameters

    • key: Node

      The key of the new entry.

      +
    • value: Node

      The value of the new entry.

      +

    Returns void

  • Adds new nodes in the tree with a bottom-up approach until it reaches the root node.

    +

    Parameters

    • node: Node

      The node to start from.

      +
    • path: number[]

      The path of the key.

      +
    • siblings: Siblings

      The siblings of the path.

      +
    • i: number = ...

      The index to start from.

      +

    Returns Node

    The root node.

    +
  • Calculates nodes with a bottom-up approach until it reaches the root node.

    +

    Parameters

    • node: Node

      The node to start from.

      +
    • path: number[]

      The path of the key.

      +
    • siblings: Siblings

      The siblings of the path.

      +

    Returns Node

    The root node.

    +
  • Checks the parameter type.

    +

    Parameters

    • parameter: Node

      The parameter to check.

      +

    Returns void

  • Creates a proof to prove the membership or the non-membership +of a tree entry.

    +

    Parameters

    • key: Node

      A key of an existing or a non-existing entry.

      +

    Returns MerkleProof

    The membership or the non-membership proof.

    +
  • Deletes an entry in the tree. Also in this case all the hashes of +the nodes in the path of the entry are updated with a bottom-up approach.

    +

    Parameters

    • key: Node

      The key of the entry.

      +

    Returns void

  • Deletes nodes in the tree with a bottom-up approach until it reaches the root node.

    +

    Parameters

    • node: Node

      The node to start from.

      +
    • path: number[]

      The path of the key.

      +
    • siblings: Siblings

      The siblings of the path.

      +

    Returns void

  • Gets a key and if the key exists in the tree the function returns the +value, otherwise it returns 'undefined'.

    +

    Parameters

    • key: Node

      A key of a tree entry.

      +

    Returns undefined | Node

    A value of a tree entry or 'undefined'.

    +
  • Checks if a node is a leaf node.

    +

    Parameters

    • node: Node

      A node of the tree.

      +

    Returns boolean

    True if the node is a leaf, false otherwise.

    +
  • Searches for an entry in the tree. If the key passed as parameter exists in +the tree, the function returns the entry, otherwise it returns the entry +with only the key, and when there is another existing entry +in the same path it returns also this entry as 'matching entry'. +In any case the function returns the siblings of the path.

    +

    Parameters

    • key: Node

      The key of the entry to search for.

      +

    Returns EntryResponse

    The entry response.

    +
  • Updates a value of an entry in the tree. Also in this case +all the hashes of the nodes in the path of the entry are updated +with a bottom-up approach.

    +

    Parameters

    • key: Node

      The key of the entry.

      +
    • value: Node

      The value of the entry.

      +

    Returns void

  • Verifies a membership or a non-membership proof.

    +

    Parameters

    Returns boolean

    True if the proof is valid, false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_eddsa_poseidon.derivePublicKey.html b/functions/_zk_kit_eddsa_poseidon.derivePublicKey.html new file mode 100644 index 000000000..61432035e --- /dev/null +++ b/functions/_zk_kit_eddsa_poseidon.derivePublicKey.html @@ -0,0 +1,8 @@ +derivePublicKey | ZK-kit
  • Derives a public key from a given private key using the +Jubjub elliptic curve. +This function utilizes the Baby Jubjub elliptic curve for cryptographic operations. +The private key should be securely stored and managed, and it should never be exposed +or transmitted in an unsecured manner.

    +

    Parameters

    • privateKey: BigNumberish

      The private key used for generating the public key.

      +

    Returns Point<string>

    The derived public key.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_eddsa_poseidon.signMessage.html b/functions/_zk_kit_eddsa_poseidon.signMessage.html new file mode 100644 index 000000000..5d6530adf --- /dev/null +++ b/functions/_zk_kit_eddsa_poseidon.signMessage.html @@ -0,0 +1,6 @@ +signMessage | ZK-kit
  • Signs a message using the provided private key, employing Poseidon hashing and +EdDSA with the Baby Jubjub elliptic curve.

    +

    Parameters

    Returns Signature<string>

    The signature object, containing properties relevant to EdDSA signatures, such as 'R8' and 'S' values.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_eddsa_poseidon.verifySignature.html b/functions/_zk_kit_eddsa_poseidon.verifySignature.html new file mode 100644 index 000000000..9592ca12d --- /dev/null +++ b/functions/_zk_kit_eddsa_poseidon.verifySignature.html @@ -0,0 +1,6 @@ +verifySignature | ZK-kit
  • Verifies an EdDSA signature using the Baby Jubjub elliptic curve and Poseidon hash function.

    +

    Parameters

    • message: BigNumberish

      The original message that was be signed.

      +
    • signature: Signature<BigNumber>

      The EdDSA signature to be verified.

      +
    • publicKey: Point<BigNumber>

      The public key associated with the private key used to sign the message.

      +

    Returns boolean

    Returns true if the signature is valid and corresponds to the message and public key, false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_groth16.buildBn128.html b/functions/_zk_kit_groth16.buildBn128.html new file mode 100644 index 000000000..030ecbdbf --- /dev/null +++ b/functions/_zk_kit_groth16.buildBn128.html @@ -0,0 +1,4 @@ +buildBn128 | ZK-kit
  • Builds and returns a BN 128 curve. If the curve has been cached, +it returns the cached curve.

    +

    Returns Promise<any>

    BN 128 ffjavascript curve.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_groth16.prove.html b/functions/_zk_kit_groth16.prove.html new file mode 100644 index 000000000..1a531bdbd --- /dev/null +++ b/functions/_zk_kit_groth16.prove.html @@ -0,0 +1,6 @@ +prove | ZK-kit
  • Creates a Groth16 proof composed of public signals and zero-knowledge parameters.

    +

    Parameters

    Returns Promise<{
        proof: Groth16Proof;
        publicSignals: PublicSignals;
    }>

    A proof containing public signals and zero-knowledge parameters.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_groth16.verify.html b/functions/_zk_kit_groth16.verify.html new file mode 100644 index 000000000..096bdf10e --- /dev/null +++ b/functions/_zk_kit_groth16.verify.html @@ -0,0 +1,5 @@ +verify | ZK-kit
  • Verifies if a Groth16 proof is valid or not.

    +

    Parameters

    • verificationKey: any

      The verification key used to verify the proof.

      +
    • proof: {
          proof: Groth16Proof;
          publicSignals: PublicSignals;
      }

      The proof containing public signals and zero-knowledge parameters.

      +

    Returns Promise<boolean>

    True if the proof is valid, and false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_lazytower.LazyTowerHashChainProofBuilder.html b/functions/_zk_kit_lazytower.LazyTowerHashChainProofBuilder.html new file mode 100644 index 000000000..0f1224759 --- /dev/null +++ b/functions/_zk_kit_lazytower.LazyTowerHashChainProofBuilder.html @@ -0,0 +1,12 @@ +LazyTowerHashChainProofBuilder | ZK-kit

Function LazyTowerHashChainProofBuilder

  • LazyTowerHashChainProofBuilder is a TypeScript implementation of LazyTower to generate proofs of membership.

    +

    Parameters

    • H: number

      Height of tower of the proving circuit. It can be less than the H in the contract.

      +
    • W: number

      Width of tower.

      +
    • hash: ((a, b) => bigint) = defaultHash

      A hash function which supports 2 input values.

      +
        • (a, b): bigint
        • Parameters

          • a: bigint
          • b: bigint

          Returns bigint

    Returns {
        add: ((item) => void);
        build: ((idx) => LazyTowerHashChainProof);
        indexOf: ((item) => number);
    }

    • add: ((item) => void)
        • (item): void
        • Adds a new item in the LazyTower.

          +

          Parameters

          • item: bigint

            Item to be added.

            +

          Returns void

    • build: ((idx) => LazyTowerHashChainProof)
    • indexOf: ((item) => number)
        • (item): number
        • Returns the index of a item. If the item does not exist it returns -1.

          +

          Parameters

          • item: bigint

            Added item.

            +

          Returns number

          Index of the item.

          +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_poseidon_proof.generate.html b/functions/_zk_kit_poseidon_proof.generate.html new file mode 100644 index 000000000..735c26d9c --- /dev/null +++ b/functions/_zk_kit_poseidon_proof.generate.html @@ -0,0 +1,14 @@ +generate | ZK-kit
  • Creates a zero-knowledge proof to prove that you have the pre-image of a hash, +without disclosing the actual preimage itself. +The use of a scope parameter along with a nullifier helps ensure the uniqueness +and non-reusability of the proofs, enhancing security in applications like +blockchain transactions or private data verification. +If, for example, this package were used with Semaphore to demonstrate possession +of a Semaphore identity of a group of voters, the scope could be the poll's ID.

    +

    Parameters

    • preimage: number | bigint | BytesLike | Hexable

      The preimage of the hash.

      +
    • scope: number | bigint | BytesLike | Hexable

      A public value used to contextualize the cryptographic proof +and calculate the nullifier.

      +
    • Optional snarkArtifacts: SnarkArtifacts

      The Snark artifacts (wasm and zkey files) generated in +a trusted setup of the circuit are necessary to generate valid proofs

      +

    Returns Promise<PoseidonProof>

    The Poseidon zero-knowledge proof.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_poseidon_proof.verify.html b/functions/_zk_kit_poseidon_proof.verify.html new file mode 100644 index 000000000..c06278cd4 --- /dev/null +++ b/functions/_zk_kit_poseidon_proof.verify.html @@ -0,0 +1,4 @@ +verify | ZK-kit
  • Verifies that a Poseidon proof is valid.

    +

    Parameters

    Returns Promise<boolean>

    True if the proof is valid, false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_smt.checkHex.html b/functions/_zk_kit_smt.checkHex.html new file mode 100644 index 000000000..408a305aa --- /dev/null +++ b/functions/_zk_kit_smt.checkHex.html @@ -0,0 +1,4 @@ +checkHex | ZK-kit

Function checkHex

  • Checks if a number is a hexadecimal number.

    +

    Parameters

    • n: string

      A hexadecimal number.

      +

    Returns boolean

    True if the number is a hexadecimal, false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_smt.getFirstCommonElements.html b/functions/_zk_kit_smt.getFirstCommonElements.html new file mode 100644 index 000000000..685616162 --- /dev/null +++ b/functions/_zk_kit_smt.getFirstCommonElements.html @@ -0,0 +1,5 @@ +getFirstCommonElements | ZK-kit

Function getFirstCommonElements

  • Returns the first common elements of two arrays.

    +

    Parameters

    • array1: any[]

      The first array.

      +
    • array2: any[]

      The second array.

      +

    Returns any[]

    The array of the first common elements.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_smt.getIndexOfLastNonZeroElement.html b/functions/_zk_kit_smt.getIndexOfLastNonZeroElement.html new file mode 100644 index 000000000..d3d34cf3d --- /dev/null +++ b/functions/_zk_kit_smt.getIndexOfLastNonZeroElement.html @@ -0,0 +1,5 @@ +getIndexOfLastNonZeroElement | ZK-kit

Function getIndexOfLastNonZeroElement

  • Returns the index of the last non-zero element of an array. +If there are only zero elements the function returns -1.

    +

    Parameters

    • array: any[]

      An array of hexadecimal or big numbers.

      +

    Returns number

    The index of the last non-zero element.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_smt.hexToBin.html b/functions/_zk_kit_smt.hexToBin.html new file mode 100644 index 000000000..50912369c --- /dev/null +++ b/functions/_zk_kit_smt.hexToBin.html @@ -0,0 +1,4 @@ +hexToBin | ZK-kit

Function hexToBin

  • Converts a hexadecimal number to a binary number.

    +

    Parameters

    • n: string

      A hexadecimal number.

      +

    Returns string

    The relative binary number.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_zk_kit_smt.keyToPath.html b/functions/_zk_kit_smt.keyToPath.html new file mode 100644 index 000000000..cc6a3d67b --- /dev/null +++ b/functions/_zk_kit_smt.keyToPath.html @@ -0,0 +1,5 @@ +keyToPath | ZK-kit

Function keyToPath

  • Returns the binary representation of a key. For each key it is possibile +to obtain an array of 256 padded bits.

    +

    Parameters

    • key: string | bigint

      The key of a tree entry.

      +

    Returns number[]

    The relative array of bits.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 000000000..f86604f4d --- /dev/null +++ b/index.html @@ -0,0 +1,315 @@ +ZK-kit

ZK-kit

+

+ 🧰 ZK-kit +

+

A monorepo of reusable libraries for zero-knowledge technologies.

+

+ +

+ + + + + Github license + + + GitHub Workflow test + + + Coveralls + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
ZK-kit is a set of libraries (plugins, algorithms or utility functions) that can be reused in different projects and zero-knowledge protocols, making it easier for developers to access user-friendly, tested, and documented libraries for common tasks.
+

Yarn workspaces: minimal monorepo package management (yarn, yarn build, yarn docs)
Conventional Commits: human and machine readable meaning to commit messages (yarn commit)
Jest: tests and test coverage for all libraries (yarn test:libraries)
Mocha: tests for circuits and contracts (yarn test:circuits, yarn test:contracts)
ESLint, Prettier: code quality and formatting (yarn prettier & yarn lint)
Typedocs: documentation generator for TypeScript (yarn docs)
Benny: simple benchmarking framework for JavaScript/TypeScript (yarn benchmarks)
Github actions: software workflows for automatic testing, documentation deploy and code quality checks

+

📦 Packages

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageVersionDownloadsSize
+ + @zk-kit/circuits + + + + + NPM version + + + + + Downloads + +
+ + @zk-kit/eddsa-poseidon + + + (docs) + + + + + NPM version + + + + + Downloads + + + + + npm bundle size (scoped) + +
+ + @zk-kit/imt + + + (docs) + + + + + NPM version + + + + + Downloads + + + + + npm bundle size (scoped) + +
+ + @zk-kit/imt.sol + + + + + NPM version + + + + + Downloads + +
+ + @zk-kit/smt + + + (docs) + + + + + NPM version + + + + + Downloads + + + + + npm bundle size (scoped) + +
+ + @zk-kit/poseidon-proof + + + (docs) + + + + + NPM version + + + + + Downloads + + + + + npm bundle size (scoped) + +
+ + @zk-kit/groth16 + + + + + NPM version + + + + + Downloads + + + + + npm bundle size (scoped) + +
+ + @zk-kit/rollup-plugin-rust + + + + + NPM version + + + + + Downloads + + + + + npm bundle size (scoped) + +
+ +

👥 Ways to contribute

+

🛠 Install

Clone this repository:

+
git clone https://github.com/privacy-scaling-explorations/zk-kit.git
+
+

and install the dependencies:

+
cd zk-kit && yarn
+
+

📜 Usage

Code quality and formatting

Run ESLint to analyze the code and catch bugs:

+
yarn lint
+
+

Run Prettier to check formatting rules:

+
yarn prettier
+
+

or to automatically format the code:

+
yarn prettier:write
+
+

Conventional commits

Semaphore uses conventional commits. A command line utility to commit using the correct syntax can be used by running:

+
yarn commit
+
+

It will also automatically check that the modified files comply with ESLint and Prettier rules.

+

Testing

Test the code:

+
yarn test
+
+

Build

Build all the packages and compile contracts:

+
yarn build
+
+

A dist folder will be created inside each JavaScript package.

+

Documentation

Generate a documentation website for each package:

+
yarn docs
+
+

The output will be placed on the docs folder.

+

❓ FAQ

I have a library that could be reused in other projects. How can I integrate it on ZK-kit?

ZK-kit provides a set of pre-configured development tools. All you have to deal with is your own code, testing and documentation. To create a package follow these steps:

+
    +
  1. Fork this repository and clone it (or simply clone it directly if you are a collaborator),
  2. +
  3. Copy one of our current libraries and update the README.md and package.json files with your package name:
  4. +
+
cd zk-kit
cp -r packages/smt packages/my-package
cd packages/my-package && rm -fr node_modules dist
grep -r -l "smt" . | xargs sed -i 's/smt/my-package/'
# Update the remaining description/usage sections, and write your code in the src & tests folders! +
+
    +
  1. Create an issue for your package and open a PR.
  2. +
+

How can I create benchmarks for my library?

You can see some examples in the benchmarks folder. All you have to do is create a file that exports a function to run your benchmark in that folder, and add that function to the index.ts file. The yarn benchmarks command can be run with no parameters (it will run all the benchmarks), or you can specify the name of your benchmark file to run just that. When you run the command it will create a benchmarks/results folder with your results.

+

Generated using TypeDoc

\ No newline at end of file diff --git a/interfaces/_zk_kit_groth16.CircuitSignals.html b/interfaces/_zk_kit_groth16.CircuitSignals.html new file mode 100644 index 000000000..64de5456a --- /dev/null +++ b/interfaces/_zk_kit_groth16.CircuitSignals.html @@ -0,0 +1 @@ +CircuitSignals | ZK-kit

Interface CircuitSignals

interface CircuitSignals {
    [signal: string]: SignalValueType;
}

Indexable

[signal: string]: SignalValueType

Generated using TypeDoc

\ No newline at end of file diff --git a/interfaces/_zk_kit_groth16.Groth16Proof.html b/interfaces/_zk_kit_groth16.Groth16Proof.html new file mode 100644 index 000000000..69bd783f4 --- /dev/null +++ b/interfaces/_zk_kit_groth16.Groth16Proof.html @@ -0,0 +1,6 @@ +Groth16Proof | ZK-kit

Interface Groth16Proof

interface Groth16Proof {
    curve: string;
    pi_a: string[];
    pi_b: string[][];
    pi_c: string[];
    protocol: string;
}

Properties

Properties

curve: string
pi_a: string[]
pi_b: string[][]
pi_c: string[]
protocol: string

Generated using TypeDoc

\ No newline at end of file diff --git a/interfaces/_zk_kit_smt.EntryResponse.html b/interfaces/_zk_kit_smt.EntryResponse.html new file mode 100644 index 000000000..e1ac4dcf9 --- /dev/null +++ b/interfaces/_zk_kit_smt.EntryResponse.html @@ -0,0 +1,4 @@ +EntryResponse | ZK-kit

Interface EntryResponse

interface EntryResponse {
    entry: Entry | Node[];
    matchingEntry?: Entry | Node[];
    siblings: Siblings;
}

Hierarchy

Properties

entry: Entry | Node[]
matchingEntry?: Entry | Node[]
siblings: Siblings

Generated using TypeDoc

\ No newline at end of file diff --git a/interfaces/_zk_kit_smt.MerkleProof.html b/interfaces/_zk_kit_smt.MerkleProof.html new file mode 100644 index 000000000..317be9c4a --- /dev/null +++ b/interfaces/_zk_kit_smt.MerkleProof.html @@ -0,0 +1,6 @@ +MerkleProof | ZK-kit

Interface MerkleProof

interface MerkleProof {
    entry: Entry | Node[];
    matchingEntry?: Entry | Node[];
    membership: boolean;
    root: Node;
    siblings: Siblings;
}

Hierarchy

Properties

entry: Entry | Node[]
matchingEntry?: Entry | Node[]
membership: boolean
root: Node
siblings: Siblings

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_zk_kit_circuits.html b/modules/_zk_kit_circuits.html new file mode 100644 index 000000000..325f37f67 --- /dev/null +++ b/modules/_zk_kit_circuits.html @@ -0,0 +1,67 @@ +@zk-kit/circuits | ZK-kit

Module @zk-kit/circuits

+

+ ZK-kit circuits +

+

A comprehensive library of general-purpose zero-knowledge circuits.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + +

+ + + + + + + + + +
This package offers a collection of reusable circuits designed for integration into other projects or protocols, promoting code modularization within the zero-knowledge ecosystem.
+
+

[!IMPORTANT]
Installation of Circom and Nargo required for circuit tests.

+
+

Circuits

    +
  • Circom:
      +
    • PoseidonProof: It proves the possession of a Poseidon pre-image without revealing the pre-image itself.
    • +
    • BinaryMerkleRoot: It calculates the root of a binary Merkle tree using a provided proof-of-membership.
    • +
    +
  • +
  • Noir:
      +
    • Sparse Merkle Tree PoseidonBN254: A reusable library of functions related to Sparse Merkle Trees based on the JS implementation of @zk-kit/smt. The library uses the Poseidon hash to implement the following functions:
        +
      • verifying membership and non-membership proofs
      • +
      • adding a new entry to a SMT
      • +
      • updating an entry of an SMT
      • +
      • deleting an existing entry from an SMT
      • +
      +
    • +
    +
  • +
+

🛠 Install

Using NPM or Yarn (Circom circuits)

Install the @zk-kit/circuits package with npm:

+
npm i @zk-kit/circuits --save
+
+

or yarn:

+
yarn add @zk-kit/circuits
+
+

Using Nargo (Noir circuits)

In your Nargo.toml file, add the following dependency:

+
[dependencies]
smt_bn254 = { tag = "v0.1.0", git = "https://github.com/privacy-scaling-explorations/zk-kit/packages/circuits/noir", directory="crates/smt_bn254" } +
+

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_zk_kit_eddsa_poseidon.html b/modules/_zk_kit_eddsa_poseidon.html new file mode 100644 index 000000000..88c999c91 --- /dev/null +++ b/modules/_zk_kit_eddsa_poseidon.html @@ -0,0 +1,90 @@ +@zk-kit/eddsa-poseidon | ZK-kit

Module @zk-kit/eddsa-poseidon

+

+ EdDSA Poseidon +

+

A JavaScript EdDSA library for secure signing and verification using Poseidon and the Baby Jubjub elliptic curve.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + npm bundle size (scoped) + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This package offers a simplified JavaScript codebase essential for creating and validating digital signatures using EdDSA and Poseidon. It's built upon the Baby Jubjub elliptic curve, ensuring seamless integration with Circom and enhancing the developer experience.
+
    +
  • Super lightweight: ~33kB (minified)
  • +
  • Compatible with browsers and NodeJS
  • +
  • TS type support
  • +
  • Comprehensive code documentation
  • +
  • Full test coverage
  • +
+

👾 Would you like to try it now? Explore it now on Ceditor!

+
+

[!WARNING]
This library has not been audited.

+
+

🛠 Install

npm or yarn

Install the @zk-kit/eddsa-poseidon package and its peer dependencies with npm:

+
npm i @zk-kit/eddsa-poseidon
+
+

or yarn:

+
yarn add @zk-kit/eddsa-poseidon
+
+

CDN

You can also load it using a script tag using unpkg:

+
<script src="https://unpkg.com/@zk-kit/eddsa-poseidon"></script>
+
+

or JSDelivr:

+
<script src="https://cdn.jsdelivr.net/npm/@zk-kit/eddsa-poseidon"></script>
+
+

📜 Usage

# derivePublicKey(privateKey: BigNumberish): Point<string>

+
import { derivePublicKey } from "@zk-kit/eddsa-poseidon"

const privateKey = "secret"
const publicKey = derivePublicKey(privateKey)

console.log(publicKey)
/*
[
'17191193026255111087474416516591393721975640005415762645730433950079177536248',
'13751717961795090314625781035919035073474308127816403910435238282697898234143'
]
*/ +
+

# signMessage(privateKey: BigNumberish, message: BigNumberish): Signature<string>

+
import { derivePublicKey, signMessage } from "@zk-kit/eddsa-poseidon"

const privateKey = "secret"
const publicKey = derivePublicKey(privateKey)

const message = "message"
const signature = signMessage(privateKey, message)

console.log(signature)
/*
{
R8: [
'12949573675545142400102669657964360005184873166024880859462384824349649539693',
'18253636630408169174294927826710424418689461166073329946402765380454102840608'
],
S: '701803947557694254685424075312408605924670918868054593580245088593184746870'
}
*/ +
+

# verifySignature(message: BigNumberish, signature: Signature, publicKey: Point): boolean

+
import { derivePublicKey, signMessage, verifySignature } from "@zk-kit/eddsa-poseidon"

const privateKey = "secret"
const publicKey = derivePublicKey(privateKey)

const message = "message"
const signature = signMessage(privateKey, message)

const response = verifySignature(message, signature, publicKey)

console.log(response) // true +
+

Index

Type Aliases

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_zk_kit_groth16.html b/modules/_zk_kit_groth16.html new file mode 100644 index 000000000..6e6136dc0 --- /dev/null +++ b/modules/_zk_kit_groth16.html @@ -0,0 +1,88 @@ +@zk-kit/groth16 | ZK-kit

Module @zk-kit/groth16

+

+ SnarkJS Groth16 +

+

A snippet of SnarkJS code for verifying and generating Groth16 proofs only.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + npm bundle size (scoped) + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This package contains SnarkJS functions for generating and verifying zero knowledge proofs with Groth16 specifically. In addition to the original code it also uses the cached bn128 curve if it already exists, making verification and generation of consecutive proofs faster.
+

Some advantages of using this package instead of snarkjs directly are:

+
    +
  • It only includes code to verify and generate Groth16 proofs, making your final bundle lighter.
  • +
  • It doesn't call the ffjavascript buildBn128 function if a bn128 cached curve already exists, making verification and generation of consecutive proofs much faster (e.g. verification seems to be ~9 times faster after the first one).
  • +
  • It includes TS types.
  • +
  • It provides an ESM bundle that is compatible with browsers. So there is no need to add any polyfill or additional configuration.
  • +
+

🛠 Install

npm or yarn

Install the @zk-kit/groth16 package and its peer dependencies with npm:

+
npm i @zk-kit/groth16
+
+

or yarn:

+
yarn add @zk-kit/groth16
+
+

📜 Usage

# prove(input: CircuitSignals, wasmFile: ZKArtifact, zkeyFile: ZKArtifact): Promise<_{ +proof: Groth16Proof +publicSignals: PublicSignals +}_>

+
import { prove } from "@zk-kit/groth16"

const input = {
message: 12,
scope: 122
}

const proof = await prove(input, "./circuit.zkey", "./circuit.wasm")

console.log(proof)
/*
{
proof: {
pi_a: [
'8259885706934172848141475422209230656096448508815982888010519325096632035723',
'3142099172052192611205205328157407975469005554072266974009053708782134081166',
'1'
],
pi_b: [ [Array], [Array], [Array] ],
pi_c: [
'13863804425308906943736719856399634046638544298517159271373916818387594277305',
'21340646707244019956779928177502771923632450548108204371058275686712196195969',
'1'
],
protocol: 'groth16',
curve: 'bn128'
},
publicSignals: [
'527758365153958423212195330785598453331596731388181860789801455413116800554',
'19104626566001952573667666924569656871967113105870778077087237826253896482830',
'122'
]
}
*/ +
+

# verify(verificationKey: any, proof: { +proof: Groth16Proof +publicSignals: PublicSignals +}): Promise<_boolean_>

+
import { verify } from "@zk-kit/groth16"
import verificationKey from "./circuit.json"

const response = await verify(verificationKey, proof)

console.log(response) // true +
+

# buildBn128(): Promise<_any_>

+
import { buildBn128 } from "@zk-kit/groth16"

const curve = await buildBn128() // WasmField1
// https://github.com/iden3/ffjavascript/blob/master/src/wasm_field1.js +
+

Index

Interfaces

Type Aliases

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_zk_kit_imt.html b/modules/_zk_kit_imt.html new file mode 100644 index 000000000..ad61075fa --- /dev/null +++ b/modules/_zk_kit_imt.html @@ -0,0 +1,72 @@ +@zk-kit/imt | ZK-kit

Module @zk-kit/imt

+

+ Incremental Merkle Trees +

+

Incremental Merkle tree implementations in TypeScript.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + npm bundle size (scoped) + + + Linter eslint + + + Code style prettier + +

+ + + +
+

[!WARNING]
If you are looking for the first version of this package, please visit this link.

+
+
+

🛠 Install

npm or yarn

Install the @zk-kit/imt package with npm:

+
npm i @zk-kit/imt --save
+
+

or yarn:

+
yarn add @zk-kit/imt
+
+

CDN

You can also load it using a script tag using unpkg:

+
<script src="https://unpkg.com/@zk-kit/imt"></script>
+
+

or JSDelivr:

+
<script src="https://cdn.jsdelivr.net/npm/@zk-kit/imt"></script>
+
+

📜 Usage

This package currently provides two implementations of incremental Merkle trees: IMT and LeanIMT. The former supports several degrees (i.e. arity), while the latter is a binary tree optimization. More information on their properties can be found in the ZK-Kit documentation.

+

IMT (doc)

import { IMT } from "@zk-kit/imt"
import { poseidon2 } from "poseidon-lite"

const depth = 16
const zeroValue = 0
const arity = 2 // Binary tree.

const tree = new IMT(poseidon2, depth, zeroValue, arity)

tree.insert(1)
tree.insert(3)

tree.root
tree.zeroes
tree.arity // 2
tree.depth // 1
tree.leaves // [1, 3]

tree.indexOf(3) // 1

tree.update(1, 2) // tree1.leaves -> [1, 2]

tree.delete(1) // tree1.leaves -> [1, 0]

const proof = tree.createProof(1)

tree.verifyProof(proof) // true

// You can also initialize a tree with a list of leaves.
new IMT(poseidon2, depth, zeroValue, arity, [1, 2, 3]) +
+

LeanIMT (doc)

import { LeanIMT } from "@zk-kit/imt"
import { poseidon2 } from "poseidon-lite"

const hash = (a, b) => poseidon2([a, b])

const tree = new LeanIMT(hash)

tree.insert(1n)
tree.insert(3n)

tree.root
tree.depth // 1
tree.size // 2
tree.leaves // [1n, 3n]

tree.indexOf(3n) // 1
tree.has(4n) // false

tree.update(1, 2n) // tree1.leaves -> [1n, 2n]

const proof = tree.generateProof(1)

tree.verifyProof(proof) // true

// You can initialize a tree with a list of leaves.
new LeanIMT(hash, [1n, 2n, 3n])

// LeanIMT is strictly typed. Default type for nodes is 'bigint',
// but you can set your own type.
new LeanIMT<number>((a, b) => a + b) +
+

Index

Classes

Type Aliases

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_zk_kit_lazytower.html b/modules/_zk_kit_lazytower.html new file mode 100644 index 000000000..1ec89484f --- /dev/null +++ b/modules/_zk_kit_lazytower.html @@ -0,0 +1,67 @@ +@zk-kit/lazytower | ZK-kit

Module @zk-kit/lazytower

+

+ LazyTower +

+

LazyTower implementation in TypeScript.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + npm bundle size (scoped) + + + Linter eslint + + + Code style prettier + +

+ + + +
+

❗ WARNING

This library has not been audited.

+

🛠 Install

npm or yarn

Install the @zk-kit/lazytower package with npm:

+
npm i @zk-kit/lazytower --save
+
+

or yarn:

+
yarn add @zk-kit/lazytower
+
+

CDN

You can also load it using a script tag using unpkg:

+
<script src="https://unpkg.com/@zk-kit/lazytower/"></script>
+
+

or JSDelivr:

+
<script src="https://cdn.jsdelivr.net/npm/@zk-kit/lazytower/"></script>
+
+

📜 Usage

import { LazyTowerHashChainProofBuilder } from "@zk-kit/lazytower"
import { poseidon } from "circomlibjs" // v0.0.8

const H = 10
const W = 4
const pb = LazyTowerHashChainProofBuilder(H, W, poseidon)
for (let i = BigInt(0); i < 150; i += BigInt(1)) {
pb.add(i)
}
const index = pb.indexOf(BigInt(42))
const proof = pb.build(index)
console.log(proof) +
+

Contacts

Developers

+

Index

Type Aliases

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_zk_kit_poseidon_proof.html b/modules/_zk_kit_poseidon_proof.html new file mode 100644 index 000000000..dc76e2e10 --- /dev/null +++ b/modules/_zk_kit_poseidon_proof.html @@ -0,0 +1,99 @@ +@zk-kit/poseidon-proof | ZK-kit

Module @zk-kit/poseidon-proof

+

+ Poseidon proof +

+

A library to generate and verify Poseidon proofs.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + npm bundle size (scoped) + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This zero-knowledge library facilitates the demonstration of having a Poseidon hash pre-image while keeping the pre-image value confidential. Additionally, it offers a mechanism to prevent the same proof from being reused. The circuit that forms the foundation of this library is accessible via this link.
+

Originally developed for integration with Semaphore V4, this library also functions effectively as a standalone tool. Notable use cases in connection with Semaphore can be:

+
    +
  • allowing a Semaphore user to prove that they possess the secret value associated with the identity commitment of their Semaphore identity,
  • +
  • unmasking the identity of zero-knowledge proofs earlier created using Semaphore.
  • +
+

The Snark artifacts (.wasm and .zkey files) can be specified or not in the generate function parameters and can possibly be downloaded using the following URLs:

+

https://github.com/privacy-scaling-explorations/zk-kit/blob/ee457299d36d2601e5bf520237977a9f16b1b599/packages/poseidon-proof/src/config.ts#L5-L8

+
+

[!WARNING]
The Snark artifacts currently used to generate zero-knowledge proofs are the result of an unsecure trusted setup, and the library has not yet been audited. Therefore, it is advised not to use it in production.

+
+

🛠 Install

npm or yarn

Install the @zk-kit/poseidon-proof package:

+
npm i @zk-kit/poseidon-proof
+
+

or yarn:

+
yarn add @zk-kit/poseidon-proof
+
+

📜 Usage

# generate( +message: BigNumberish, +scope: BigNumberish, +snarkArtifacts?: SnarkArtifacts +): Promise<_PoseidonProof_>

+
import { generate } from "@zk-kit/poseidon-proof"

const scope = 1
const message = 2

const fullProof = await generate(message, scope)

// If not specified, the Snark artifacts are downloaded automatically.
// You can also specify them.
const fullProof2 = await generate(message, scope, {
zkeyFilePath: "./poseidon-proof.zkey",
wasmFilePath: "./poseidon-proof.wasm"
})

console.log(fullProof)
/*
{
scope: '1',
hash: '8645981980787649023086883978738420856660271013038108762834452721572614684349',
nullifier: '7853200120776062878684798364095072458815029376092732009249414926327459813530',
proof: [
'8439157877715136449451128027974582198942685548176158240742469858289217640295',
'7742778415084033741154475792823260193410560424636243716622958831215275441500',
'19005176609208302398813682947612978224483117018101271134113308439452561466691',
'6209272538382784759793219866517186573065390524051102537220446165983489601194',
'12222537243697573476419214640884921904066033266502734603198915705889607365883',
'20066191345466355816238393590466176790809335456890624395337970890893401456064',
'4851746896803117511000878727783002155680855098198108089136166702412365578625',
'18391775232946751568173446051923718267369779168471637305003186214102154164036'
]
}
*/ +
+

# verify(poseidonProof: PoseidonProof): Promise<_boolean_>

+
import { verify } from "@zk-kit/poseidon-proof"

const response = await verify(fullProof)

console.log(response) // true or false

// Eventually you may want to check the nullifier. +
+

📈 Benchmarks

Benchmarks were run on an Intel Core i7-1165G7, 16 GB RAM machine, after initializing the BN128 curve with @zk-kit/groth16-buildBn128 (~230ms).

+ + + + + + + + + + + + + +
Generate proofVerify proofConstraints
80ms10ms141
+
import { generate, verify } from "@zk-kit/poseidon-proof"
import { buildBn128 } from "@zk-kit/groth16"

await buildBn128()

console.time("generate")

const proof = await generate(1, 2)

console.timeEnd("generate")

console.time("verify")

console.log(await verify(proof))

console.timeEnd("verify") +
+

Index

Type Aliases

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_zk_kit_smt.html b/modules/_zk_kit_smt.html new file mode 100644 index 000000000..f55552ef4 --- /dev/null +++ b/modules/_zk_kit_smt.html @@ -0,0 +1,106 @@ +@zk-kit/smt | ZK-kit

Module @zk-kit/smt

+

+ Sparse Merkle tree +

+

Sparse Merkle tree implementation in TypeScript.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + npm bundle size (scoped) + + + Linter eslint + + + Code style prettier + +

+ + + +

A sparse Merkle tree is a data structure useful for storing a key/value map where every leaf node of the tree contains the cryptographic hash of a key/value pair and every non leaf node contains the concatenated hashes of its child nodes. Sparse Merkle trees provides a secure and efficient verification of large data sets and they are often used in peer-to-peer technologies. This implementation is an optimized version of the traditional sparse Merkle tree and it is based on the concepts expressed in the papers and resources below.

+

References

    +
  1. Rasmus Dahlberg, Tobias Pulls and Roel Peeters. Efficient Sparse Merkle Trees: Caching Strategies and Secure (Non-)Membership Proofs. Cryptology ePrint Archive: Report 2016/683, 2016. https://eprint.iacr.org/2016/683.
  2. +
  3. Faraz Haider. Compact sparse merkle trees. Cryptology ePrint Archive: Report 2018/955, 2018. https://eprint.iacr.org/2018/955.
  4. +
  5. Jordi Baylina and Marta Bellés. Sparse Merkle Trees. https://docs.iden3.io/publications/pdfs/Merkle-Tree.pdf.
  6. +
  7. Vitalik Buterin Fichter. Optimizing sparse Merkle trees. https://ethresear.ch/t/optimizing-sparse-merkle-trees/3751.
  8. +
+
+

Install

npm or yarn

You can install @zk-kit/smt package with npm:

+
npm i @zk-kit/smt --save
+
+

or yarn:

+
yarn add @zk-kit/smt
+
+

CDN

You can also load it using a script tag using unpkg:

+
<script src="https://unpkg.com/@zk-kit/smt"></script>
+
+

or JSDelivr:

+
<script src="https://cdn.jsdelivr.net/npm/@zk-kit/smt"></script>
+
+

📜 Usage

# new SMT(hash: HashFunction, bigNumbers?: boolean): SMT

+
import { SMT } from "@zk-kit/smt"
import sha256 from "crypto-js/sha256"
import { poseidon } from "circomlibjs"

// Hexadecimal hashes.
const hash = (childNodes: ChildNodes) => sha256(childNodes.join("")).toString()
const tree = new SMT(hash)

// Big number hashes.
const hash2 = (childNodes: ChildNodes) => poseidon(childNodes)
const tree2 = new SMT(hash2, true)

console.log(tree.root) // 0
console.log(tree2.root) // 0n +
+

# add(key: string | number, value: string | number): void

+
tree.add("2b", "44") // Hexadecimal key/value.
tree.add("16", "78")
tree.add("d", "e7")
tree.add("10", "141")
tree.add("20", "340")

console.log(tree.root) // 31ee2a59741c9c32a32d8c7fafe461cca1ccaf5986c2d592586e3e6482a48645 +
+

# get(key: string | number): undefined | string

+
const value = tree.get("16")

console.log(value) // 78 +
+

# update(key: string | number, value: string | number): void

+
tree.update("16", "79")

const value = tree.get("16")

console.log(value) // 79 +
+

# delete(key: string | number): void

+
tree.delete("16")

const value = tree.get("16")

console.log(value) // undefined +
+

# createProof(key: string | number): Proof

+
const membershipProof = tree.createProof("2b")
const nonMembershipProof = tree.createProof("16") // This key has been deleted.

console.log(membershipProof)
/*
{
entry: [ '2b', '44', '1' ],
matchingEntry: undefined,
siblings: [
'006a0ab15a212e0e0126b81e056b11576628b1ad80792403dbb3a90be2e71d64',
'f786ce5a843614d7da216d95c0087c1eb29244927feeeeeb658aa60cf124cd5e'
],
root: 'c3c023c84afc0a7bab1dbebcef5f7beaf3d6af4af98e8f481620dec052be7d0d',
membership: true
}
*/

console.log(nonMembershipProof)
/*
{
entry: [ '16' ],
matchingEntry: undefined,
siblings: [
'960f23d9fbb44241be53efb7c4d69ac129bb1cb9482dcb6789d3cc7e6de2de2b',
'2a1aef839e68d1bdf43c1b3b1ed9ef16c27162e8a175898c9ac64a679b0fc825'
],
root: 'c3c023c84afc0a7bab1dbebcef5f7beaf3d6af4af98e8f481620dec052be7d0d',
membership: false
}
*/ +
+

# verifyProof(proof: Proof): boolean

+
console.log(tree.verifyProof(membershipProof)) // true
console.log(tree.verifyProof(nonMembershipProof)) // true +
+

Contacts

Developers

+

Index

Classes

SMT +

Interfaces

Type Aliases

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_eddsa_poseidon.BigNumber.html b/types/_zk_kit_eddsa_poseidon.BigNumber.html new file mode 100644 index 000000000..59d4d2a5a --- /dev/null +++ b/types/_zk_kit_eddsa_poseidon.BigNumber.html @@ -0,0 +1 @@ +BigNumber | ZK-kit
BigNumber: bigint | string

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_eddsa_poseidon.BigNumberish.html b/types/_zk_kit_eddsa_poseidon.BigNumberish.html new file mode 100644 index 000000000..fe4d2b691 --- /dev/null +++ b/types/_zk_kit_eddsa_poseidon.BigNumberish.html @@ -0,0 +1 @@ +BigNumberish | ZK-kit
BigNumberish: BigNumber | number | Buffer

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_eddsa_poseidon.Point.html b/types/_zk_kit_eddsa_poseidon.Point.html new file mode 100644 index 000000000..e5c14bf3b --- /dev/null +++ b/types/_zk_kit_eddsa_poseidon.Point.html @@ -0,0 +1 @@ +Point | ZK-kit
Point<N>: [N, N]

Type Parameters

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_eddsa_poseidon.Signature.html b/types/_zk_kit_eddsa_poseidon.Signature.html new file mode 100644 index 000000000..c644a4a52 --- /dev/null +++ b/types/_zk_kit_eddsa_poseidon.Signature.html @@ -0,0 +1 @@ +Signature | ZK-kit
Signature<N>: {
    R8: Point<N>;
    S: N;
}

Type Parameters

Type declaration

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_groth16.NumericString.html b/types/_zk_kit_groth16.NumericString.html new file mode 100644 index 000000000..61befbda0 --- /dev/null +++ b/types/_zk_kit_groth16.NumericString.html @@ -0,0 +1 @@ +NumericString | ZK-kit

Type alias NumericString

NumericString: `${number}` | string

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_groth16.PublicSignals.html b/types/_zk_kit_groth16.PublicSignals.html new file mode 100644 index 000000000..76cc6da37 --- /dev/null +++ b/types/_zk_kit_groth16.PublicSignals.html @@ -0,0 +1 @@ +PublicSignals | ZK-kit

Type alias PublicSignals

PublicSignals: NumericString[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_groth16.SignalValueType.html b/types/_zk_kit_groth16.SignalValueType.html new file mode 100644 index 000000000..3d8e1aca3 --- /dev/null +++ b/types/_zk_kit_groth16.SignalValueType.html @@ -0,0 +1 @@ +SignalValueType | ZK-kit

Type alias SignalValueType

SignalValueType: NumericString | number | bigint | SignalValueType[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_groth16.ZKArtifact.html b/types/_zk_kit_groth16.ZKArtifact.html new file mode 100644 index 000000000..7ac568e1a --- /dev/null +++ b/types/_zk_kit_groth16.ZKArtifact.html @@ -0,0 +1 @@ +ZKArtifact | ZK-kit

Type alias ZKArtifact

ZKArtifact: string | Uint8Array

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_imt.IMTHashFunction.html b/types/_zk_kit_imt.IMTHashFunction.html new file mode 100644 index 000000000..dd167191f --- /dev/null +++ b/types/_zk_kit_imt.IMTHashFunction.html @@ -0,0 +1,3 @@ +IMTHashFunction | ZK-kit

Type alias IMTHashFunction

IMTHashFunction: ((values) => IMTNode)

Type declaration

    • (values): IMTNode
    • The hash function is used to compute the nodes of the tree. +In a binary Merkle tree, each node is the hash of its two children.

      +

      Parameters

      Returns IMTNode

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_imt.IMTMerkleProof.html b/types/_zk_kit_imt.IMTMerkleProof.html new file mode 100644 index 000000000..9a01eba9f --- /dev/null +++ b/types/_zk_kit_imt.IMTMerkleProof.html @@ -0,0 +1,9 @@ +IMTMerkleProof | ZK-kit

Type alias IMTMerkleProof

IMTMerkleProof: {
    leaf: any;
    leafIndex: number;
    pathIndices: number[];
    root: any;
    siblings: any[];
}

The Merkle Proof contains the necessary parameters to enable the +verifier to be certain that a leaf belongs to the tree. Given the value +of the leaf and its index, it is possible to traverse the tree by +recalculating the hashes up to the root and using the node siblings. +If the calculated root matches the root in the proof, then the leaf +belongs to the tree. It's important to note that the function used +to generate the proof and the one used to verify it must use the +same hash function.

+

Type declaration

  • leaf: any
  • leafIndex: number
  • pathIndices: number[]
  • root: any
  • siblings: any[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_imt.IMTNode.html b/types/_zk_kit_imt.IMTNode.html new file mode 100644 index 000000000..e2e7230dd --- /dev/null +++ b/types/_zk_kit_imt.IMTNode.html @@ -0,0 +1,2 @@ +IMTNode | ZK-kit

Type alias IMTNode

IMTNode: any

It represents a node of the tree, which can be any value.

+

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_imt.LeanIMTHashFunction.html b/types/_zk_kit_imt.LeanIMTHashFunction.html new file mode 100644 index 000000000..0c8c166ee --- /dev/null +++ b/types/_zk_kit_imt.LeanIMTHashFunction.html @@ -0,0 +1,3 @@ +LeanIMTHashFunction | ZK-kit

Type alias LeanIMTHashFunction<N>

LeanIMTHashFunction<N>: ((a, b) => N)

Type Parameters

  • N = bigint

Type declaration

    • (a, b): N
    • The hash function is used to compute the nodes of the tree. +In a binary Merkle tree, each node is the hash of its two children.

      +

      Parameters

      • a: N
      • b: N

      Returns N

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_imt.LeanIMTMerkleProof.html b/types/_zk_kit_imt.LeanIMTMerkleProof.html new file mode 100644 index 000000000..7256bb56c --- /dev/null +++ b/types/_zk_kit_imt.LeanIMTMerkleProof.html @@ -0,0 +1,9 @@ +LeanIMTMerkleProof | ZK-kit

Type alias LeanIMTMerkleProof<N>

LeanIMTMerkleProof<N>: {
    index: number;
    leaf: N;
    root: N;
    siblings: N[];
}

The Merkle Proof contains the necessary parameters to enable the +verifier to be certain that a leaf belongs to the tree. Given the value +of the leaf and its index, it is possible to traverse the tree by +recalculating the hashes up to the root and using the node siblings. +If the calculated root matches the root in the proof, then the leaf +belongs to the tree. It's important to note that the function used +to generate the proof and the one used to verify it must use the +same hash function.

+

Type Parameters

  • N = bigint

Type declaration

  • index: number
  • leaf: N
  • root: N
  • siblings: N[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_lazytower.LazyTowerHashChainProof.html b/types/_zk_kit_lazytower.LazyTowerHashChainProof.html new file mode 100644 index 000000000..b6a1de5da --- /dev/null +++ b/types/_zk_kit_lazytower.LazyTowerHashChainProof.html @@ -0,0 +1 @@ +LazyTowerHashChainProof | ZK-kit

Type alias LazyTowerHashChainProof

LazyTowerHashChainProof: {
    childrens: bigint[][];
    digestOfDigests: bigint;
    item: bigint;
    levelLengths: bigint;
    rootLevel: bigint[];
    rootLv: number;
    topDownDigests: bigint[];
}

Type declaration

  • childrens: bigint[][]
  • digestOfDigests: bigint
  • item: bigint
  • levelLengths: bigint
  • rootLevel: bigint[]
  • rootLv: number
  • topDownDigests: bigint[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_poseidon_proof.PackedProof.html b/types/_zk_kit_poseidon_proof.PackedProof.html new file mode 100644 index 000000000..0895bdc6d --- /dev/null +++ b/types/_zk_kit_poseidon_proof.PackedProof.html @@ -0,0 +1 @@ +PackedProof | ZK-kit

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_poseidon_proof.PoseidonProof.html b/types/_zk_kit_poseidon_proof.PoseidonProof.html new file mode 100644 index 000000000..d0bb02a50 --- /dev/null +++ b/types/_zk_kit_poseidon_proof.PoseidonProof.html @@ -0,0 +1 @@ +PoseidonProof | ZK-kit
PoseidonProof: {
    digest: NumericString;
    nullifier: NumericString;
    proof: PackedProof;
    scope: NumericString;
}

Type declaration

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_poseidon_proof.SnarkArtifacts.html b/types/_zk_kit_poseidon_proof.SnarkArtifacts.html new file mode 100644 index 000000000..3898a47c0 --- /dev/null +++ b/types/_zk_kit_poseidon_proof.SnarkArtifacts.html @@ -0,0 +1 @@ +SnarkArtifacts | ZK-kit
SnarkArtifacts: {
    wasmFilePath: string;
    zkeyFilePath: string;
}

Type declaration

  • wasmFilePath: string
  • zkeyFilePath: string

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.ChildNodes.html b/types/_zk_kit_smt.ChildNodes.html new file mode 100644 index 000000000..b3a1044d7 --- /dev/null +++ b/types/_zk_kit_smt.ChildNodes.html @@ -0,0 +1 @@ +ChildNodes | ZK-kit

Type alias ChildNodes

ChildNodes: Node[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.Entry.html b/types/_zk_kit_smt.Entry.html new file mode 100644 index 000000000..836dff5c4 --- /dev/null +++ b/types/_zk_kit_smt.Entry.html @@ -0,0 +1 @@ +Entry | ZK-kit

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.EntryMark.html b/types/_zk_kit_smt.EntryMark.html new file mode 100644 index 000000000..ff2cffbae --- /dev/null +++ b/types/_zk_kit_smt.EntryMark.html @@ -0,0 +1 @@ +EntryMark | ZK-kit

Type alias EntryMark

EntryMark: Node

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.HashFunction.html b/types/_zk_kit_smt.HashFunction.html new file mode 100644 index 000000000..b2555b7a7 --- /dev/null +++ b/types/_zk_kit_smt.HashFunction.html @@ -0,0 +1 @@ +HashFunction | ZK-kit

Type alias HashFunction

HashFunction: ((childNodes) => Node)

Type declaration

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.Key.html b/types/_zk_kit_smt.Key.html new file mode 100644 index 000000000..50f95cbb5 --- /dev/null +++ b/types/_zk_kit_smt.Key.html @@ -0,0 +1 @@ +Key | ZK-kit

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.Node.html b/types/_zk_kit_smt.Node.html new file mode 100644 index 000000000..2d97053fc --- /dev/null +++ b/types/_zk_kit_smt.Node.html @@ -0,0 +1 @@ +Node | ZK-kit

Type alias Node

Node: string | bigint

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.Siblings.html b/types/_zk_kit_smt.Siblings.html new file mode 100644 index 000000000..fb57f59df --- /dev/null +++ b/types/_zk_kit_smt.Siblings.html @@ -0,0 +1 @@ +Siblings | ZK-kit

Type alias Siblings

Siblings: Node[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_zk_kit_smt.Value.html b/types/_zk_kit_smt.Value.html new file mode 100644 index 000000000..915b8fa45 --- /dev/null +++ b/types/_zk_kit_smt.Value.html @@ -0,0 +1 @@ +Value | ZK-kit

Type alias Value

Value: Node

Generated using TypeDoc

\ No newline at end of file