Elliptic Curve Public Key Bytes
Turn a private key into a shareable public key — bytes and object, both
- serialized_key
- public_bytes
- public_key
Public keys are the shareable half of an ECDSA signing setup: the signer keeps the private key, everyone else gets the public key, and ECVerify uses it to confirm signatures. ECPublicKey ("Elliptic Curve Public Key Bytes") is the node that produces that half, and it does it in every format a puzzle might expect - standard SubjectPublicKeyInfo, OpenSSH's ssh-ed25519-style line, bare PKCS1, or raw compressed/uncompressed points.
How it works
It derives the public key from an elliptic curve private key. The curve and the "where does the private key come from" question are the two things you set, and they're the parts people get wrong.
key_source is a toggle:
- Fresh Key (the default) - the node generates a brand-new private key internally, then derives the public key from it. Handy for standalone "make me a keypair" purposes, but the private half evaporates unless you captured it elsewhere, so you get a public key with no way to sign. That's usually a mistake for a real signing loop.
- From Loaded Key - the node takes the
serialized_key(KEYOBJ) you wire in fromECPrivateKey'sprivate_keyoutput and derives the public key from that. This is the one you actually want for signing: same keypair, public half in hand, private half still available forECSign.
The curve must match whatever the private key was generated on. curve_name picks it - SECP256K1, SECP256R1, the Brainpool set, and friends. If the curves disagree, nothing downstream verifies.
Outputs and serialization
Two outputs, and they're different flavors of the same thing:
public_bytes(BYTESLIKE) - the serialized key, formatted per yourformatting/encodingchoices.SubjectPublicKeyInfo+PEMis the boring, compatible default.CompressedPoint/UncompressedPointwithX962encoding gives you the raw math (the barexcoordinate, orx,y) - compact, and the kind of thing an ARG would actually hide in a text file.public_key(KEYOBJ) - the parsed object for wiring straight intoECVerify'spublic_keyinput.
One wrinkle: the schema shows a default of PKCS8 on the formatting dropdown, but PKCS8 isn't in the actual choice list - pick from the five that are (SubjectPublicKeyInfo, OpenSSH, PKCS1, CompressedPoint, UncompressedPoint). A minor UI quirk in a pack that's honest about being an amateur project.
Installing it
Same as every node in this pack - it's part of the ComfyUI ARG Toolkit:
cd ComfyUI/custom_nodes
git clone https://github.com/AzelusLightvale/ComfyUI-ARG-Toolkit
Restart ComfyUI, or find "ComfyUI ARG Toolkit" in ComfyUI Manager and let it sort the dependencies (cryptography does the heavy lifting).
Where people get burned
- Fresh Key + forgetting the private half. You end up with a public key you can't sign with. If the goal is a keypair, always source the private key from
ECPrivateKeyand togglekey_sourceto From Loaded Key. - Point formats look like garbage.
UncompressedPoint/X962output is raw bytes, not a-----BEGIN PUBLIC KEY-----block. If you're pasting this somewhere, you need the PEM/SubjectPublicKeyInfo combo instead. - Curve mismatch with the verifier.
ECVerifydoesn't care about curves (it just gets a key object), but the other side of the conversation does. Both sides have to agree.
Once you have public_bytes, the fun part begins: hide it in a watermark, scatter it through a text cipher, or just hand it to a friend so they can verify your signed messages.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| curve_name | COMBO | 9 options: SECP192R1, SECP224R1, SECP256K1, SECP256R1, SECP384R1, SECP521R1, +3 | |
| key_source | BOOLEAN | true | The source of the private key to be used to sign the message |
| formatting | COMBO | PKCS8 | 5 options: SubjectPublicKeyInfo, OpenSSH, PKCS1, CompressedPoint, UncompressedPoint |
| encoding | COMBO | PEM | 4 options: PEM, DER, OpenSSH, X962 |
| serialized_keyopt | KEYOBJ | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| public_bytes | BYTESLIKE | — |
| public_key | KEYOBJ | — |