How to derive the tezos public key from the points on the curve (SECP256K1 or P-256)












6















How can I derive Tezos public key from x,y points on the curve (either SECP256K1 or P-256)?



For example for Ethereum you can compute this using Keccak-256 on the [x,y].
The address is then obtained by taking the last 40 bytes (20 hex chars) and prefixing it with 0x for a total of 42 bytes.









share



























    6















    How can I derive Tezos public key from x,y points on the curve (either SECP256K1 or P-256)?



    For example for Ethereum you can compute this using Keccak-256 on the [x,y].
    The address is then obtained by taking the last 40 bytes (20 hex chars) and prefixing it with 0x for a total of 42 bytes.









    share

























      6












      6








      6








      How can I derive Tezos public key from x,y points on the curve (either SECP256K1 or P-256)?



      For example for Ethereum you can compute this using Keccak-256 on the [x,y].
      The address is then obtained by taking the last 40 bytes (20 hex chars) and prefixing it with 0x for a total of 42 bytes.









      share














      How can I derive Tezos public key from x,y points on the curve (either SECP256K1 or P-256)?



      For example for Ethereum you can compute this using Keccak-256 on the [x,y].
      The address is then obtained by taking the last 40 bytes (20 hex chars) and prefixing it with 0x for a total of 42 bytes.







      address





      share












      share










      share



      share










      asked 7 hours ago









      Andrew PaulicekAndrew Paulicek

      864




      864






















          1 Answer
          1






          active

          oldest

          votes


















          4














          Public keys in Tezos are stored in compressed form:



          <1 byte prefix>|X



          1. Prefix is b'x02' if Y is even, b'x03' otherwise, now you have a compressed key of 33 bytes long;

          2. Add tezos prefix b'x03xfexe2V' for secp256k1, b'x03xb2x8bx7f' for p256;

          3. Encode with Base58 algo with checksum.


          Checkout pytezos.crypto sources for implementation examples.






          share|improve this answer








          New contributor




          Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "698"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftezos.stackexchange.com%2fquestions%2f621%2fhow-to-derive-the-tezos-public-key-from-the-points-on-the-curve-secp256k1-or-p%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            Public keys in Tezos are stored in compressed form:



            <1 byte prefix>|X



            1. Prefix is b'x02' if Y is even, b'x03' otherwise, now you have a compressed key of 33 bytes long;

            2. Add tezos prefix b'x03xfexe2V' for secp256k1, b'x03xb2x8bx7f' for p256;

            3. Encode with Base58 algo with checksum.


            Checkout pytezos.crypto sources for implementation examples.






            share|improve this answer








            New contributor




            Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              4














              Public keys in Tezos are stored in compressed form:



              <1 byte prefix>|X



              1. Prefix is b'x02' if Y is even, b'x03' otherwise, now you have a compressed key of 33 bytes long;

              2. Add tezos prefix b'x03xfexe2V' for secp256k1, b'x03xb2x8bx7f' for p256;

              3. Encode with Base58 algo with checksum.


              Checkout pytezos.crypto sources for implementation examples.






              share|improve this answer








              New contributor




              Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                4












                4








                4







                Public keys in Tezos are stored in compressed form:



                <1 byte prefix>|X



                1. Prefix is b'x02' if Y is even, b'x03' otherwise, now you have a compressed key of 33 bytes long;

                2. Add tezos prefix b'x03xfexe2V' for secp256k1, b'x03xb2x8bx7f' for p256;

                3. Encode with Base58 algo with checksum.


                Checkout pytezos.crypto sources for implementation examples.






                share|improve this answer








                New contributor




                Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                Public keys in Tezos are stored in compressed form:



                <1 byte prefix>|X



                1. Prefix is b'x02' if Y is even, b'x03' otherwise, now you have a compressed key of 33 bytes long;

                2. Add tezos prefix b'x03xfexe2V' for secp256k1, b'x03xb2x8bx7f' for p256;

                3. Encode with Base58 algo with checksum.


                Checkout pytezos.crypto sources for implementation examples.







                share|improve this answer








                New contributor




                Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 4 hours ago









                Michael ZaikinMichael Zaikin

                713




                713




                New contributor




                Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Michael Zaikin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Tezos Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftezos.stackexchange.com%2fquestions%2f621%2fhow-to-derive-the-tezos-public-key-from-the-points-on-the-curve-secp256k1-or-p%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    What are all the squawk codes?

                    What are differences between VBoxVGA, VMSVGA and VBoxSVGA in VirtualBox?

                    Hudsonelva