(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Wolfram 15.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       154,          7]
NotebookDataLength[     48741,       1278]
NotebookOptionsPosition[     38509,       1089]
NotebookOutlinePosition[     40699,       1140]
CellTagsIndexPosition[     40621,       1135]
WindowTitle->Bech32Q
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {GridBox[{
      {
       ItemBox[Cell[BoxData[
         RowBox[{
          TemplateBox[{12},
           "Spacer1"], Cell[
          "WOLFRAM INSTITUTE/ PUZZLES SYMBOL", "PacletNameCell",
           TextAlignment->Center,ExpressionUUID->
           "13426bf8-cd7b-4164-aeb5-a062c11d59ac"], 
          TemplateBox[{8},
           "Spacer1"]}]],
         TextAlignment->Center,ExpressionUUID->
         "c7d3b353-df04-4f47-8678-d5138de360a8"],
        Background->LightDarkSwitched[
          RGBColor[0.490196, 0.576471, 0.690196]],
        ItemSize->Full], ""}
     },
     GridBoxAlignment->{"Rows" -> {{Center}}},
     GridBoxItemSize->{"Columns" -> {Full, 
         Scaled[0.02]}, "Rows" -> {{2.5}}}], Cell[TextData[{
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "See Also",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "12d20489-d89c-42aa-8aed-ad18d0297467"]
         }],ExpressionUUID->"6c2ea7ee-f192-4bab-9ebc-e1898591bcb1"],
         StripOnInput->False],{
        StyleBox["\"Bech32Decode\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/Bech32Decode"], 
         StyleBox[
          "\"Bech32Encode\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/Bech32Encode"], 
         StyleBox[
          "\"SegWitAddressQ\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/SegWitAddressQ"], 
         StyleBox[
          "\"Base58CheckQ\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/Base58CheckQ"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"SeeAlso"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "6521089f-6183-498c-a6a0-c9fc6d0321f6"],
     "\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\
\[ThickSpace]",
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "Related Guides",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "385b9bf3-d9ea-4409-82d3-9c8ba952d3f6"]
         }],ExpressionUUID->"30a62211-8c03-4d15-ba45-9e3c740d5928"],
         StripOnInput->False],{
        "\"Encodings\"" :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/guide/Encodings"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"MoreAbout"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "5a7b35b7-affc-425b-811e-90d094d3b00e"],
     "\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\
\[ThickSpace]",
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "URL",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "a783fab2-018e-41d5-936e-35c1997284a1"]
         }],ExpressionUUID->"1909086d-13b8-422b-aac5-dd64346c4502"],
         StripOnInput->False],{
        "\"WolframInstitute/Puzzles/ref/Bech32Q\"" :> None, 
         "\"Copy Wolfram Documentation Center URL\"" :> 
         CopyToClipboard["WolframInstitute/Puzzles/ref/Bech32Q"], Delimiter, 
         "\"Copy web URL\"" :> 
         Module[{DocumentationSearch`Private`nb$}, 
           DocumentationSearch`Private`nb$ = 
            NotebookPut[
             Notebook[{
               Cell[BoxData[
                 MakeBoxes[
                  Hyperlink[
                   "http://reference.wolfram.com/language/WolframInstitute/\
Puzzles/ref/Bech32Q.html"], StandardForm]], "Input", TextClipboardType -> 
                 "PlainText"]}, Visible -> False]]; 
           SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
           FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
           NotebookClose[DocumentationSearch`Private`nb$]; Null], 
         "\"Go to web URL\"" :> 
         FrontEndExecute[{
           NotebookLocate[{
             URL[If[TrueQ[False], 
                 "http://reference.wolfram.com/system-modeler/", 
                 "http://reference.wolfram.com/language/"] <> 
               "WolframInstitute/Puzzles/ref/Bech32Q" <> ".html"], None}]}]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"URLMenu"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "64539a2c-b6d0-4900-b91a-594429f7ee2c"]
    }], "AnchorBar",
     CacheGraphics->False,ExpressionUUID->
     "0b8d3240-2ab3-4f72-83da-e45088f08958"]}
  }]], "AnchorBarGrid",
 CellID->1,ExpressionUUID->"8bee2932-be1b-4ebd-8172-cf96094863a6"],

Cell["WolframInstitute`Puzzles`", "ContextNameCell",ExpressionUUID->"000e81df-5d4b-4b7b-b22a-9b4d505f378f"],

Cell[CellGroupData[{

Cell[BoxData[GridBox[{
   {Cell[TextData[{
     Cell[
     "Bech32Q", "ObjectName",ExpressionUUID->
      "4a43b620-f0a8-4f53-9778-297c545638a1"],
     Cell[BoxData[
      TemplateBox[{8},
       "Spacer1"]],ExpressionUUID->"5f739c77-50eb-411d-a949-19b325deb48e"],
     Cell[BoxData[
     ""], "ObjectNameTranslation",ExpressionUUID->
      "1f577dc9-50b8-4023-b2d8-79c9aed26de7"]
    }],ExpressionUUID->"1db1c456-7550-48d0-9258-39ea21116fe7"], 
    "\[SpanFromLeft]"}
  }]], "ObjectNameGrid",ExpressionUUID->"2a75fccd-c217-4cc1-bac7-\
9d1b0fc6e93b"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{
       TemplateBox[{
         Cell[
          TextData["Bech32Q"]], "paclet:WolframInstitute/Puzzles/ref/Bech32Q",
          "WolframInstitute/Puzzles Package Symbol"},
        "PackageLink",
        BaseStyle->"InlineFormula"], "[", 
       StyleBox["string", "TI"], "]"}]], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "b12eeb87-210d-4c78-99c1-082fd0dc217b"],
     "\[LineSeparator]",
     "gives ",
     Cell[BoxData["True"], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "a9c14c8f-53dd-4b1a-b5ea-0e8b6ea772cd"],
     " if ",
     StyleBox["string", "TI"],
     " is a valid Bech32 or Bech32m string, and ",
     Cell[BoxData["False"], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "d6c3fb81-3ff2-45b1-969f-3ee596cb1844"],
     " otherwise."
    }],ExpressionUUID->"2bd5aebf-b897-45ae-ac43-e2333e095d13"]},
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{
       TemplateBox[{
         Cell[
          TextData["Bech32Q"]], "paclet:WolframInstitute/Puzzles/ref/Bech32Q",
          "WolframInstitute/Puzzles Package Symbol"},
        "PackageLink",
        BaseStyle->"InlineFormula"], "[", 
       RowBox[{
        StyleBox["string", "TI"], ",", " ", "\"\<Bech32m\>\""}], "]"}]], 
      "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "5e64a961-df63-42fd-b01a-4ad63bf61231"],
     "\[LineSeparator]",
     "gives ",
     Cell[BoxData["True"], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "09826e32-80c3-4467-a537-8f0db125b2bc"],
     " only if ",
     StyleBox["string", "TI"],
     " is valid under that one variant."
    }],ExpressionUUID->"a824d8c7-75e7-4d7f-ac9e-534184c3e412"]}
  }]], "Usage",ExpressionUUID->"720a55de-eb88-4b5f-8212-0292a28cb87a"]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[Cell[BoxData[Cell[TextData[{
  Cell[BoxData[
   DynamicBox[ToBoxes[
     If[CurrentValue[
        EvaluationCell[], "CellGroupOpen"] =!= Closed, 
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], 
      Rotate[
       Style[
        Graphics[{
          Thickness[0.18], 
          RGBColor[0.8509803921568627, 0.396078431372549, 0], 
          Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
         PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
        0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]],
    ImageSizeCache->{
     13.600000000000001`, {-0.1685058593749993, 13.768505859375}}]],
   ExpressionUUID->"8847d4bd-2b98-41d9-b800-c2d3e80bc606"],
  Cell[BoxData[
   TemplateBox[{1},
    "Spacer1"]],ExpressionUUID->"9c7e559f-0b80-4fd7-90c0-c940dd0b4285"],
  "Details and Options"
 }], "NotesFrameText",ExpressionUUID->
  "52ec4bd0-caca-4b6d-ac4f-4e59ea1efe87"]],ExpressionUUID->"150c7cd7-53a8-\
4b33-a759-e92da8ce87f9"]], "NotesSection",
 ShowGroupOpener->"Thumbnail",
 WholeCellGroupOpener->True,
 CellGroupingRules->{"SectionGrouping", 50},
 CacheGraphics->False,
 CellID->1222466493,ExpressionUUID->"c840f640-7be7-4697-8d21-77198907e543"],

Cell["\<\
The one-argument form accepts either variant, which is right for recognizing \
a Bech32 string of unknown provenance.\
\>", "Notes",ExpressionUUID->"ed94cc9e-ecca-4448-b16b-1f0d5f18eab9"],

Cell[TextData[{
 "The two-argument form takes ",
 Cell[BoxData["\<\"Bech32\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "7be62af3-f84b-4ab3-afe4-bcf42c73648f"],
 " or ",
 Cell[BoxData["\<\"Bech32m\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "1695f960-7b89-47ad-b815-e020b0e5a62b"],
 ". BIP350 states that no string is valid under both, so the valid vectors of \
each variant are the invalid vectors of the other."
}], "Notes",ExpressionUUID->"76543b44-024c-4bef-a4c0-45fd34da9293"],

Cell[TextData[{
 "All the BIP173 rules are applied: character range 33 to 126, no mixed case, \
a non-empty human-readable part before the last ",
 Cell[BoxData["\<\"1\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "94ee982c-2f34-44e7-9c57-2e328c94b898"],
 ", at least six data characters after it, an alphabet check on the data, and \
the checksum itself."
}], "Notes",ExpressionUUID->"9e758401-2c36-4d6d-a5e4-b64fcb6fddb4"],

Cell[TextData[{
 "With the default ",
 Cell[BoxData[
  RowBox[{"\<\"MaximumLength\"\>", " ", "->", " ", "90"}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "29a73aef-aabf-4c5f-a78d-c726a0ec7a0b"],
 ", the BIP173 limit, a longer string gives ",
 Cell[BoxData["False"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "e6e8fe97-8339-4629-ba76-253aa6acfd18"],
 ". Set the option to ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["Infinity"]], "paclet:ref/Infinity"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "7c5c76c8-e46a-48fc-a9e4-9c0fb298e873"],
 " for a Lightning BOLT11 invoice."
}], "Notes",ExpressionUUID->"90e879b6-f994-4474-93b4-a88b06f40da8"],

Cell[TextData[{
 "Anything that is not a ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["String"]], "paclet:ref/String"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "5dd6dc62-7cfc-46f4-9878-15f7cb324dc6"],
 " gives ",
 Cell[BoxData["False"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "d6ed46e5-a1eb-499e-9bd4-5836b85e68f6"],
 "."
}], "Notes",ExpressionUUID->"fe9eb865-3065-4136-98ef-22905a6d8c1e"],

Cell[BoxData[GridBox[{
   {Cell["      ", "TableRowIcon",ExpressionUUID->
     "25144f80-6d5a-4cbe-9563-7f207f81167e"], Cell["", "TableText",
     FontWeight->Bold,ExpressionUUID->"7970038d-fc0f-4072-bcd6-ab3fe93fd339"],
     Cell["", "TableText",
     FontWeight->Bold,ExpressionUUID->"0fa12c0f-5361-47be-8b9a-e3e6ee130588"],
     Cell["", "TableText",
     FontWeight->Bold,ExpressionUUID->"c3209011-0c15-4fdc-bed6-4884a3e745d5"]},
   {Cell["      ", "TableRowIcon",ExpressionUUID->
     "5c12b5c6-cf0b-400e-bc95-24b51bf44b1f"], Cell[TextData[Cell[
    BoxData["\"\<MaximumLength\>\""], "InlineFormula",
     FontFamily->"Source Sans Pro",
     FontSize->0.9 Inherited,ExpressionUUID->
     "9d893470-6d73-449d-b709-0057b55173cb"]], "TableText",ExpressionUUID->
     "74100f3f-3dba-4696-ad1c-579af2fbf1bb"], Cell[TextData[Cell[BoxData[
    "90"], "InlineFormula",
     FontFamily->"Source Sans Pro",
     FontSize->0.9 Inherited,ExpressionUUID->
     "7febce22-fd93-475c-a978-b11df47219e1"]], "TableText",ExpressionUUID->
     "dc7e3cd3-b14b-4e74-923a-191939f30110"], Cell[TextData[{
     "longest permitted input; the BIP173 limit, liftable to ",
     Cell[BoxData[
      TemplateBox[{
        Cell[
         TextData["Infinity"]], "paclet:ref/Infinity"},
       "RefLink",
       BaseStyle->"InlineFormula"]], "InlineFormula",
      FontFamily->"Source Sans Pro",ExpressionUUID->
      "8828e3ba-2d5e-49d0-ad3b-cfbf006c6561"],
     " for BOLT11"
    }], "TableText",ExpressionUUID->"1c2cdbd5-e88e-4600-b327-f00ed1e7387f"]}
  }]], "3ColumnTableMod",
 GridBoxOptions->{
 GridBoxBackground->{"Columns" -> {{None}}, "Rows" -> {None, {None}}},
 GridBoxDividers->{
  "Rows" -> {{
     True, True, 
      True}}}},ExpressionUUID->"ebe4664f-1702-4b8b-976c-bc8fd9f08d79"]
}, Closed]],

Cell["", "PageDelimiter",ExpressionUUID->"98d0dd8c-6e54-4c8a-8d5c-21fd3a45e12d"],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[
     MatchQ[
      CurrentValue[
       EvaluationNotebook[], {
       TaggingRules, "Openers", "PrimaryExamplesSection"}, Open], 
      Alternatives[True, Open]], 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]],
   ImageSizeCache->{
    13.600000000000001`, {4.251494140625001, 9.348505859375}}]],
  ExpressionUUID->"a925ee99-a3a6-42d5-910b-4cc65fb4c108"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"4f14995a-b4fe-4100-b990-48941e9a412e"],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(13)", "ExampleCount",ExpressionUUID->
  "6aec3614-a9e4-4ab4-b55b-9e37cc3e0203"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1018297002,ExpressionUUID->"0d632eb6-338b-4b2a-a267-8e33d1c0797a"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<WolframInstitute`Puzzles`\>\"", "]"}]], "Input", \
"ExampleInitialization",
 CellLabel->"In[1]:=",
 CellID->1969679695,ExpressionUUID->"869b5e5a-2f5c-43d0-b2f2-6d05204932cc"],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "35382136-c12f-4df1-a257-add5b040ebfd"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"cf4145c2-fcac-4665-8772-16113e465040"],
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "998c9674-a5a6-401d-9040-a44b2e36367d"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1220529671,ExpressionUUID->"f79d670a-3bd1-4455-a622-d226f1de6bb3"],

Cell[TextData[{
 "The BIP173 test vector ",
 Cell[BoxData["\<\"A12UEL5L\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "abf17bf3-033e-4c23-b9ff-59f165ffa2e6"],
 " is valid Bech32:"
}], "ExampleText",
 CellTags->
  "TextAnnotation",ExpressionUUID->"9c86c4f5-16e8-4952-bb35-0298f4bbc7a0"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", 
  RowBox[{"\"\<A12UEL5L\>\"", ",", " ", "\"\<Bech32\>\""}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"a0be8531-ecfe-46c4-94a7-fdf833812677"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"bd05256e-09c8-4f84-a312-e7aa2349eed1"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "07aa022a-6594-4810-8d47-eed15d2ae0be"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"310547ad-1588-4db4-\
8e97-3fb190d5045c"],

Cell[TextData[{
 "The BIP350 test vector ",
 Cell[BoxData["\<\"A1LQFN3A\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "ec36478d-b75f-4605-ac2c-40810eeaf83e"],
 " is valid Bech32m:"
}], "ExampleText",ExpressionUUID->"d043c368-ef68-4251-9d01-961910f6eff2"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", 
  RowBox[{"\"\<A1LQFN3A\>\"", ",", " ", "\"\<Bech32m\>\""}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"a0af3138-701e-4c79-9c6f-95a25bac67cf"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"b1064e99-1758-4639-8ee1-cdea30bd5877"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "28058ac4-28c0-4310-80aa-64963ef096c6"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"629d4377-b412-4d93-\
8a5f-bd46328ffeb0"],

Cell["Either one is recognized by the one-argument form:", "ExampleText",ExpressionUUID->"7353e6d2-fae6-4e37-9b1e-5e51e4dae2e9"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", "\"\<A1LQFN3A\>\"", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"9152e505-4271-42fb-966e-f01209e2f70f"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"b2f48206-c2e3-4c7a-a70e-1491650e1ab5"]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "fa52bbe3-3934-4e64-b5ad-d022eca4a5e4"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"28104cc1-4841-418a-8e01-76baf9316f95"],
 "Scope",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(4)", "ExampleCount",ExpressionUUID->
  "fcabc497-655a-4626-921c-872c5036e4b9"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1293636265,ExpressionUUID->"dc94cf34-437b-4cfd-b7a4-0ab0d4389c3a"],

Cell["\<\
No string is valid under both variants, so a Bech32m vector fails a Bech32 \
test:\
\>", "ExampleText",ExpressionUUID->"a0a3a414-75a5-4369-b948-e89ed56297f4"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", 
  RowBox[{"\"\<A1LQFN3A\>\"", ",", " ", "\"\<Bech32\>\""}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"6530a268-647e-4d63-a9bb-537bd587f440"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"bc6099c6-ad0b-4db2-a7da-aa3288e2e5ba"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "27f20ab4-696a-41f2-bb3b-961e6bee6d43"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"ccca7b9c-f42d-4df2-\
af0d-7adb75690821"],

Cell[TextData[{
 "The BIP173 invalid vector ",
 Cell[BoxData["\<\"x1b4n0q5v\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "f3fcef1e-af76-405e-9984-f17d992c201d"],
 " holds ",
 Cell[BoxData["b"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "830c09a2-35fc-4143-89f9-7cd9b5b7a165"],
 ", which is not in the Bech32 alphabet:"
}], "ExampleText",ExpressionUUID->"88fca97f-f4ba-47dc-a6cb-378664e15ff4"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", "\"\<x1b4n0q5v\>\"", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"aa160c8d-c0a2-4c9b-bffb-9f1ef9a23908"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"9bde68ce-257b-4735-8cec-dff71e32b728"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "0d85bf1a-1dcc-4003-bdf9-2386a925ae3c"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"6cef4152-ded8-4413-\
bdab-2d417187f719"],

Cell[TextData[{
 "The BIP173 invalid vector ",
 Cell[BoxData["\<\"li1dgmt3\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "78c2dbd5-6da5-451d-b872-6adbe2b3e817"],
 " has fewer than six characters after the separator:"
}], "ExampleText",ExpressionUUID->"ca4f032f-4480-4056-be54-e79ae99f010f"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", "\"\<li1dgmt3\>\"", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"7af2b5aa-2b94-4d5f-b96d-48e59a66a457"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"40f5eb85-5749-4431-88f9-8f9a751571a6"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "8b6d4009-486d-430b-9a7d-e3240fc93152"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"153a3d4b-0fee-4925-\
b972-0bf18118ff65"],

Cell[TextData[{
 "A non-string gives ",
 Cell[BoxData["False"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "a7b9dab7-c218-4f6d-812d-bf73f0a8893d"],
 " rather than an error:"
}], "ExampleText",ExpressionUUID->"80c0b544-4588-4ed4-a60d-fbad46aa914d"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", "42", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"de10feb9-3427-4f5b-bf9a-9dc03145ce6f"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"f7fdea65-ae10-4cef-afd5-98e8fd39fd1b"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "13f76321-275b-47f8-951e-106b9bc7d87e"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"8aa227ef-c02c-45db-80b9-73bde3ed8d35"],
 "Options",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "5168cd9e-d915-41a3-846f-c37277e390ee"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->2061341341,ExpressionUUID->"52d5019a-af94-451c-916e-3675ef268686"],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "44602acf-d838-497b-a236-a9abf026f1ef"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"eb03633c-ded0-43d9-9cf0-8161bd7f117a"],
 "MaximumLength",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount",ExpressionUUID->
  "7afef00b-aaeb-4d0a-92c3-bff97ae1134a"]
}], "ExampleSubsection", "ExampleSubsection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,ExpressionUUID->"1002ceed-66e4-40d8-9b36-3c01717114bd"],

Cell["\<\
The BIP173 invalid vector that exceeds 90 characters is rejected under the \
default:\
\>", "ExampleText",ExpressionUUID->"427d9a85-4345-40c8-9a66-1cbc240d823f"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", 
  "[", "\"\<\
an84characterslonghumanreadablepartthatcontainsthenumber1andtheexcludedcharact\
ersbio1569pvx\>\"", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"3b1f14de-7715-4b68-ae12-6102be9b8782"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"77b886b3-725f-459c-a4b8-70e155e23e7c"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "5460e88d-dc31-4564-889b-ab28ffa7d6f2"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"e5eef88f-2e67-4c3f-\
8267-3a071db8762d"],

Cell["\<\
Its checksum is in fact correct, so lifting the limit accepts it:\
\>", "ExampleText",ExpressionUUID->"1ab311ab-1806-4ce7-87f8-a2eeca127ee2"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", 
  RowBox[{"\"\<\
an84characterslonghumanreadablepartthatcontainsthenumber1andtheexcludedcharact\
ersbio1569pvx\>\"", ",", " ", 
   RowBox[{"\"\<MaximumLength\>\"", " ", "->", " ", "Infinity"}]}], 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"a4052017-536a-47e8-9358-0d0d68f32bcf"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"26248ccc-49d4-4b83-9db7-03b5ff6344de"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "173cc88b-76d7-4372-9353-6b0c07de77d8"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"58eeb740-fdf9-422b-a8e4-53c2aaf9fa99"],
 "Properties & Relations",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "ba17a739-191c-45ed-8c78-34c0be042adb"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->2123667759,ExpressionUUID->"86addc98-6034-4b39-bce7-9009b5944740"],

Cell[TextData[{
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["Bech32Decode"]], 
    "paclet:WolframInstitute/Puzzles/ref/Bech32Decode", 
    "WolframInstitute/Puzzles Package Symbol"},
   "PackageLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "e345051a-4804-4293-be2a-66c76a1972d3"],
 " gives the same verdict with the reason attached:"
}], "ExampleText",ExpressionUUID->"ce6e54b6-69c3-4883-af33-6b537f709605"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"FailureQ", "[", 
  RowBox[{"Bech32Decode", "[", "\"\<li1dgmt3\>\"", "]"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"f21d6bbd-1864-4330-b5b1-b2ca69448ac7"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"bed1a413-9401-40f2-96a9-53f79b9bd164"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "74ef76ab-d40e-4dd6-8289-2ed5fe8550f9"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"f512577d-3208-4370-\
9684-cf6fba5d2505"],

Cell["\<\
A valid Bech32 string need not be a valid segregated witness address, since \
the witness version and program length are checked one layer up:\
\>", "ExampleText",ExpressionUUID->"ad35b2bc-fdd0-4b4b-8416-59732b271a57"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"Bech32Q", "[", "\"\<a12uel5l\>\"", "]"}], ",", " ", 
   RowBox[{"SegWitAddressQ", "[", "\"\<a12uel5l\>\"", "]"}]}], "}"}]], "Input",\

 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"9e230dc8-e8e2-48d3-93f4-87cdc6cae34a"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"True", ",", "False"}], "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"d0edd4e1-7052-48ca-bf5d-6b2bbf399ed0"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "9f7bf6aa-b8eb-48a3-9b79-3e2992127d07"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"3cd248e3-74b9-41c2-a96b-37f7a9d9298c"],
 "Possible Issues",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "5de1fdb3-5982-4f58-9863-5a76f0a8c57e"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1305812373,ExpressionUUID->"1946dba2-7060-43bf-bce1-e08a4005df83"],

Cell[TextData[{
 "The BIP173 invalid vector ",
 Cell[BoxData["\<\"A1G7SGD8\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "684501e3-a0cd-4aa7-a0a8-526233bd99f5"],
 " has its checksum computed over the upper-case human-readable part, which \
no correct implementation accepts:"
}], "ExampleText",ExpressionUUID->"93fbfb5a-ccdb-44cc-9d77-1e48b91532eb"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", "\"\<A1G7SGD8\>\"", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"759e4be4-df82-40a6-b0d1-d51f32cbe00c"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"2da0f1eb-fda7-4c7b-9164-28453008d9fb"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "5f13aa34-80e5-4e15-a234-c8c58f733375"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"7b6be79d-9ffb-44c0-\
aab0-5361dd6aec7e"],

Cell["\<\
An empty human-readable part is rejected even though the rest of the string \
looks well formed:\
\>", "ExampleText",ExpressionUUID->"d494b0aa-cf21-4786-a7dc-fe2e920a9dcf"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Bech32Q", "[", "\"\<1qzzfhee\>\"", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"57a3a8c6-8c3c-4ba0-a7c3-b1d7481aaebe"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"47bc42a3-0855-4d4f-9808-838b7908781f"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, 
       "RelatedFunction.png"]]], GridBox[{
      {
       StyleBox[
        RowBox[{"See", " ", "Also"}], "SeeAlsoSection"]},
      {Cell[TextData[{
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Bech32Decode"]], 
           "paclet:WolframInstitute/Puzzles/ref/Bech32Decode", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "59cdd3c0-021d-4bd9-a274-3a6a59941e56"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Bech32Encode"]], 
           "paclet:WolframInstitute/Puzzles/ref/Bech32Encode", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "6325f6f0-a254-4aca-82a2-d72bbc2fd90c"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["SegWitAddressQ"]], 
           "paclet:WolframInstitute/Puzzles/ref/SegWitAddressQ", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "08a54ea1-d2c9-4794-bf3e-391dfbc9a877"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Base58CheckQ"]], 
           "paclet:WolframInstitute/Puzzles/ref/Base58CheckQ", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "b99330c5-74a8-42bd-937f-d06948c26a04"]
       }], "SeeAlso",ExpressionUUID->"a8ef080c-0f09-4c7e-a6bf-54a41cf93e25"]}
     }]}
  }]], "SeeAlsoSection",ExpressionUUID->"f19e9e8e-4493-450e-9377-\
11c78c5b9c21"],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, 
       "RelatedGuide.png"]]], GridBox[{
      {
       StyleBox[
        RowBox[{"Related", " ", "Guides"}], "MoreAboutSection"]},
      {
       RowBox[{"\[FilledVerySmallSquare]", Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Encodings"]], 
           "paclet:WolframInstitute/Puzzles/guide/Encodings"},
          "RefLinkPlain",
          BaseStyle->{"MoreAbout"}]], "MoreAbout",ExpressionUUID->
         "ca11b521-ea30-4b68-88e9-61aee363b40b"]}]}
     }]}
  }]], "MoreAboutSection",ExpressionUUID->"fc0df445-dd77-4967-9eed-\
5787216b262b"],

Cell[" ", "FooterCell",ExpressionUUID->"8979ea6c-9ec6-4b6e-8bee-2a105e8b0bbc"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{900, 830},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
WindowTitle->"Bech32Q",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "", "LinkTrails" -> "", 
  "ExampleCounter" -> 1, 
  "Openers" -> {
   "PrimaryExamplesSection" -> Open, "ExampleSection" -> {"0" -> Open}, 
    "AllOptsTable" -> Closed}, "NewStyles" -> True, 
  "CitationPopupData" -> $Failed, "ShowCitation" -> False, "HasOptions" -> 
  True, "RootCaptions" -> "", "HeaderCoreAreaLink" -> {}, 
  "Metadata" -> {
   "built" -> "{2026, 8, 27, 0, 11, 21.870989}", 
    "history" -> {"XX", "", "", ""}, "context" -> "WolframInstitute`Puzzles`",
     "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Wolfram Institute/ Puzzles Symbol", "language" -> "en", "paclet" -> 
    "WolframInstitute/Puzzles", "status" -> "None", "summary" -> 
    "PackageLink[Bech32Q,paclet : WolframInstitute/Puzzles/ref/Bech32Q, \
WolframInstitute/Puzzles Package Symbol][string] gives True if string is a \
valid Bech32 or Bech32m string, and False otherwise. \
PackageLink[Bech32Q,paclet : WolframInstitute/Puzzles/ref/Bech32Q, \
WolframInstitute/Puzzles Package Symbol][string, Bech32m] gives True only if \
string is valid under that one variant.", "synonyms" -> {}, "tabletags" -> {},
     "title" -> "Bech32Q", "titlemodifier" -> "", "metadescription" -> "", 
    "windowtitle" -> "Bech32Q", "type" -> "Symbol", "uri" -> 
    "WolframInstitute/Puzzles/ref/Bech32Q", "WorkflowDockedCell" -> ""}, 
  "SearchTextTranslated" -> ""},
CellContext->CellGroup,
FrontEndVersion->"15.0 for Mac OS X ARM (64-bit) (May 19, 2026)",
StyleDefinitions->FrontEnd`FileName[{"Wolfram"}, "Reference.nb"],
ExpressionUUID->"3ac70e48-09e8-4dd7-b59b-f9cc7fcc9d14"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "TextAnnotation"->{
  Cell[17778, 472, 341, 9, 70, "ExampleText",ExpressionUUID->"9c86c4f5-16e8-4952-bb35-0298f4bbc7a0",
   CellTags->"TextAnnotation"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"TextAnnotation", 40464, 1129}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[575, 21, 5555, 137, 70, "AnchorBarGrid",ExpressionUUID->"8bee2932-be1b-4ebd-8172-cf96094863a6",
 CellID->1],
Cell[6133, 160, 107, 0, 70, "ContextNameCell",ExpressionUUID->"000e81df-5d4b-4b7b-b22a-9b4d505f378f"],
Cell[CellGroupData[{
Cell[6265, 164, 550, 14, 70, "ObjectNameGrid",ExpressionUUID->"2a75fccd-c217-4cc1-bac7-9d1b0fc6e93b"],
Cell[6818, 180, 2051, 54, 70, "Usage",ExpressionUUID->"720a55de-eb88-4b5f-8212-0292a28cb87a"]
}, Open  ]],
Cell[CellGroupData[{
Cell[8906, 239, 1444, 34, 70, "NotesSection",ExpressionUUID->"c840f640-7be7-4697-8d21-77198907e543",
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->1222466493],
Cell[10353, 275, 197, 3, 70, "Notes",ExpressionUUID->"ed94cc9e-ecca-4448-b16b-1f0d5f18eab9"],
Cell[10553, 280, 596, 13, 70, "Notes",ExpressionUUID->"76543b44-024c-4bef-a4c0-45fd34da9293"],
Cell[11152, 295, 480, 9, 70, "Notes",ExpressionUUID->"9e758401-2c36-4d6d-a5e4-b64fcb6fddb4"],
Cell[11635, 306, 833, 22, 70, "Notes",ExpressionUUID->"90e879b6-f994-4474-93b4-a88b06f40da8"],
Cell[12471, 330, 533, 16, 70, "Notes",ExpressionUUID->"fe9eb865-3065-4136-98ef-22905a6d8c1e"],
Cell[13007, 348, 1766, 37, 70, "3ColumnTableMod",ExpressionUUID->"ebe4664f-1702-4b8b-976c-bc8fd9f08d79"]
}, Closed]],
Cell[14788, 388, 80, 0, 70, "PageDelimiter",ExpressionUUID->"98d0dd8c-6e54-4c8a-8d5c-21fd3a45e12d"],
Cell[CellGroupData[{
Cell[14893, 392, 1402, 37, 70, "PrimaryExamplesSection",ExpressionUUID->"0d632eb6-338b-4b2a-a267-8e33d1c0797a",
 CellID->1018297002],
Cell[16298, 431, 216, 4, 70, "Input",ExpressionUUID->"869b5e5a-2f5c-43d0-b2f2-6d05204932cc",
 CellID->1969679695],
Cell[CellGroupData[{
Cell[16539, 439, 1236, 31, 70, "ExampleSection",ExpressionUUID->"f79d670a-3bd1-4455-a622-d226f1de6bb3",
 CellID->1220529671],
Cell[17778, 472, 341, 9, 70, "ExampleText",ExpressionUUID->"9c86c4f5-16e8-4952-bb35-0298f4bbc7a0",
 CellTags->"TextAnnotation"],
Cell[CellGroupData[{
Cell[18144, 485, 243, 4, 70, "Input",ExpressionUUID->"a0be8531-ecfe-46c4-94a7-fdf833812677"],
Cell[18390, 491, 110, 1, 70, "Output",ExpressionUUID->"bd05256e-09c8-4f84-a312-e7aa2349eed1"]
}, Open  ]],
Cell[CellGroupData[{
Cell[18537, 497, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"310547ad-1588-4db4-8e97-3fb190d5045c"],
Cell[18764, 504, 310, 7, 70, "ExampleText",ExpressionUUID->"d043c368-ef68-4251-9d01-961910f6eff2"],
Cell[CellGroupData[{
Cell[19099, 515, 244, 4, 70, "Input",ExpressionUUID->"a0af3138-701e-4c79-9c6f-95a25bac67cf"],
Cell[19346, 521, 110, 1, 70, "Output",ExpressionUUID->"b1064e99-1758-4639-8ee1-cdea30bd5877"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[19505, 528, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"629d4377-b412-4d93-8a5f-bd46328ffeb0"],
Cell[19732, 535, 128, 0, 70, "ExampleText",ExpressionUUID->"7353e6d2-fae6-4e37-9b1e-5e51e4dae2e9"],
Cell[CellGroupData[{
Cell[19885, 539, 202, 3, 70, "Input",ExpressionUUID->"9152e505-4271-42fb-966e-f01209e2f70f"],
Cell[20090, 544, 110, 1, 70, "Output",ExpressionUUID->"b2f48206-c2e3-4c7a-a70e-1491650e1ab5"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[20261, 552, 1227, 31, 70, "ExampleSection",ExpressionUUID->"dc94cf34-437b-4cfd-b7a4-0ab0d4389c3a",
 CellID->1293636265],
Cell[21491, 585, 168, 3, 70, "ExampleText",ExpressionUUID->"a0a3a414-75a5-4369-b948-e89ed56297f4"],
Cell[CellGroupData[{
Cell[21684, 592, 243, 4, 70, "Input",ExpressionUUID->"6530a268-647e-4d63-a9bb-537bd587f440"],
Cell[21930, 598, 111, 1, 70, "Output",ExpressionUUID->"bc6099c6-ad0b-4db2-a7da-aa3288e2e5ba"]
}, Open  ]],
Cell[CellGroupData[{
Cell[22078, 604, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"ccca7b9c-f42d-4df2-af0d-7adb75690821"],
Cell[22305, 611, 502, 12, 70, "ExampleText",ExpressionUUID->"88fca97f-f4ba-47dc-a6cb-378664e15ff4"],
Cell[CellGroupData[{
Cell[22832, 627, 203, 3, 70, "Input",ExpressionUUID->"aa160c8d-c0a2-4c9b-bffb-9f1ef9a23908"],
Cell[23038, 632, 111, 1, 70, "Output",ExpressionUUID->"9bde68ce-257b-4735-8cec-dff71e32b728"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[23198, 639, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"6cef4152-ded8-4413-bdab-2d417187f719"],
Cell[23425, 646, 346, 7, 70, "ExampleText",ExpressionUUID->"ca4f032f-4480-4056-be54-e79ae99f010f"],
Cell[CellGroupData[{
Cell[23796, 657, 202, 3, 70, "Input",ExpressionUUID->"7af2b5aa-2b94-4d5f-b96d-48e59a66a457"],
Cell[24001, 662, 111, 1, 70, "Output",ExpressionUUID->"40f5eb85-5749-4431-88f9-8f9a751571a6"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[24161, 669, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"153a3d4b-0fee-4925-b972-0bf18118ff65"],
Cell[24388, 676, 299, 7, 70, "ExampleText",ExpressionUUID->"80c0b544-4588-4ed4-a60d-fbad46aa914d"],
Cell[CellGroupData[{
Cell[24712, 687, 188, 3, 70, "Input",ExpressionUUID->"de10feb9-3427-4f5b-bf9a-9dc03145ce6f"],
Cell[24903, 692, 111, 1, 70, "Output",ExpressionUUID->"f7fdea65-ae10-4cef-afd5-98e8fd39fd1b"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[25075, 700, 1229, 31, 70, "ExampleSection",ExpressionUUID->"52d5019a-af94-451c-916e-3675ef268686",
 CellID->2061341341],
Cell[CellGroupData[{
Cell[26329, 735, 1220, 30, 70, "ExampleSubsection",ExpressionUUID->"1002ceed-66e4-40d8-9b36-3c01717114bd"],
Cell[27552, 767, 171, 3, 70, "ExampleText",ExpressionUUID->"427d9a85-4345-40c8-9a66-1cbc240d823f"],
Cell[CellGroupData[{
Cell[27748, 774, 292, 6, 70, "Input",ExpressionUUID->"3b1f14de-7715-4b68-ae12-6102be9b8782"],
Cell[28043, 782, 111, 1, 70, "Output",ExpressionUUID->"77b886b3-725f-459c-a4b8-70e155e23e7c"]
}, Open  ]],
Cell[CellGroupData[{
Cell[28191, 788, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"e5eef88f-2e67-4c3f-8267-3a071db8762d"],
Cell[28418, 795, 151, 2, 70, "ExampleText",ExpressionUUID->"1ab311ab-1806-4ce7-87f8-a2eeca127ee2"],
Cell[CellGroupData[{
Cell[28594, 801, 382, 8, 70, "Input",ExpressionUUID->"a4052017-536a-47e8-9358-0d0d68f32bcf"],
Cell[28979, 811, 110, 1, 70, "Output",ExpressionUUID->"26248ccc-49d4-4b83-9db7-03b5ff6344de"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Closed]],
Cell[CellGroupData[{
Cell[29162, 820, 1244, 31, 70, "ExampleSection",ExpressionUUID->"86addc98-6034-4b39-bce7-9009b5944740",
 CellID->2123667759],
Cell[30409, 853, 508, 13, 70, "ExampleText",ExpressionUUID->"ce6e54b6-69c3-4883-af33-6b537f709605"],
Cell[CellGroupData[{
Cell[30942, 870, 242, 4, 70, "Input",ExpressionUUID->"f21d6bbd-1864-4330-b5b1-b2ca69448ac7"],
Cell[31187, 876, 110, 1, 70, "Output",ExpressionUUID->"bed1a413-9401-40f2-96a9-53f79b9bd164"]
}, Open  ]],
Cell[CellGroupData[{
Cell[31334, 882, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"f512577d-3208-4370-9684-cf6fba5d2505"],
Cell[31561, 889, 228, 3, 70, "ExampleText",ExpressionUUID->"ad35b2bc-fdd0-4b4b-8416-59732b271a57"],
Cell[CellGroupData[{
Cell[31814, 896, 313, 7, 70, "Input",ExpressionUUID->"9e230dc8-e8e2-48d3-93f4-87cdc6cae34a"],
Cell[32130, 905, 159, 3, 70, "Output",ExpressionUUID->"d0edd4e1-7052-48ca-bf5d-6b2bbf399ed0"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[32350, 915, 1237, 31, 70, "ExampleSection",ExpressionUUID->"1946dba2-7060-43bf-bce1-e08a4005df83",
 CellID->1305812373],
Cell[33590, 948, 405, 8, 70, "ExampleText",ExpressionUUID->"93fbfb5a-ccdb-44cc-9d77-1e48b91532eb"],
Cell[CellGroupData[{
Cell[34020, 960, 202, 3, 70, "Input",ExpressionUUID->"759e4be4-df82-40a6-b0d1-d51f32cbe00c"],
Cell[34225, 965, 111, 1, 70, "Output",ExpressionUUID->"2da0f1eb-fda7-4c7b-9164-28453008d9fb"]
}, Open  ]],
Cell[CellGroupData[{
Cell[34373, 971, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"7b6be79d-9ffb-44c0-aab0-5361dd6aec7e"],
Cell[34600, 978, 182, 3, 70, "ExampleText",ExpressionUUID->"d494b0aa-cf21-4786-a7dc-fe2e920a9dcf"],
Cell[CellGroupData[{
Cell[34807, 985, 202, 3, 70, "Input",ExpressionUUID->"57a3a8c6-8c3c-4ba0-a7c3-b1d7481aaebe"],
Cell[35012, 990, 111, 1, 70, "Output",ExpressionUUID->"47bc42a3-0855-4d4f-9808-838b7908781f"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[35174, 997, 2549, 67, 70, "SeeAlsoSection",ExpressionUUID->"f19e9e8e-4493-450e-9377-11c78c5b9c21"],
Cell[37726, 1066, 698, 19, 70, "MoreAboutSection",ExpressionUUID->"fc0df445-dd77-4967-9eed-5787216b262b"],
Cell[38427, 1087, 78, 0, 70, "FooterCell",ExpressionUUID->"8979ea6c-9ec6-4b6e-8bee-2a105e8b0bbc"]
}
]
*)

(* End of internal cache information *)

