[{"data":1,"prerenderedAt":874},["ShallowReactive",2],{"navigation_docs":3,"-guide-custom":96,"-guide-custom-surround":869},[4,48],{"title":5,"path":6,"stem":7,"children":8,"icon":47},"Guide","\u002Fguide","1.guide\u002F01.index",[9,11,15,19,23,27,31,35,39,43],{"title":10,"path":6,"stem":7},"Getting Started",{"title":12,"path":13,"stem":14},"Puzzle records","\u002Fguide\u002Frecords","1.guide\u002F02.records",{"title":16,"path":17,"stem":18},"Registry","\u002Fguide\u002Fregistry","1.guide\u002F03.registry",{"title":20,"path":21,"stem":22},"Lookups and views","\u002Fguide\u002Flookups","1.guide\u002F04.lookups",{"title":24,"path":25,"stem":26},"Verification","\u002Fguide\u002Fverification","1.guide\u002F05.verification",{"title":28,"path":29,"stem":30},"Balances","\u002Fguide\u002Fbalances","1.guide\u002F06.balances",{"title":32,"path":33,"stem":34},"CLI","\u002Fguide\u002Fcli","1.guide\u002F07.cli",{"title":36,"path":37,"stem":38},"Agents","\u002Fguide\u002Fagents","1.guide\u002F08.agents",{"title":40,"path":41,"stem":42},"Custom collections","\u002Fguide\u002Fcustom","1.guide\u002F09.custom",{"title":44,"path":45,"stem":46},"Playground","\u002Fguide\u002Fplayground","1.guide\u002F10.playground","i-lucide-book-open",{"title":49,"path":50,"stem":51,"children":52,"icon":95},"Collections","\u002Fcollections","2.collections\u002F00.index",[53,55,59,63,67,71,75,79,83,87,91],{"title":54,"path":50,"stem":51},"Overview",{"title":56,"path":57,"stem":58},"Bitcoin puzzle transaction","\u002Fcollections\u002Fb1000","2.collections\u002F01.b1000",{"title":60,"path":61,"stem":62},"RushWallet contest","\u002Fcollections\u002Frushwallet","2.collections\u002F02.rushwallet",{"title":64,"path":65,"stem":66},"Zden's puzzles","\u002Fcollections\u002Fzden","2.collections\u002F03.zden",{"title":68,"path":69,"stem":70},"Arweave bounties","\u002Fcollections\u002Farweave","2.collections\u002F04.arweave",{"title":72,"path":73,"stem":74},"WarpWallet challenges","\u002Fcollections\u002Fwarp","2.collections\u002F05.warp",{"title":76,"path":77,"stem":78},"Hash collision bounties","\u002Fcollections\u002Fhash_collision","2.collections\u002F06.hash_collision",{"title":80,"path":81,"stem":82},"Ballet wallets","\u002Fcollections\u002Fballet","2.collections\u002F07.ballet",{"title":84,"path":85,"stem":86},"Bitimage","\u002Fcollections\u002Fbitimage","2.collections\u002F08.bitimage",{"title":88,"path":89,"stem":90},"Bitaps mnemonic challenge","\u002Fcollections\u002Fbitaps","2.collections\u002F09.bitaps",{"title":92,"path":93,"stem":94},"GSMG.io puzzle","\u002Fcollections\u002Fgsmg","2.collections\u002F10.gsmg","i-lucide-layers",{"id":97,"title":40,"body":98,"description":862,"extension":863,"links":864,"meta":865,"navigation":201,"path":41,"seo":867,"stem":42,"__hash__":868},"docs\u002F1.guide\u002F09.custom.md",{"type":99,"value":100,"toc":856},"minimark",[101,106,123,559,725,729,735,805,809,837,841,852],[102,103,105],"h2",{"id":104},"one-class-one-file","One class, one file",[107,108,109,110,114,115,118,119,122],"p",{},"Every built-in is a class extending one of the three collection bases with its puzzle list: ",[111,112,113],"code",{},"NamedCollection",", ",[111,116,117],{},"NumericCollection",", or ",[111,120,121],{},"SingletonCollection"," for exactly one puzzle whose id is the key. Yours is the same shape:",[124,125,131],"pre",{"className":126,"code":127,"filename":128,"language":129,"meta":130,"style":130},"language-ts shiki shiki-themes github-light github-light vitesse-dark","import { NamedCollection, bitcoinPuzzle, hex, p2pkh, party, profile } from \"@agntn\u002Fpuzzles\";\n\nexport const minePuzzleFirst = bitcoinPuzzle({\n  id: \"mine\u002Ffirst\",\n  address: p2pkh(\"1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH\"),\n  sourceUrl: \"https:\u002F\u002Fexample.com\u002Ffirst\",\n  startedAt: \"2026-01-01 00:00:00\",\n  key: hex(\"0000000000000000000000000000000000000000000000000000000000000001\", 1),\n});\n\nexport class MineCollection extends NamedCollection {\n  static readonly key = \"mine\";\n  static readonly author = party(\"you\", { profiles: [profile(\"website\", \"https:\u002F\u002Fexample.com\")] });\n  static readonly puzzles = [minePuzzleFirst];\n\n  constructor() {\n    super(MineCollection.key, MineCollection.author, MineCollection.puzzles);\n  }\n}\n\nexport const mine = new MineCollection();\n","mine.ts","ts","",[111,132,133,196,203,227,247,271,288,305,333,339,344,364,388,446,467,472,483,522,528,534,539],{"__ignoreMap":130},[134,135,138,142,146,150,153,156,158,161,163,166,168,171,173,176,179,182,186,190,193],"span",{"class":136,"line":137},"line",1,[134,139,141],{"class":140},"sds8u","import",[134,143,145],{"class":144},"s14qF"," {",[134,147,149],{"class":148},"s9qSu"," NamedCollection",[134,151,152],{"class":144},",",[134,154,155],{"class":148}," bitcoinPuzzle",[134,157,152],{"class":144},[134,159,160],{"class":148}," hex",[134,162,152],{"class":144},[134,164,165],{"class":148}," p2pkh",[134,167,152],{"class":144},[134,169,170],{"class":148}," party",[134,172,152],{"class":144},[134,174,175],{"class":148}," profile",[134,177,178],{"class":144}," }",[134,180,181],{"class":140}," from",[134,183,185],{"class":184},"s2tGe"," \"",[134,187,189],{"class":188},"skmWX","@agntn\u002Fpuzzles",[134,191,192],{"class":184},"\"",[134,194,195],{"class":144},";\n",[134,197,199],{"class":136,"line":198},2,[134,200,202],{"emptyLinePlaceholder":201},true,"\n",[134,204,206,209,213,217,221,224],{"class":136,"line":205},3,[134,207,208],{"class":140},"export",[134,210,212],{"class":211},"sO_1p"," const",[134,214,216],{"class":215},"sHhh0"," minePuzzleFirst",[134,218,220],{"class":219},"sLuFV"," =",[134,222,155],{"class":223},"sTnI0",[134,225,226],{"class":144},"({\n",[134,228,230,234,237,239,242,244],{"class":136,"line":229},4,[134,231,233],{"class":232},"sC822","  id",[134,235,236],{"class":144},": ",[134,238,192],{"class":184},[134,240,241],{"class":188},"mine\u002Ffirst",[134,243,192],{"class":184},[134,245,246],{"class":144},",\n",[134,248,250,253,255,258,261,263,266,268],{"class":136,"line":249},5,[134,251,252],{"class":232},"  address",[134,254,236],{"class":144},[134,256,257],{"class":223},"p2pkh",[134,259,260],{"class":144},"(",[134,262,192],{"class":184},[134,264,265],{"class":188},"1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH",[134,267,192],{"class":184},[134,269,270],{"class":144},"),\n",[134,272,274,277,279,281,284,286],{"class":136,"line":273},6,[134,275,276],{"class":232},"  sourceUrl",[134,278,236],{"class":144},[134,280,192],{"class":184},[134,282,283],{"class":188},"https:\u002F\u002Fexample.com\u002Ffirst",[134,285,192],{"class":184},[134,287,246],{"class":144},[134,289,291,294,296,298,301,303],{"class":136,"line":290},7,[134,292,293],{"class":232},"  startedAt",[134,295,236],{"class":144},[134,297,192],{"class":184},[134,299,300],{"class":188},"2026-01-01 00:00:00",[134,302,192],{"class":184},[134,304,246],{"class":144},[134,306,308,311,313,316,318,320,323,325,327,331],{"class":136,"line":307},8,[134,309,310],{"class":232},"  key",[134,312,236],{"class":144},[134,314,315],{"class":223},"hex",[134,317,260],{"class":144},[134,319,192],{"class":184},[134,321,322],{"class":188},"0000000000000000000000000000000000000000000000000000000000000001",[134,324,192],{"class":184},[134,326,114],{"class":144},[134,328,330],{"class":329},"sw1C9","1",[134,332,270],{"class":144},[134,334,336],{"class":136,"line":335},9,[134,337,338],{"class":144},"});\n",[134,340,342],{"class":136,"line":341},10,[134,343,202],{"emptyLinePlaceholder":201},[134,345,347,349,352,356,359,361],{"class":136,"line":346},11,[134,348,208],{"class":140},[134,350,351],{"class":211}," class",[134,353,355],{"class":354},"stSJJ"," MineCollection",[134,357,358],{"class":211}," extends",[134,360,149],{"class":223},[134,362,363],{"class":144}," {\n",[134,365,367,370,373,377,379,381,384,386],{"class":136,"line":366},12,[134,368,369],{"class":211},"  static",[134,371,372],{"class":211}," readonly",[134,374,376],{"class":375},"sZNs6"," key",[134,378,220],{"class":219},[134,380,185],{"class":184},[134,382,383],{"class":188},"mine",[134,385,192],{"class":184},[134,387,195],{"class":144},[134,389,391,393,395,398,400,402,404,406,409,411,413,416,419,422,425,427,429,432,434,436,438,441,443],{"class":136,"line":390},13,[134,392,369],{"class":211},[134,394,372],{"class":211},[134,396,397],{"class":375}," author",[134,399,220],{"class":219},[134,401,170],{"class":223},[134,403,260],{"class":144},[134,405,192],{"class":184},[134,407,408],{"class":188},"you",[134,410,192],{"class":184},[134,412,152],{"class":144},[134,414,415],{"class":144}," { ",[134,417,418],{"class":232},"profiles",[134,420,421],{"class":144},": [",[134,423,424],{"class":223},"profile",[134,426,260],{"class":144},[134,428,192],{"class":184},[134,430,431],{"class":188},"website",[134,433,192],{"class":184},[134,435,114],{"class":144},[134,437,192],{"class":184},[134,439,440],{"class":188},"https:\u002F\u002Fexample.com",[134,442,192],{"class":184},[134,444,445],{"class":144},")] });\n",[134,447,449,451,453,456,458,461,464],{"class":136,"line":448},14,[134,450,369],{"class":211},[134,452,372],{"class":211},[134,454,455],{"class":375}," puzzles",[134,457,220],{"class":219},[134,459,460],{"class":144}," [",[134,462,463],{"class":148},"minePuzzleFirst",[134,465,466],{"class":144},"];\n",[134,468,470],{"class":136,"line":469},15,[134,471,202],{"emptyLinePlaceholder":201},[134,473,475,478,481],{"class":136,"line":474},16,[134,476,477],{"class":211},"  constructor",[134,479,480],{"class":144},"()",[134,482,363],{"class":144},[134,484,486,490,492,495,498,501,503,505,507,510,512,514,516,519],{"class":136,"line":485},17,[134,487,489],{"class":488},"sAsIS","    super",[134,491,260],{"class":144},[134,493,494],{"class":148},"MineCollection",[134,496,497],{"class":144},".",[134,499,500],{"class":148},"key",[134,502,152],{"class":144},[134,504,355],{"class":148},[134,506,497],{"class":144},[134,508,509],{"class":148},"author",[134,511,152],{"class":144},[134,513,355],{"class":148},[134,515,497],{"class":144},[134,517,518],{"class":148},"puzzles",[134,520,521],{"class":144},");\n",[134,523,525],{"class":136,"line":524},18,[134,526,527],{"class":144},"  }\n",[134,529,531],{"class":136,"line":530},19,[134,532,533],{"class":144},"}\n",[134,535,537],{"class":136,"line":536},20,[134,538,202],{"emptyLinePlaceholder":201},[134,540,542,544,546,549,551,554,556],{"class":136,"line":541},21,[134,543,208],{"class":140},[134,545,212],{"class":211},[134,547,548],{"class":215}," mine",[134,550,220],{"class":219},[134,552,553],{"class":211}," new",[134,555,355],{"class":223},[134,557,558],{"class":144},"();\n",[124,560,562],{"className":126,"code":561,"language":129,"meta":130,"style":130},"import { get, registerCollection, verifyPuzzle } from \"@agntn\u002Fpuzzles\";\n\nregisterCollection({ key: \"mine\", load: () => import(\".\u002Fmine\").then((m) => m.mine) });\n\nconst puzzle = await get(\"mine\u002Ffirst\"); \u002F\u002F loads .\u002Fmine now, not before\nverifyPuzzle(puzzle!).verified; \u002F\u002F true, key 1 derives 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH\n",[111,563,564,595,599,667,671,701],{"__ignoreMap":130},[134,565,566,568,570,573,575,578,580,583,585,587,589,591,593],{"class":136,"line":137},[134,567,141],{"class":140},[134,569,145],{"class":144},[134,571,572],{"class":148}," get",[134,574,152],{"class":144},[134,576,577],{"class":148}," registerCollection",[134,579,152],{"class":144},[134,581,582],{"class":148}," verifyPuzzle",[134,584,178],{"class":144},[134,586,181],{"class":140},[134,588,185],{"class":184},[134,590,189],{"class":188},[134,592,192],{"class":184},[134,594,195],{"class":144},[134,596,597],{"class":136,"line":198},[134,598,202],{"emptyLinePlaceholder":201},[134,600,601,604,607,609,611,613,615,617,619,622,625,628,631,633,635,638,640,643,646,649,652,655,657,660,662,664],{"class":136,"line":205},[134,602,603],{"class":223},"registerCollection",[134,605,606],{"class":144},"({ ",[134,608,500],{"class":232},[134,610,236],{"class":144},[134,612,192],{"class":184},[134,614,383],{"class":188},[134,616,192],{"class":184},[134,618,114],{"class":144},[134,620,621],{"class":223},"load",[134,623,624],{"class":144},": () ",[134,626,627],{"class":219},"=>",[134,629,630],{"class":211}," import",[134,632,260],{"class":144},[134,634,192],{"class":184},[134,636,637],{"class":188},".\u002Fmine",[134,639,192],{"class":184},[134,641,642],{"class":144},").",[134,644,645],{"class":223},"then",[134,647,648],{"class":144},"((",[134,650,651],{"class":375},"m",[134,653,654],{"class":144},") ",[134,656,627],{"class":219},[134,658,659],{"class":148}," m",[134,661,497],{"class":144},[134,663,383],{"class":148},[134,665,666],{"class":144},") });\n",[134,668,669],{"class":136,"line":229},[134,670,202],{"emptyLinePlaceholder":201},[134,672,673,676,679,681,684,686,688,690,692,694,697],{"class":136,"line":249},[134,674,675],{"class":211},"const",[134,677,678],{"class":215}," puzzle",[134,680,220],{"class":219},[134,682,683],{"class":140}," await",[134,685,572],{"class":223},[134,687,260],{"class":144},[134,689,192],{"class":184},[134,691,241],{"class":188},[134,693,192],{"class":184},[134,695,696],{"class":144},");",[134,698,700],{"class":699},"sjj-T"," \u002F\u002F loads .\u002Fmine now, not before\n",[134,702,703,706,708,711,714,716,719,722],{"class":136,"line":273},[134,704,705],{"class":223},"verifyPuzzle",[134,707,260],{"class":144},[134,709,710],{"class":148},"puzzle",[134,712,713],{"class":211},"!",[134,715,642],{"class":144},[134,717,718],{"class":148},"verified",[134,720,721],{"class":144},";",[134,723,724],{"class":699}," \u002F\u002F true, key 1 derives 1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH\n",[102,726,728],{"id":727},"what-the-registry-assumes","What the registry assumes",[107,730,731,732,497],{},"The registry checks none of this. It files the collection under its key and trusts the ids, so a puzzle whose id starts with another key is simply unreachable through ",[111,733,734],{},"get",[736,737,738,745,776,783],"ul",{},[739,740,741,744],"li",{},[111,742,743],{},"static readonly key"," is what the registry files the collection under and the first segment of every id in it. Lowercase letters, digits and underscores. Registering the same key again replaces what it held.",[739,746,747,748,751,752,754,755,757,758,761,762,754,765,757,767,114,770,761,773,497],{},"Every puzzle's id starts with ",[111,749,750],{},"\u003Ckey>\u002F",", or equals the key for a ",[111,753,121],{},". ",[111,756,113],{}," answers ",[111,759,760],{},"get(\"first\")"," and ",[111,763,764],{},"get(\"mine\u002Ffirst\")",[111,766,117],{},[111,768,769],{},"get(7)",[111,771,772],{},"get(\"7\")",[111,774,775],{},"get(\"mine\u002F7\")",[739,777,778,779,782],{},"Build the puzzles with the chain factories and the parts builders. A handwritten class extending ",[111,780,781],{},"BitcoinPuzzle"," works too, when a puzzle needs behavior of its own. The registry doesn't care which.",[739,784,785,788,789,792,793,114,795,114,798,114,801,804],{},[111,786,787],{},"registerCollection({ key, load })"," keeps the collection lazy. ",[111,790,791],{},"registerCollection(instance)"," registers it resolved, and the same instance twice is a no-op. Either way ",[111,794,734],{},[111,796,797],{},"all",[111,799,800],{},"stats",[111,802,803],{},"dataVersion"," and the six tools see it on their next call.",[102,806,808],{"id":807},"what-you-get-for-free","What you get for free",[107,810,811,114,814,114,817,114,820,114,823,114,826,829,830,754,833,836],{},[111,812,813],{},"count()",[111,815,816],{},"solved()",[111,818,819],{},"unsolved()",[111,821,822],{},"withPubkey()",[111,824,825],{},"verify(query)",[111,827,828],{},"balance(query)"," and the identifier lookups come from ",[111,831,832],{},"Collection",[111,834,835],{},"dataVersion()"," changes, because your records are part of the serialized dataset now. That's the right answer. A consumer caching the snapshot should notice.",[102,838,840],{"id":839},"where-it-stops","Where it stops",[107,842,843,844,847,848,851],{},"The CLI and the MCP server load the built-ins. To serve a custom collection through them, build your own binary around ",[111,845,846],{},"createMcpServer"," from ",[111,849,850],{},"@agntn\u002Fpuzzles\u002Fmcp"," and register before connecting. There's no plugin path. Saying so beats inventing one that half works.",[853,854,855],"style",{},"html pre.shiki code .sds8u, html code.shiki .sds8u{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#4D9375}html pre.shiki code .s14qF, html code.shiki .s14qF{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#666666}html pre.shiki code .s9qSu, html code.shiki .s9qSu{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#BD976A}html pre.shiki code .s2tGe, html code.shiki .s2tGe{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#C98A7D77}html pre.shiki code .skmWX, html code.shiki .skmWX{--shiki-light:#032F62;--shiki-default:#032F62;--shiki-dark:#C98A7D}html pre.shiki code .sO_1p, html code.shiki .sO_1p{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#CB7676}html pre.shiki code .sHhh0, html code.shiki .sHhh0{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#BD976A}html pre.shiki code .sLuFV, html code.shiki .sLuFV{--shiki-light:#D73A49;--shiki-default:#D73A49;--shiki-dark:#666666}html pre.shiki code .sTnI0, html code.shiki .sTnI0{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#80A665}html pre.shiki code .sC822, html code.shiki .sC822{--shiki-light:#24292E;--shiki-default:#24292E;--shiki-dark:#B8A965}html pre.shiki code .sw1C9, html code.shiki .sw1C9{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#4C9A91}html pre.shiki code .stSJJ, html code.shiki .stSJJ{--shiki-light:#6F42C1;--shiki-default:#6F42C1;--shiki-dark:#5DA994}html pre.shiki code .sZNs6, html code.shiki .sZNs6{--shiki-light:#E36209;--shiki-default:#E36209;--shiki-dark:#BD976A}html pre.shiki code .sAsIS, html code.shiki .sAsIS{--shiki-light:#005CC5;--shiki-default:#005CC5;--shiki-dark:#C99076}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sjj-T, html code.shiki .sjj-T{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#758575DD}",{"title":130,"searchDepth":198,"depth":198,"links":857},[858,859,860,861],{"id":104,"depth":198,"text":105},{"id":727,"depth":198,"text":728},{"id":807,"depth":198,"text":808},{"id":839,"depth":198,"text":840},"Extend NamedCollection or NumericCollection with a key and an author and a puzzle list. Register a loader. From then on the registry treats it like a built-in.","md",null,{"icon":866},"i-lucide-plus",{"title":40,"description":862},"nCw8HWr_9yPI389KFGVVG2IV13RnOlFy3H0b1B083o8",[870,872],{"title":36,"path":37,"stem":38,"description":871,"children":-1},"The same six tools over MCP and the Pi and OMP extensions. What the text carries and where the limits live. The one tool that leaves the process.",{"title":44,"path":45,"stem":46,"description":873,"children":-1},"The page behind puzzles.agntn.dev\u002Fplayground runs the library in your browser. What it can tell you and what it leaves alone.",1789734790030]