Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. Technical Discussion
  3. I'm adding support for multiple public keys per actor in Smithereen for future-proofing purposes.

I'm adding support for multiple public keys per actor in Smithereen for future-proofing purposes.

Scheduled Pinned Locked Moved Technical Discussion
activitypubmastodev
1 Cross-posts 37 Posts 4 Posters 14 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • silverpill@mitra.socialS silverpill@mitra.social

    @grishka @mariusor My actor has an ed25519 key. Check out FEP-521a - that's what Mastodon is implementing.

    grishka@mastodon.socialG This user is from outside of this forum
    grishka@mastodon.socialG This user is from outside of this forum
    grishka@mastodon.social
    wrote last edited by
    #28

    @silverpill @mariusor huh, interesting, I tried fetching your actor and it turns out one of the contexts uses a JSON-LD version that's too new for my JLD processor... Also probably the first time ever I'm seeing @ graph used in the wild.

    Not really a problem for me as I was going to put these two contexts into my resources anyway and I could as well edit them.

    1 Reply Last reply
    0
    • grishka@mastodon.socialG grishka@mastodon.social

      @silverpill @mariusor ok, so after actually reading the FEP, I see that the encoded representation of each key has a variable-length integer prefix specifying which kind of key it is. And it's also encoded into "base-58-btc" so that... implementers suffer? I don't get it. Why not just use base64, that seems like an unnecessary nuisance

      grishka@mastodon.socialG This user is from outside of this forum
      grishka@mastodon.socialG This user is from outside of this forum
      grishka@mastodon.social
      wrote last edited by
      #29

      @silverpill @mariusor so the prefix is always 2, which corresponds to "cidv2", which is quite useless, it could as well not be there

      grishka@mastodon.socialG 1 Reply Last reply
      0
      • grishka@mastodon.socialG grishka@mastodon.social

        @silverpill @mariusor so the prefix is always 2, which corresponds to "cidv2", which is quite useless, it could as well not be there

        grishka@mastodon.socialG This user is from outside of this forum
        grishka@mastodon.socialG This user is from outside of this forum
        grishka@mastodon.social
        wrote last edited by
        #30

        @silverpill @mariusor the example key from the FEP also uses 2 for that... The FEP itself says "Implementers can use cryptographic keys of any type for which a Multicodec prefix is registered.", I'm very confused. There's 0x1205 for RSA public keys and 0xed for ed25519 ones for example.

        grishka@mastodon.socialG 1 Reply Last reply
        0
        • grishka@mastodon.socialG grishka@mastodon.social

          @silverpill @mariusor the example key from the FEP also uses 2 for that... The FEP itself says "Implementers can use cryptographic keys of any type for which a Multicodec prefix is registered.", I'm very confused. There's 0x1205 for RSA public keys and 0xed for ed25519 ones for example.

          grishka@mastodon.socialG This user is from outside of this forum
          grishka@mastodon.socialG This user is from outside of this forum
          grishka@mastodon.social
          wrote last edited by
          #31

          @silverpill @mariusor what is even going on here. It's definitely not base58 decoding since I tried several different decoders and they all give the same result.

          The first key is from the Multikey array, the second one is the regular publicKey after base64 decoding.

          grishka@mastodon.socialG 1 Reply Last reply
          0
          • grishka@mastodon.socialG grishka@mastodon.social

            @silverpill @mariusor what is even going on here. It's definitely not base58 decoding since I tried several different decoders and they all give the same result.

            The first key is from the Multikey array, the second one is the regular publicKey after base64 decoding.

            grishka@mastodon.socialG This user is from outside of this forum
            grishka@mastodon.socialG This user is from outside of this forum
            grishka@mastodon.social
            wrote last edited by
            #32

            @silverpill @mariusor OpenSSL ain't having any of it either

            grishka@mastodon.socialG 1 Reply Last reply
            0
            • grishka@mastodon.socialG grishka@mastodon.social

              @silverpill @mariusor OpenSSL ain't having any of it either

              grishka@mastodon.socialG This user is from outside of this forum
              grishka@mastodon.socialG This user is from outside of this forum
              grishka@mastodon.social
              wrote last edited by
              #33

              @silverpill @mariusor ughhhhhhhh. So that's what the "multibase" thing is.... There's ANOTHER spec (https://www.w3.org/TR/cid/#multibase-0) that says that the first character of the string specifies which encoding it uses because it can be different (but not for this FEP). Amazing format. Very convenient to debug.

              After that change, it turns out that the RSA key is encoded as "the weird Misskey format" that Java can't parse natively, but I already have the code to handle that at least.

              grishka@mastodon.socialG 1 Reply Last reply
              0
              • grishka@mastodon.socialG grishka@mastodon.social

                @silverpill @mariusor ughhhhhhhh. So that's what the "multibase" thing is.... There's ANOTHER spec (https://www.w3.org/TR/cid/#multibase-0) that says that the first character of the string specifies which encoding it uses because it can be different (but not for this FEP). Amazing format. Very convenient to debug.

                After that change, it turns out that the RSA key is encoded as "the weird Misskey format" that Java can't parse natively, but I already have the code to handle that at least.

                grishka@mastodon.socialG This user is from outside of this forum
                grishka@mastodon.socialG This user is from outside of this forum
                grishka@mastodon.social
                wrote last edited by
                #34

                @silverpill @mariusor at last, I did it

                1 Reply Last reply
                0
                • grishka@mastodon.socialG grishka@mastodon.social

                  @silverpill @mariusor at last, I did it

                  silverpill@mitra.socialS This user is from outside of this forum
                  silverpill@mitra.socialS This user is from outside of this forum
                  silverpill@mitra.social
                  wrote last edited by
                  #35

                  @grishka @mariusor Sorry for the trouble 🙂
                  The expectation was that developers will use a library for base58-btc (and maybe for multicodecs too).

                  grishka@mastodon.socialG 1 Reply Last reply
                  0
                  • silverpill@mitra.socialS silverpill@mitra.social

                    @grishka @mariusor Sorry for the trouble 🙂
                    The expectation was that developers will use a library for base58-btc (and maybe for multicodecs too).

                    grishka@mastodon.socialG This user is from outside of this forum
                    grishka@mastodon.socialG This user is from outside of this forum
                    grishka@mastodon.social
                    wrote last edited by
                    #36

                    @silverpill @mariusor I did use a library (I copied that class out of some Java Bitcoin implementation), it's the single-character prefix that really tripped me up.

                    grishka@mastodon.socialG 1 Reply Last reply
                    0
                    • grishka@mastodon.socialG grishka@mastodon.social

                      @silverpill @mariusor I did use a library (I copied that class out of some Java Bitcoin implementation), it's the single-character prefix that really tripped me up.

                      grishka@mastodon.socialG This user is from outside of this forum
                      grishka@mastodon.socialG This user is from outside of this forum
                      grishka@mastodon.social
                      wrote last edited by
                      #37

                      @silverpill @mariusor the multicodec type prefixes are the ones I expected to begin with btw, so no problem with that and no brute-forcing necessary in the end.

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      Powered by NodeBB Contributors
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups