(* 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[     46512,       1226]
NotebookOptionsPosition[     37498,       1058]
NotebookOutlinePosition[     39539,       1107]
CellTagsIndexPosition[     39461,       1102]
WindowTitle->Secp256k1PointAdd
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->
           "72de7cf7-1525-4758-9460-8587e47eca43"], 
          TemplateBox[{8},
           "Spacer1"]}]],
         TextAlignment->Center,ExpressionUUID->
         "f38a3223-08c7-454d-a230-9a2043f0d987"],
        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->
           "f7260650-f395-4855-9b22-f5f6f56ed979"]
         }],ExpressionUUID->"f7396fb3-5992-4224-bf15-bbe771ab638f"],
         StripOnInput->False],{
        StyleBox["\"Infinity\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup["paclet:ref/Infinity"], Delimiter, 
         StyleBox[
          "\"Functions\"", "SeeAlsoSection", FontSize -> 14, FontSlant -> 
           "Italic", StripOnInput -> False] :> 
         NotebookFind[EvaluationNotebook[], "SeeAlsoSection", All, CellStyle],
          StyleBox[
          StyleBox[
           "\"Secp256k1PointQ\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/Secp256k1PointQ"], 
         StyleBox[
          StyleBox[
           "\"Secp256k1Point\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/Secp256k1Point"], 
         StyleBox[
          StyleBox[
           "\"Secp256k1PublicKey\"", "SeeAlsoRelated", StripOnInput -> False],
            "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/Secp256k1PublicKey"], 
         StyleBox[
          StyleBox[
           "\"TaprootOutputKey\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/TaprootOutputKey"], 
         StyleBox[
          StyleBox[
           "\"BIP32ChildKey\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/BIP32ChildKey"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"SeeAlso"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "975a7064-c013-4b65-a66c-12b51f893de5"],
     "\[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->
           "bb6429b4-da31-4356-a7fb-9b1eda216330"]
         }],ExpressionUUID->"ce3aefb7-c945-4726-8c71-be728ec7a471"],
         StripOnInput->False],{
        "\"Derivation\"" :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/guide/Derivation"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"MoreAbout"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "6a8ceb9b-fcb6-4e6d-80f2-206ef12a284f"],
     "\[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->
           "5cf4d344-0535-4f94-b21b-5a9e841d96f7"]
         }],ExpressionUUID->"8976c5da-4e70-450a-aae2-92e9b9f63de4"],
         StripOnInput->False],{
        "\"WolframInstitute/Puzzles/ref/Secp256k1PointAdd\"" :> None, 
         "\"Copy Wolfram Documentation Center URL\"" :> 
         CopyToClipboard["WolframInstitute/Puzzles/ref/Secp256k1PointAdd"], 
         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/Secp256k1PointAdd.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/Secp256k1PointAdd" <> ".html"], 
              None}]}]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"URLMenu"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "682fcf16-780e-4c75-b559-4dcc2aaf669c"]
    }], "AnchorBar",
     CacheGraphics->False,ExpressionUUID->
     "2fe78c73-448f-403f-8f11-fd2dd467ccda"]}
  }]], "AnchorBarGrid",
 CellID->1,ExpressionUUID->"0b6c2b5f-4849-414e-a3d1-c0365ee39898"],

Cell["WolframInstitute`Puzzles`", "ContextNameCell",ExpressionUUID->"6923aaf8-652c-42b3-9fc1-c5f220f3d267"],

Cell[CellGroupData[{

Cell[BoxData[GridBox[{
   {Cell[TextData[{
     Cell[
     "Secp256k1PointAdd", "ObjectName",ExpressionUUID->
      "4f0b06bf-f6e6-49ca-b2f1-63cd9e4db504"],
     Cell[BoxData[
      TemplateBox[{8},
       "Spacer1"]],ExpressionUUID->"1097f7ca-4a91-4858-8026-17b3fc4e163d"],
     Cell[BoxData[
     ""], "ObjectNameTranslation",ExpressionUUID->
      "9bcfaaa2-996f-4e26-b149-21a8a09d724d"]
    }],ExpressionUUID->"581cde27-3c2e-4f4a-85f8-fc3b89a240bd"], 
    "\[SpanFromLeft]"}
  }]], "ObjectNameGrid",ExpressionUUID->"7820cc95-a785-4f5d-b775-\
b9ecee1609aa"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{
       TemplateBox[{
         Cell[
          TextData["Secp256k1PointAdd"]], 
         "paclet:WolframInstitute/Puzzles/ref/Secp256k1PointAdd", 
         "WolframInstitute/Puzzles Package Symbol"},
        "PackageLink",
        BaseStyle->"InlineFormula"], "[", 
       RowBox[{
        SubscriptBox[
         StyleBox["p", "TI"], 
         StyleBox["1", "TR"]], ",", " ", 
        SubscriptBox[
         StyleBox["p", "TI"], 
         StyleBox["2", "TR"]]}], "]"}]], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "e05a1742-28ab-4ef2-95af-d366a7cdb5a8"],
     "\[LineSeparator]",
     "gives the secp256k1 group-law sum of two curve points."
    }],ExpressionUUID->"5e5f8ee9-6889-4bd1-8d07-95a8c24a95cf"]}
  }]], "Usage",ExpressionUUID->"f3dae90e-994a-4eaf-a77f-a99a94d1fbe7"]
}, 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->"9b4572b3-e889-44f5-b732-31e1b7732cf7"],
  Cell[BoxData[
   TemplateBox[{1},
    "Spacer1"]],ExpressionUUID->"4ef59f39-8e4f-4c26-a10e-7a4dddd3dffb"],
  "Details and Options"
 }], "NotesFrameText",ExpressionUUID->
  "71a082e2-f507-422a-a0b2-440ece758b07"]],ExpressionUUID->"999a96bb-8003-\
4093-a428-7553203e0535"]], "NotesSection",
 ShowGroupOpener->"Thumbnail",
 WholeCellGroupOpener->True,
 CellGroupingRules->{"SectionGrouping", 50},
 CacheGraphics->False,
 CellID->426370180,ExpressionUUID->"d9bfa33f-6562-415d-b807-f2432b96a84d"],

Cell[TextData[{
 "Each point is a coordinate pair ",
 Cell[BoxData[
  RowBox[{
   RowBox[{"{", 
    StyleBox["x", "TI"]}], ",", 
   RowBox[{
    StyleBox["y", "TI"], "}"}]}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "214e664c-597e-4160-9ab3-ed5a2de8af08"],
 " of residues satisfying ",
 Cell[BoxData[
  RowBox[{
   SuperscriptBox[
    StyleBox["y", "TI"], "2"], "=", 
   SuperscriptBox[
    StyleBox["x", "TI"], "3"], "+", "7"}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "437a23fd-dff7-4fbb-8be5-1984eb69015a"],
 ", or ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["Infinity"]], "paclet:ref/Infinity"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "7154a654-747f-4078-abe4-56e62c4b7991"],
 " for the point at infinity."
}], "Notes",ExpressionUUID->"5cc161f7-6955-4b31-8615-9225b90d2424"],

Cell[TextData[{
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["Infinity"]], "paclet:ref/Infinity"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "f9d4677e-e79c-4aeb-9d12-1cca69dab5a4"],
 " is the group identity, so adding it returns the other point unchanged."
}], "Notes",ExpressionUUID->"4a3e087e-f498-4004-8937-eddf4dfbb072"],

Cell[TextData[{
 "Two points with the same ",
 Cell[BoxData[
  StyleBox["x", "TI"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "43e388e9-cfa0-4e86-a2bf-3c94add7154a"],
 " and opposite ",
 Cell[BoxData[
  StyleBox["y", "TI"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "89f358cf-d5ba-4d9e-8769-f7c10ce00fdd"],
 " are inverse, and their sum is ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["Infinity"]], "paclet:ref/Infinity"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "e48ff9bd-8a21-49b0-9fd8-55870bedb3b4"],
 "."
}], "Notes",ExpressionUUID->"d375e3b9-986b-4944-a2d9-416c2d593ae9"],

Cell[TextData[{
 "Distinct points use the chord slope, and a point added to itself uses the \
tangent slope; the curve coefficient ",
 Cell[BoxData[
  StyleBox["a", "TI"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "a427ac65-eca3-4a90-ba34-d7ae62c3ff4c"],
 " is zero, so the tangent slope is ",
 Cell[BoxData[
  RowBox[{"3", 
   SuperscriptBox[
    StyleBox["x", "TI"], "2"], "/", "2", 
   StyleBox["y", "TI"]}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "b1285ae0-e760-4b8e-b45d-f34ef2cb20e8"],
 "."
}], "Notes",ExpressionUUID->"a27a822e-5b8f-4f8b-a2a1-491474229ba5"],

Cell["\<\
Input that is not a point of the group matches no definition and the call is \
returned unevaluated.\
\>", "Notes",ExpressionUUID->"f0c86b8e-e419-4965-a0b4-f57e475b9c17"],

Cell["\<\
This is the addition that BIP32 public-parent derivation and the BIP341 \
taproot tweak are built from.\
\>", "Notes",ExpressionUUID->"c54ad2d7-1cfb-45b3-bba7-ac127a333d0a"]
}, Closed]],

Cell["", "PageDelimiter",ExpressionUUID->"0e2d94e3-3c45-491e-a540-28d48ae9aa0d"],

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->"6e93be49-38c7-4158-984d-a4960bdc9302"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"304cdc04-500a-4f61-907a-4c78a18077d5"],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(11)", "ExampleCount",ExpressionUUID->
  "3d4a9d70-36a8-442e-b156-ec43914f5966"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1998168868,ExpressionUUID->"e9ca68e9-a338-469e-a4b5-27f3d85661e3"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<WolframInstitute`Puzzles`\>\"", "]"}]], "Input", \
"ExampleInitialization",
 CellLabel->"In[1]:=",
 CellID->1969679695,ExpressionUUID->"e654abbc-78bc-4fba-ac6f-00c3e1b418aa"],

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->
  "e95e6683-a48b-404e-a988-cbaa484cdc75"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"2c7bc1d1-6e95-47d6-8c67-6335e339b9fb"],
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "e9e58ce5-0f92-4695-b496-f30fed70eba8"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->874892690,ExpressionUUID->"0cacaf7d-2cc6-4ead-be00-5859e57378bf"],

Cell["Doubling the generator gives the point of the scalar 2:", "ExampleText",
 CellTags->
  "TextAnnotation",ExpressionUUID->"cf7e4d7f-5f11-4810-b0e9-55b77d16b3f7"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Secp256k1PointAdd", "[", 
  RowBox[{
   RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}], ",", " ", 
   RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}]}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"19ca9307-0934-4975-b303-92b0798ac365"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "895658919265470042312529204259356923606441458296222098336843299132971889865\
97", ",", 
   "12158399299693830322967808612713398636155367887041628176798871954788371653\
930"}], "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"8d8d7780-9163-4648-980a-a8d2414f4256"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "61f9bec8-e760-4c6c-8c1f-15b308bbaedf"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"57f5d81e-05c3-4a31-\
a0fb-94ac8004d361"],

Cell["Adding two distinct points uses the chord through them:", "ExampleText",ExpressionUUID->"cdaad13a-3ee4-4fb0-b198-c670644df77a"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Secp256k1PointAdd", "[", 
  RowBox[{
   RowBox[{"Secp256k1Point", "[", 
    RowBox[{"Secp256k1PublicKey", "[", "3", "]"}], "]"}], ",", " ", 
   RowBox[{"Secp256k1Point", "[", 
    RowBox[{"Secp256k1PublicKey", "[", "5", "]"}], "]"}]}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"8d0662fe-7fe2-44a1-a51c-2026fd45efa4"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
  "212620573061516279535956850902804312781838294871758763779911892467163559470\
09", ",", 
   "41749993296225487051377864631615517161996906063147759678534462689479575333\
124"}], "}"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"c857aab6-eafc-4d1c-b0bb-65e995b3c2f7"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "4ed06a39-1b4c-4e77-8644-3178db5da644"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"4b3507b5-89da-43d2-\
b6e9-8189a881047b"],

Cell["That sum is the point of the sum of the scalars:", "ExampleText",ExpressionUUID->"3b0369ab-29a7-4d2b-a57c-f4e31eb181b8"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Secp256k1PointAdd", "[", 
   RowBox[{
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "3", "]"}], "]"}], ",", " ", 
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "5", "]"}], "]"}]}], "]"}], " ", "===",
   " ", 
  RowBox[{"Secp256k1Point", "[", 
   RowBox[{"Secp256k1PublicKey", "[", "8", "]"}], "]"}]}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"4ca54b4c-8b4c-4b08-be6f-b8380aecd36b"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"eeb4c13b-8fe0-4ef8-8f7f-f108f0ad2ee9"]
}, 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->
  "be17833f-8b0a-4773-a7ca-f324b5363cf2"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"61d2e7d1-4f33-4978-978a-5533d790aa77"],
 "Scope",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "08e213a9-6d18-4135-9ebd-f3917b1ec4ae"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1293636265,ExpressionUUID->"9c15a26a-1428-4002-8f16-caf85dfa0837"],

Cell["A point and its inverse sum to the point at infinity:", "ExampleText",ExpressionUUID->"df09228f-c79d-4ecd-8f43-dd5457db09ac"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Secp256k1PointAdd", "[", 
  RowBox[{
   RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}], ",", " ", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"First", "[", 
      RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}], "]"}], ",", " ", 
     
     RowBox[{
      RowBox[{"$Secp256k1", "[", "\"\<Prime\>\"", "]"}], " ", "-", " ", 
      RowBox[{"Last", "[", 
       RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}], "]"}]}]}], 
    "}"}]}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"f53942f4-2c01-4ddd-9810-74ebb61e899b"],

Cell[BoxData["\[Infinity]"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"0f586109-d1cf-4b39-b949-2c6f8bf11e4e"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "9afa10dc-cf22-4217-b3ed-10c46756ee97"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"d6e29f95-3c11-41f3-\
96a0-d92a5e897340"],

Cell["The point at infinity is the identity:", "ExampleText",ExpressionUUID->"90612c30-f32f-4948-b45a-c53db57b7e1c"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Secp256k1PointAdd", "[", 
   RowBox[{"Infinity", ",", " ", 
    RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}]}], "]"}], " ", "===",
   " ", 
  RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}]}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"9f5a39e7-d7a5-4b27-9ff9-175338cf0b61"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"f5924510-ecb4-4dac-9d86-e4848b80bb58"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "1133ce31-9870-4c7d-8d37-9a68fdf5b1f0"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"8303f498-4ad1-4d05-\
9ca6-70b7c8a671b6"],

Cell["\<\
A pair that is not on the curve is not a point of the group, so the sum is \
returned unevaluated:\
\>", "ExampleText",ExpressionUUID->"2f43b8a8-e746-4e42-b40d-a9eed38a76b5"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"MatchQ", "[", 
  RowBox[{
   RowBox[{"Secp256k1PointAdd", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"1", ",", " ", "1"}], "}"}], ",", " ", 
     RowBox[{"$Secp256k1", "[", "\"\<Generator\>\"", "]"}]}], "]"}], ",", " ",
    "_Secp256k1PointAdd"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"d4e9f535-ee22-454a-8617-8a6ab0b96a7b"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"158d41dc-3fa5-4ccc-9204-43610a124e5e"]
}, 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->
  "bc49e7e5-6316-4e17-b94c-431e819742f5"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"9dfa6ca7-8ae9-42e3-a51d-0d4852001841"],
 "Applications",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount",ExpressionUUID->
  "e5e4b91c-8216-48a2-aaae-e9d28a10efec"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->258228157,ExpressionUUID->"e9aeccf4-5919-4111-9fdd-c0c129c250f5"],

Cell["\<\
The BIP341 taproot tweak is one addition of the internal point and a \
hash-derived multiple of the generator:\
\>", "ExampleText",ExpressionUUID->"97711a54-571b-430f-86a4-39465a0b2fae"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"Normal", "[", 
   RowBox[{
   "TaprootOutputKey", 
    "[", "\"\<\
cc8a4bc64d897bddc5fbc2f670f7a8ba0b386779106cf1223c6fc5d7cd6fc115\>\"", "]"}], 
   "]"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"f9637f68-642d-4131-9813-b8a84dcdb259"],

Cell[BoxData["\<\"\
a60869f0dbcf1dc659c9cecbaf8050135ea9e8cdc487053f1dc6880949dc684c\"\>"], \
"Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"f46c0c86-b32d-4958-baeb-a5049adf6493"]
}, 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->
  "19cb3696-3f61-4be9-8a98-6a485d81110d"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"93489ed6-61c6-4ad6-a497-9f970f1a17b9"],
 "Properties & Relations",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "30f92b17-fb73-4b74-b43e-e2cec316b968"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->2123667759,ExpressionUUID->"dc3c63bb-6b8a-4dd9-9fc7-d332bad1e86c"],

Cell["The law is commutative:", "ExampleText",ExpressionUUID->"e0114581-83e7-45af-abeb-978dbefa5897"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Secp256k1PointAdd", "[", 
   RowBox[{
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "3", "]"}], "]"}], ",", " ", 
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "5", "]"}], "]"}]}], "]"}], " ", "===",
   " ", 
  RowBox[{"Secp256k1PointAdd", "[", 
   RowBox[{
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "5", "]"}], "]"}], ",", " ", 
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "3", "]"}], "]"}]}], "]"}]}]], "Input",\

 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"b4725a38-2274-4e6e-b8e9-512adc80725d"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"475dc164-c932-485c-9179-4ba4fc88bf99"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "4e876b34-5666-4aac-8644-eb3960532bb3"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"52f74d11-e42c-459a-\
b7c6-66bc8b7ef68c"],

Cell["It is associative, as a group law must be:", "ExampleText",ExpressionUUID->"89b54f27-25c9-45bb-b113-caf29c9b6532"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Secp256k1PointAdd", "[", 
   RowBox[{
    RowBox[{"Secp256k1PointAdd", "[", 
     RowBox[{
      RowBox[{"Secp256k1Point", "[", 
       RowBox[{"Secp256k1PublicKey", "[", "3", "]"}], "]"}], ",", " ", 
      RowBox[{"Secp256k1Point", "[", 
       RowBox[{"Secp256k1PublicKey", "[", "5", "]"}], "]"}]}], "]"}], ",", 
    " ", 
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "7", "]"}], "]"}]}], "]"}], " ", "===",
   " ", 
  RowBox[{"Secp256k1PointAdd", "[", 
   RowBox[{
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "3", "]"}], "]"}], ",", " ", 
    RowBox[{"Secp256k1PointAdd", "[", 
     RowBox[{
      RowBox[{"Secp256k1Point", "[", 
       RowBox[{"Secp256k1PublicKey", "[", "5", "]"}], "]"}], ",", " ", 
      RowBox[{"Secp256k1Point", "[", 
       RowBox[{"Secp256k1PublicKey", "[", "7", "]"}], "]"}]}], "]"}]}], 
   "]"}]}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"9b061c0c-f11b-4ffc-b77d-22d5491cff4b"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"f02b60bb-ba36-4fa8-a497-762c0cc45dc7"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "4362079b-7685-4fca-b52a-14122e17f537"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"33cf9130-00cf-4d9c-\
bb67-f551c505fe80"],

Cell["\<\
Every sum of points of the group is again a point of the group:\
\>", "ExampleText",ExpressionUUID->"df525933-2270-43fa-b8fc-e57e5469c0dc"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Secp256k1PointQ", "[", 
  RowBox[{"Secp256k1PointAdd", "[", 
   RowBox[{
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "12345", "]"}], "]"}], ",", " ", 
    RowBox[{"Secp256k1Point", "[", 
     RowBox[{"Secp256k1PublicKey", "[", "67890", "]"}], "]"}]}], "]"}], 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"7b4e9e91-cba6-43ae-a45a-acfecff8fd7c"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"c36cf1cd-2143-4ec7-a5d1-17197a6387b4"]
}, 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->
  "0750dff7-a529-4eee-a5bc-98c437a224d4"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"428f6974-dbb3-45b0-a8b8-0f88126555ea"],
 "Possible Issues",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount",ExpressionUUID->
  "f23b56fa-436b-4158-82ef-eecba99ba216"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1305812373,ExpressionUUID->"c86f06a2-8358-4aef-a786-77659080aae5"],

Cell["\<\
The result can be the point at infinity, which is not a coordinate pair and \
has no SEC1 encoding, so a caller that immediately encodes the sum must \
handle it:\
\>", "ExampleText",ExpressionUUID->"b40af9d5-7dcf-4837-bfa6-4e36b4b97347"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Secp256k1PointAdd", "[", 
  RowBox[{
   RowBox[{"Secp256k1Point", "[", 
    RowBox[{"Secp256k1PublicKey", "[", "4", "]"}], "]"}], ",", " ", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"First", "[", 
      RowBox[{"Secp256k1Point", "[", 
       RowBox[{"Secp256k1PublicKey", "[", "4", "]"}], "]"}], "]"}], ",", " ", 
     
     RowBox[{
      RowBox[{"$Secp256k1", "[", "\"\<Prime\>\"", "]"}], " ", "-", " ", 
      RowBox[{"Last", "[", 
       RowBox[{"Secp256k1Point", "[", 
        RowBox[{"Secp256k1PublicKey", "[", "4", "]"}], "]"}], "]"}]}]}], 
    "}"}]}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"36bdbb0e-77a7-428d-93a0-21cf0a3fb576"],

Cell[BoxData["\[Infinity]"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"29751540-2c6b-4fd1-97cc-a56d4cbf50bf"]
}, 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["Secp256k1PointQ"]], 
           "paclet:WolframInstitute/Puzzles/ref/Secp256k1PointQ", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "ce9a033d-5bbd-469c-bf47-047c6069dac9"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Secp256k1Point"]], 
           "paclet:WolframInstitute/Puzzles/ref/Secp256k1Point", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "f89a0383-f407-47f7-a25d-2d576abb4646"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Secp256k1PublicKey"]], 
           "paclet:WolframInstitute/Puzzles/ref/Secp256k1PublicKey", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "726a34af-547a-48f7-af62-4de7c399678f"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["TaprootOutputKey"]], 
           "paclet:WolframInstitute/Puzzles/ref/TaprootOutputKey", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "ed31714a-169b-4192-ac6f-6bcc2687d091"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["BIP32ChildKey"]], 
           "paclet:WolframInstitute/Puzzles/ref/BIP32ChildKey", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "f035303b-d4f8-44c8-a991-d777c2ee169a"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Infinity"]], "paclet:ref/Infinity"},
          "RefLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "897916c8-74d1-4c53-88fc-2063d9fd63a1"]
       }], "SeeAlso",ExpressionUUID->"0565c2c0-7be8-4b7d-b421-1fd9892d4617"]}
     }]}
  }]], "SeeAlsoSection",ExpressionUUID->"e5361001-c515-4595-8213-\
b05eee07ef4e"],

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["Derivation"]], 
           "paclet:WolframInstitute/Puzzles/guide/Derivation"},
          "RefLinkPlain",
          BaseStyle->{"MoreAbout"}]], "MoreAbout",ExpressionUUID->
         "873f7a35-6755-4df1-8272-fbbb47536cf8"]}]}
     }]}
  }]], "MoreAboutSection",ExpressionUUID->"4b139e72-f7da-406b-8b8b-\
3522a01f5a66"],

Cell[" ", "FooterCell",ExpressionUUID->"aef2d3e1-90e3-4390-9597-0f71e612b14b"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{900, 830},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
WindowTitle->"Secp256k1PointAdd",
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, 48.771096}", 
    "history" -> {"XX", "", "", ""}, "context" -> "WolframInstitute`Puzzles`",
     "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Wolfram Institute/ Puzzles Symbol", "language" -> "en", "paclet" -> 
    "WolframInstitute/Puzzles", "status" -> "None", "summary" -> 
    "PackageLink[Secp256k1PointAdd, paclet : \
WolframInstitute/Puzzles/ref/Secp256k1PointAdd, WolframInstitute/Puzzles \
Package Symbol][p1, p2] gives the secp256k1 group-law sum of two curve \
points.", "synonyms" -> {}, "tabletags" -> {}, "title" -> "Secp256k1PointAdd",
     "titlemodifier" -> "", "metadescription" -> "", "windowtitle" -> 
    "Secp256k1PointAdd", "type" -> "Symbol", "uri" -> 
    "WolframInstitute/Puzzles/ref/Secp256k1PointAdd", "WorkflowDockedCell" -> 
    ""}, "SearchTextTranslated" -> ""},
CellContext->CellGroup,
FrontEndVersion->"15.0 for Mac OS X ARM (64-bit) (May 19, 2026)",
StyleDefinitions->FrontEnd`FileName[{"Wolfram"}, "Reference.nb"],
ExpressionUUID->"1a0a9ec8-e994-414a-ae3a-4427a767e133"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "TextAnnotation"->{
  Cell[16572, 455, 165, 2, 70, "ExampleText",ExpressionUUID->"cf7e4d7f-5f11-4810-b0e9-55b77d16b3f7",
   CellTags->"TextAnnotation"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"TextAnnotation", 39304, 1096}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[585, 21, 6590, 159, 70, "AnchorBarGrid",ExpressionUUID->"0b6c2b5f-4849-414e-a3d1-c0365ee39898",
 CellID->1],
Cell[7178, 182, 107, 0, 70, "ContextNameCell",ExpressionUUID->"6923aaf8-652c-42b3-9fc1-c5f220f3d267"],
Cell[CellGroupData[{
Cell[7310, 186, 560, 14, 70, "ObjectNameGrid",ExpressionUUID->"7820cc95-a785-4f5d-b775-b9ecee1609aa"],
Cell[7873, 202, 920, 24, 70, "Usage",ExpressionUUID->"f3dae90e-994a-4eaf-a77f-a99a94d1fbe7"]
}, Open  ]],
Cell[CellGroupData[{
Cell[8830, 231, 1443, 34, 70, "NotesSection",ExpressionUUID->"d9bfa33f-6562-415d-b807-f2432b96a84d",
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->426370180],
Cell[10276, 267, 1006, 32, 70, "Notes",ExpressionUUID->"5cc161f7-6955-4b31-8615-9225b90d2424"],
Cell[11285, 301, 434, 11, 70, "Notes",ExpressionUUID->"4a3e087e-f498-4004-8937-eddf4dfbb072"],
Cell[11722, 314, 799, 24, 70, "Notes",ExpressionUUID->"d375e3b9-986b-4944-a2d9-416c2d593ae9"],
Cell[12524, 340, 675, 18, 70, "Notes",ExpressionUUID->"a27a822e-5b8f-4f8b-a2a1-491474229ba5"],
Cell[13202, 360, 180, 3, 70, "Notes",ExpressionUUID->"f0c86b8e-e419-4965-a0b4-f57e475b9c17"],
Cell[13385, 365, 183, 3, 70, "Notes",ExpressionUUID->"c54ad2d7-1cfb-45b3-bba7-ac127a333d0a"]
}, Closed]],
Cell[13583, 371, 80, 0, 70, "PageDelimiter",ExpressionUUID->"0e2d94e3-3c45-491e-a540-28d48ae9aa0d"],
Cell[CellGroupData[{
Cell[13688, 375, 1402, 37, 70, "PrimaryExamplesSection",ExpressionUUID->"e9ca68e9-a338-469e-a4b5-27f3d85661e3",
 CellID->1998168868],
Cell[15093, 414, 216, 4, 70, "Input",ExpressionUUID->"e654abbc-78bc-4fba-ac6f-00c3e1b418aa",
 CellID->1969679695],
Cell[CellGroupData[{
Cell[15334, 422, 1235, 31, 70, "ExampleSection",ExpressionUUID->"0cacaf7d-2cc6-4ead-be00-5859e57378bf",
 CellID->874892690],
Cell[16572, 455, 165, 2, 70, "ExampleText",ExpressionUUID->"cf7e4d7f-5f11-4810-b0e9-55b77d16b3f7",
 CellTags->"TextAnnotation"],
Cell[CellGroupData[{
Cell[16762, 461, 333, 6, 70, "Input",ExpressionUUID->"19ca9307-0934-4975-b303-92b0798ac365"],
Cell[17098, 469, 315, 7, 70, "Output",ExpressionUUID->"8d8d7780-9163-4648-980a-a8d2414f4256"]
}, Open  ]],
Cell[CellGroupData[{
Cell[17450, 481, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"57f5d81e-05c3-4a31-a0fb-94ac8004d361"],
Cell[17677, 488, 133, 0, 70, "ExampleText",ExpressionUUID->"cdaad13a-3ee4-4fb0-b198-c670644df77a"],
Cell[CellGroupData[{
Cell[17835, 492, 403, 8, 70, "Input",ExpressionUUID->"8d0662fe-7fe2-44a1-a51c-2026fd45efa4"],
Cell[18241, 502, 315, 7, 70, "Output",ExpressionUUID->"c857aab6-eafc-4d1c-b0bb-65e995b3c2f7"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[18605, 515, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"4b3507b5-89da-43d2-b6e9-8189a881047b"],
Cell[18832, 522, 126, 0, 70, "ExampleText",ExpressionUUID->"3b0369ab-29a7-4d2b-a57c-f4e31eb181b8"],
Cell[CellGroupData[{
Cell[18983, 526, 533, 12, 70, "Input",ExpressionUUID->"4ca54b4c-8b4c-4b08-be6f-b8380aecd36b"],
Cell[19519, 540, 110, 1, 70, "Output",ExpressionUUID->"eeb4c13b-8fe0-4ef8-8f7f-f108f0ad2ee9"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[19690, 548, 1227, 31, 70, "ExampleSection",ExpressionUUID->"9c15a26a-1428-4002-8f16-caf85dfa0837",
 CellID->1293636265],
Cell[20920, 581, 131, 0, 70, "ExampleText",ExpressionUUID->"df09228f-c79d-4ecd-8f43-dd5457db09ac"],
Cell[CellGroupData[{
Cell[21076, 585, 618, 15, 70, "Input",ExpressionUUID->"f53942f4-2c01-4ddd-9810-74ebb61e899b"],
Cell[21697, 602, 117, 1, 70, "Output",ExpressionUUID->"0f586109-d1cf-4b39-b949-2c6f8bf11e4e"]
}, Open  ]],
Cell[CellGroupData[{
Cell[21851, 608, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"d6e29f95-3c11-41f3-96a0-d92a5e897340"],
Cell[22078, 615, 116, 0, 70, "ExampleText",ExpressionUUID->"90612c30-f32f-4948-b45a-c53db57b7e1c"],
Cell[CellGroupData[{
Cell[22219, 619, 379, 8, 70, "Input",ExpressionUUID->"9f5a39e7-d7a5-4b27-9ff9-175338cf0b61"],
Cell[22601, 629, 110, 1, 70, "Output",ExpressionUUID->"f5924510-ecb4-4dac-9d86-e4848b80bb58"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[22760, 636, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"8303f498-4ad1-4d05-9ca6-70b7c8a671b6"],
Cell[22987, 643, 184, 3, 70, "ExampleText",ExpressionUUID->"2f43b8a8-e746-4e42-b40d-a9eed38a76b5"],
Cell[CellGroupData[{
Cell[23196, 650, 424, 10, 70, "Input",ExpressionUUID->"d4e9f535-ee22-454a-8617-8a6ab0b96a7b"],
Cell[23623, 662, 110, 1, 70, "Output",ExpressionUUID->"158d41dc-3fa5-4ccc-9204-43610a124e5e"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[23794, 670, 1233, 31, 70, "ExampleSection",ExpressionUUID->"e9aeccf4-5919-4111-9fdd-c0c129c250f5",
 CellID->258228157],
Cell[25030, 703, 196, 3, 70, "ExampleText",ExpressionUUID->"97711a54-571b-430f-86a4-39465a0b2fae"],
Cell[CellGroupData[{
Cell[25251, 710, 362, 9, 70, "Input",ExpressionUUID->"f9637f68-642d-4131-9813-b8a84dcdb259"],
Cell[25616, 721, 182, 3, 70, "Output",ExpressionUUID->"f46c0c86-b32d-4958-baeb-a5049adf6493"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[25847, 730, 1244, 31, 70, "ExampleSection",ExpressionUUID->"dc3c63bb-6b8a-4dd9-9fc7-d332bad1e86c",
 CellID->2123667759],
Cell[27094, 763, 101, 0, 70, "ExampleText",ExpressionUUID->"e0114581-83e7-45af-abeb-978dbefa5897"],
Cell[CellGroupData[{
Cell[27220, 767, 703, 17, 70, "Input",ExpressionUUID->"b4725a38-2274-4e6e-b8e9-512adc80725d"],
Cell[27926, 786, 110, 1, 70, "Output",ExpressionUUID->"475dc164-c932-485c-9179-4ba4fc88bf99"]
}, Open  ]],
Cell[CellGroupData[{
Cell[28073, 792, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"52f74d11-e42c-459a-b7c6-66bc8b7ef68c"],
Cell[28300, 799, 120, 0, 70, "ExampleText",ExpressionUUID->"89b54f27-25c9-45bb-b113-caf29c9b6532"],
Cell[CellGroupData[{
Cell[28445, 803, 1062, 26, 70, "Input",ExpressionUUID->"9b061c0c-f11b-4ffc-b77d-22d5491cff4b"],
Cell[29510, 831, 110, 1, 70, "Output",ExpressionUUID->"f02b60bb-ba36-4fa8-a497-762c0cc45dc7"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[29669, 838, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"33cf9130-00cf-4d9c-bb67-f551c505fe80"],
Cell[29896, 845, 149, 2, 70, "ExampleText",ExpressionUUID->"df525933-2270-43fa-b8fc-e57e5469c0dc"],
Cell[CellGroupData[{
Cell[30070, 851, 461, 10, 70, "Input",ExpressionUUID->"7b4e9e91-cba6-43ae-a45a-acfecff8fd7c"],
Cell[30534, 863, 110, 1, 70, "Output",ExpressionUUID->"c36cf1cd-2143-4ec7-a5d1-17197a6387b4"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[30705, 871, 1237, 31, 70, "ExampleSection",ExpressionUUID->"c86f06a2-8358-4aef-a786-77659080aae5",
 CellID->1305812373],
Cell[31945, 904, 248, 4, 70, "ExampleText",ExpressionUUID->"b40af9d5-7dcf-4837-bfa6-4e36b4b97347"],
Cell[CellGroupData[{
Cell[32218, 912, 730, 18, 70, "Input",ExpressionUUID->"36bdbb0e-77a7-428d-93a0-21cf0a3fb576"],
Cell[32951, 932, 117, 1, 70, "Output",ExpressionUUID->"29751540-2c6b-4fd1-97cc-a56d4cbf50bf"]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[33107, 938, 3603, 95, 70, "SeeAlsoSection",ExpressionUUID->"e5361001-c515-4595-8213-b05eee07ef4e"],
Cell[36713, 1035, 700, 19, 70, "MoreAboutSection",ExpressionUUID->"4b139e72-f7da-406b-8b8b-3522a01f5a66"],
Cell[37416, 1056, 78, 0, 70, "FooterCell",ExpressionUUID->"aef2d3e1-90e3-4390-9597-0f71e612b14b"]
}
]
*)

(* End of internal cache information *)

