1"use strict";(self.webpackChunkfrozen_security_web=self.webpackChunkfrozen_security_web||[]).push([[678],{5424:function(e,t,a){a.r(t),a.d(t,{Head:function(){return i},default:function(){return m}});var n=a(6540),r=a(4794),l=a(7543),s=a(5032);const o={base6:{label:"BASE-6",desc:"Dice (1â6)",chars:/^[1-6]$/,base:6,bitsPerRoll:Math.log2(6)},base10:{label:"BASE-10",desc:"Dice (0â9)",chars:/^[0-9]$/,base:10,bitsPerRoll:Math.log2(10)},coin:{label:"COIN",desc:"Flip (0 or 1)",chars:/^[01]$/,base:2,bitsPerRoll:1}};const c=[{mode:"base6",label:"Base-6 dice (1â6)",bpr:"2.585",n128:50,n256:100},{mode:"base10",label:"Base-10 dice (0â9)",bpr:"3.322",n128:39,n256:78},{mode:"coin",label:"Coin flip (0/1)",bpr:"1.000",n128:128,n256:256}];function m(){const{0:e,1:t}=(0,n.useState)("base6"),{0:s,1:m}=(0,n.useState)(128),{0:i,1:d}=(0,n.useState)(""),{0:u,1:b}=(0,n.useState)(""),{0:p,1:x}=(0,n.useState)(null),{0:f,1:h}=(0,n.useState)(""),{0:E,1:y}=(0,n.useState)(!1),N=function(e,t){return"coin"===e?t:Math.ceil(t/o[e].bitsPerRoll)}(e,s),g=i.length,v=g>=N,w=(g*o[e].bitsPerRoll).toFixed(1);(0,n.useEffect)(()=>{x(null),i&&v&&(async()=>{try{const{entropyToMnemonic:n}=await a.e(501).then(a.bind(a,5501)),{wordlist:r}=await a.e(414).then(a.bind(a,9414)),l=function(e,t,a){const n=a/8,r=o[t];if("coin"===t){const t=new Uint8Array(n);for(let a=0;a<n;a++){let n=0;for(let t=0;t<8;t++){const r=8*a+t;n=n<<1|(r<e.length?parseInt(e[r],10):0)}t[a]=n}return t}let l=0n;for(const o of e){const e="base6"===t?BigInt(parseInt(o,10)-1):BigInt(parseInt(o,10));l=l*BigInt(r.base)+e}const s=new Uint8Array(n);let c=l;for(let o=n-1;o>=0;o--)s[o]=Number(0xffn&c),c>>=8n;return s}(i.slice(0,N),e,s),c=(t=l,Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")),m=function(e){return Array.from(e).map(e=>e.toString(2).padStart(8,"0")).join("")}(l),d=n(l,r),u=d.split(" "),b=u.map(e=>{const t=r.indexOf(e),a=Array.from({length:11},(e,a)=>Boolean(t>>10-a&1));return{word:e,index:t,bits:a}});x({entropyHex:c,bitString:m,mnemonic:d,words:u,wordBits:b})}catch(n){h("@scure/bip39 not found â run: npm install @scure/[email protected]")}var t})()},[i,e,s,v,N]);const k=(0,n.useCallback)(t=>{const a=o[e];for(const e of t)if(!a.chars.test(e))return void b(`Invalid character "${e}" for ${a.label} mode â expected ${a.desc}`);b(""),d(t)},[e]);const S=Math.min(100,Math.round(g/N*100));return n.createElement(l.A,null,n.createElement("div",{className:"max-w-4xl mx-auto px-6 py-12"},n.createElement("div",{className:"border-b border-neutral-800 pb-8 mb-10"},n.createElement("div",{className:"flex items-center gap-3 font-mono text-sm text-neutral-500 tracking-widest uppercase mb-3"},n.createElement(r.Link,{to:"/tools",className:"hover:text-neutral-200 transition-colors"},"TOOLS"),n.createElement("span",null,"/"),n.createElement("span",{className:"text-neutral-200"},"DICE ENTROPY")),n.createElement("h1",{className:"text-xl font-medium text-neutral-100 tracking-tight mb-2"},"Dice Roll to Bitcoin Seed â Convert Dice Entropy to BIP-39 Mnemonic"),n.createElement("p",{className:"text-neutral-400 text-sm max-w-xl leading-relaxed"},"Convert physical dice rolls or coin flips to a BIP-39 seed phrase. Uses base-conversion arithmetic â no hashing, no PRNG mixing. What you roll is what you get.")),n.createElement("div",{className:"border border-neutral-800 bg-neutral-900 p-4 mb-8 flex gap-3"},n.createElement("span",{className:"font-mono text-sm text-neutral-500 shrink-0 mt-0.5"},"â "),n.createElement("p",{className:"font-mono text-sm text-neutral-400 leading-relaxed"},"Runs entirely in your browser. No data transmitted. For real key material â use only on an air-gapped device.")),f&&n.createElement("div",{className:"border border-neutral-700 p-3 mb-6 font-mono text-sm text-neutral-400"},f),n.createElement("div",{className:"border border-neutral-800 bg-neutral-900 p-6 mb-6"},n.createElement("div",{className:"mb-6"},n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest mb-3"},"INPUT MODE"),n.createElement("div",{className:"flex flex-wrap gap-2"},Object.entries(o).map(([a,r])=>n.createElement("button",{key:a,onClick:()=>(t(a),d(""),b(""),void x(null)),className:"font-mono text-sm border px-4 py-1.5 transition-colors\n "+(e===a?"border-slate-500 text-slate-300 bg-neutral-900":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:text-neutral-200")},r.label,n.createElement("span",{className:"ml-2 text-neutral-500 text-xs"},r.desc))))),n.createElement("div",null,n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest mb-3"},"TARGET LENGTH"),n.createElement("div",{className:"flex gap-2"},[128,256].map(e=>n.createElement("button",{key:e,onClick:()=>function(e){m(e),d(""),x(null)}(e),className:"font-mono text-sm border px-4 py-1.5 transition-colors\n "+(s===e?"border-slate-500 text-slate-300 bg-neutral-900":"border-neutral-700 text-neutral-400 hover:border-neutral-500 hover:text-neutral-200")},128===e?"12 WORDS":"24 WORDS",n.createElement("span",{className:"ml-2 text-neutral-500 text-xs"},e," bits")))))),n.createElement("div",{className:"border border-neutral-800 bg-neutral-900 p-6 mb-6"},n.createElement("div",{className:"flex items-center justify-between mb-3"},n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest"},"ROLL SEQUENCE â ",o[e].desc),n.createElement("div",{className:"flex items-center gap-4"},n.createElement("span",{className:"font-mono text-sm tabular-nums text-neutral-400"},g," / ",N," rolls"),g>0&&n.createElement("button",{onClick:()=>{d(""),x(null),b("")},className:"font-mono text-xs text-neutral-500 hover:text-neutral-400 transition-colors border border-neutral-800 px-3 py-1"},"CLEAR"))),n.createElement("input",{type:"text",value:i,onChange:e=>k(e.target.value),placeholder:"Type rolls â e.g. "+("base6"===e?"364152614â¦":"base10"===e?"7304918â¦":"1010110â¦"),spellCheck:!1,autoComplete:"off",style:{borderRadius:0},className:"w-full bg-neutral-950 border border-neutral-700 text-neutral-100 font-mono text-sm px-4 py-3 outline-none focus:border-slate-500 transition-colors placeholder-neutral-700 tracking-wider"}),u&&n.createElement("div",{className:"mt-2 font-mono text-xs text-neutral-400"},u),n.createElement("div",{className:"mt-4"},n.createElement("div",{className:"h-1 bg-neutral-800 w-full"},n.createElement("div",{className:"h-1 transition-all duration-150 "+(v?"bg-slate-500":"bg-neutral-800"),style:{width:`${S}%`}})),n.createElement("div",{className:"flex justify-between mt-1.5"},n.createElement("span",{className:"font-mono text-xs text-neutral-500"},v?g>N?`${g-N} extra roll${g-N!==1?"s":""} ignored`:"threshold reached":`${N-g} more roll${N-g!==1?"s":""} needed`),n.createElement("span",{className:"font-mono text-xs tabular-nums "+(v?"text-slate-400":"text-neutral-500")},"~",w," effective bits")))),p&&n.createElement(n.Fragment,null,n.createElement("div",{className:"border border-neutral-800 bg-neutral-900 p-6 mb-6 space-y-5"},n.createElement("div",null,n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest mb-2"},"ENTROPY HEX"),n.createElement("div",{className:"font-mono text-sm text-neutral-300 break-all leading-relaxed tracking-wide"},p.entropyHex)),n.createElement("div",null,n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest mb-2"},"BIT STRING"),n.createElement("div",{className:"font-mono text-xs leading-loose break-all"}
1,p.bitString.split("").map((e,t)=>{const a=Math.floor(t/11)%2==0;return n.createElement("span",{key:t,className:"1"===e?a?"text-slate-300":"text-neutral-300":"text-neutral-500"},e,(t+1)%11==0&&t<p.bitString.length-1&&n.createElement("span",{className:"text-neutral-800 select-none"},"·"))})),n.createElement("div",{className:"font-mono text-xs text-neutral-500 mt-1.5"},s/8," entropy bytes · groups of 11 bits = one BIP-39 word index"))),n.createElement("div",{className:"border border-neutral-800 mb-6 overflow-x-auto"},n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest p-4 border-b border-neutral-800"},"PER-WORD BIT MAPPING"),n.createElement("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-neutral-800"},n.createElement("span",{className:"font-mono text-xs text-neutral-500 w-8"},"#"),n.createElement("span",{className:"font-mono text-xs text-neutral-500 w-20"},"WORD"),n.createElement("span",{className:"font-mono text-xs text-neutral-500 w-12"},"INDEX"),n.createElement("div",{className:"flex gap-1"},Array.from({length:11},(e,t)=>n.createElement("span",{key:t,className:"font-mono text-xs text-neutral-500 w-4 text-center select-none"},10-t)))),p.wordBits.map(({word:e,index:t,bits:a},r)=>n.createElement("div",{key:r,className:"flex items-center gap-2 px-4 py-2 border-b border-neutral-800 last:border-0 hover:bg-neutral-800 transition-colors"},n.createElement("span",{className:"font-mono text-xs text-neutral-500 w-8 tabular-nums"},String(r+1).padStart(2,"0")),n.createElement("span",{className:"font-mono text-sm text-neutral-200 w-20"},e),n.createElement("span",{className:"font-mono text-xs text-slate-500 w-12 tabular-nums"},t),n.createElement("div",{className:"flex gap-1"},a.map((e,t)=>n.createElement("span",{key:t,className:"w-4 text-center font-mono text-xs select-none\n "+(e?"text-slate-300":"text-neutral-500")},e?"1":"0")))))),n.createElement("div",{className:"border border-neutral-800 bg-neutral-900 p-5 mb-10"},n.createElement("div",{className:"flex items-center justify-between mb-4"},n.createElement("div",{className:"font-mono text-xs text-slate-400 uppercase tracking-widest"},"BIP-39 MNEMONIC â ",p.words.length," WORDS"),n.createElement("button",{onClick:function(){p&&(navigator.clipboard.writeText(p.mnemonic),y(!0),setTimeout(()=>y(!1),1500))},className:"font-mono text-sm text-neutral-300 border border-neutral-800 px-3 py-1 hover:text-neutral-100 hover:border-neutral-700 transition-colors"},E?"COPIED":"COPY")),n.createElement("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 gap-2"},p.words.map((e,t)=>n.createElement("div",{key:t,className:"border border-neutral-800 px-3 py-2"},n.createElement("div",{className:"font-mono text-xs text-neutral-500 mb-0.5"},String(t+1).padStart(2,"0")),n.createElement("div",{className:"font-mono text-sm text-neutral-200"},e)))),n.createElement("p",{className:"font-mono text-xs text-neutral-500 mt-4 leading-relaxed"},"Verify this mnemonic with the Seed Visualizer before committing funds. The last word contains a checksum â any transcription error will produce an invalid mnemonic."))),n.createElement("div",{className:"border border-neutral-800 mb-10 overflow-x-auto"},n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest p-4 border-b border-neutral-800"},"ROLLS REQUIRED BY MODE"),n.createElement("table",{className:"w-full"},n.createElement("thead",null,n.createElement("tr",{className:"border-b border-neutral-800"},["Mode","Bits/Roll","12 Words (128 bit)","24 Words (256 bit)"].map(e=>n.createElement("th",{key:e,className:"font-mono text-xs text-neutral-500 uppercase tracking-widest text-left px-4 py-3"},e)))),n.createElement("tbody",null,c.map(t=>n.createElement("tr",{key:t.mode,className:"border-b border-neutral-800 last:border-0 transition-colors\n "+(e===t.mode?"bg-neutral-900":"hover:bg-neutral-800")},n.createElement("td",{className:"font-mono text-sm px-4 py-3 "+(e===t.mode?"text-slate-300":"text-neutral-300")},t.label,e===t.mode&&n.createElement("span",{className:"ml-2 text-xs text-neutral-500"},"â")),n.createElement("td",{className:"font-mono text-sm text-neutral-500 px-4 py-3 tabular-nums"},t.bpr),n.createElement("td",{className:"font-mono text-sm px-4 py-3 tabular-nums\n "+(e===t.mode&&128===s?"text-slate-300":"text-neutral-400")},t.n128," rolls"),n.createElement("td",{className:"font-mono text-sm px-4 py-3 tabular-nums\n "+(e===t.mode&&256===s?"text-slate-300":"text-neutral-400")},t.n256," rolls")))))),n.createElement("div",{className:"border-t border-neutral-800 pt-10 space-y-8"},n.createElement("div",{className:"font-mono text-xs text-neutral-500 uppercase tracking-widest"},"REFERENCE"),[{q:"Why use dice instead of the computer to generate entropy?",a:"Computer entropy sources (CSPRNG) are statistically strong but opaque â you cannot independently verify the randomness. Physical dice rolls are observable, auditable, and produce entropy that cannot be influenced remotely. For high-value wallets, physical entropy eliminates an entire class of supply-chain and software trust assumptions."},{q:"What is base-conversion entropy?",a:"This tool converts dice rolls directly into entropy bytes using positional base arithmetic â the same way you convert a decimal number to binary. No hashing or PRNG mixing is applied. Each roll contributes exactly logâ(base) bits of entropy. The final entropy bytes are the low-order bytes of the resulting integer."},{q:"How many dice rolls do I actually need?",a:"For 12-word (128-bit) wallets: 50 standard dice rolls (base-6), 39 decimal rolls (base-10), or 128 coin flips. For 24-word (256-bit) wallets: double those counts. Rolling more than the minimum does not improve security â only rolls up to the threshold are used."},{q:"What is the last word's checksum?",a:"BIP-39 appends a checksum to the entropy before splitting into 11-bit word indices. For a 128-bit wallet, 4 checksum bits are appended (SHA-256 of the entropy, first 4 bits). For 256-bit, 8 bits. The last word encodes entropy bits plus checksum bits â which is why the last word has fewer valid choices than the others."},{q:"Can I verify this output against another tool?",a:"Yes. The bit mapping table shows exactly which 11-bit index each word occupies. Enter the same roll sequence into Ian Coleman's BIP-39 tool (with the same entropy hex) and confirm the mnemonic matches. The entropy hex shown here is the canonical input â any compliant BIP-39 implementation will produce the same words from the same entropy bytes."}].map(({q:e,a:t})=>n.createElement("div",{key:e},n.createElement("div",{className:"font-mono text-sm text-neutral-200 mb-2"},e),n.createElement("p",{className:"text-neutral-400 text-sm leading-relaxed"},t))))))}const i=()=>n.createElement(s.A,{title:"Dice Roll Bitcoin Seed Generator â BIP-39 Entropy",description:"Convert dice rolls to a BIP-39 mnemonic. Supports base-6, base-10, coin flips. Shows effective entropy bits and per-word bit mapping.",pathname:"/tools/dice-entropy/"})}}]); 2//# sourceMappingURL=component---src-pages-tools-dice-entropy-js-781779221d60d5c8aa51.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.