{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":690380005,"defaultBranch":"main","name":"did-method-plc","ownerLogin":"snarfed","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2023-09-12T04:54:41.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/778068?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1694495809.0","currentOid":""},"activityList":{"items":[{"before":null,"after":"4382078f4d3b5fc06316dddead4944c322223984","ref":"refs/heads/fix-readme-publicKeyMultibase","pushedAt":"2023-09-12T05:16:49.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"snarfed","name":"Ryan Barrett","path":"/snarfed","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/778068?s=80&v=4"},"commit":{"message":"DO NOT MERGE: README: \"fix\" publicKeyMultibase in example DID doc\n\nlooking at the example DID doc in the README, I originally thought its publicKeyMultibase was wrong, since multicodec/multiformats think it's an IPv4 addr:\n\n```py\n>>> from multiformats import multibase, multicodec\n>>> multicodec.unwrap(multibase.decode('zSSa7w8s5aApu6td45gWTAAFkqCnaWY6ZsJ8DpyzDdYmVy4fARKqbn5F1UYBUMeVvYTBsoSoLvZnPdjd3pVHbmAHP'))\n(Multicodec(name='ip4', tag='multiaddr', code='0x04', status='permanent', description=''), b'\\xf8y\\xf8\\x1e\\xa2\\xc0?\\xf5=\\x89\\xf2\\xa1\\xe7\\x05\\x11<\\x8c\\xf2 \\x90A\\xc7\\xfb\\xe5\\x13E\\x12\\x8a\\x8d\\x8c2\\xd2\\x90\\x8c~4\\xa6\\xdc\\xba\\xb0\\xca\\xc7\\xe7\\xe6\\xd2\\xf3b.a!\\xed\\xef{\\xd5CEr\\x89\\xb2(\\xae\\x82=z')\n```\n\n...except https://github.com/bluesky-social/atproto/discussions/1510 seems to imply it may be correct after all? at least in the original DID doc format, which they're changing soon. the example there has the same problem, ie multiformats thinks it's in the IPv4 codec, so this is probably user error on my part.\n\nHere's how I got what I thought it should be, but now I'm not so sure.\n\n```py\n>>> from cryptography.hazmat.primitives.asymmetric import ec\n>>> from cryptography.hazmat.primitives import serialization\n>>> codec, data = multicodec.unwrap(multibase.decode('zDnaeh9v2RmcMo13Du2d6pjUf5bZwtauYxj3n9dYjw4EZUAR7'))\n>>> codec, data\n(Multicodec(name='p256-pub', tag='key', code='0x1200', status='draft', description='P-256 public Key (compressed)'), b'\\x02\\xf8y\\xf8\\x1e\\xa2\\xc0?\\xf5=\\x89\\xf2\\xa1\\xe7\\x05\\x11<\\x8c\\xf2 \\x90A\\xc7\\xfb\\xe5\\x13E\\x12\\x8a\\x8d\\x8c2\\xd2')\n>>> pubkey = ec.EllipticCurvePublicKey.from_encoded_point(ec.SECP256R1(), data)\n>>> pubkey_bytes = pubkey.public_bytes(serialization.Encoding.X962,\n serialization.PublicFormat.UncompressedPoint)\n>>> multibase.encode(multicodec.wrap(codec, pubkey_bytes), 'base58btc')\n'z4oJ8ekJXFNZSZQACfyPVuj5RPByc9XDvNzipbAgc5gkWVrhKhEJeXfMW5CXV4CdR5t5bbv6BHATqn51C9dxGHFYQb2b3'\n```","shortMessageHtmlLink":"DO NOT MERGE: README: \"fix\" publicKeyMultibase in example DID doc"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"startCursor":"Y3Vyc29yOnYyOpK7MjAyMy0wOS0xMlQwNToxNjo0OS4wMDAwMDBazwAAAAN-b74l","endCursor":"Y3Vyc29yOnYyOpK7MjAyMy0wOS0xMlQwNToxNjo0OS4wMDAwMDBazwAAAAN-b74l"}},"title":"Activity ยท snarfed/did-method-plc"}