Skip to content

Instantly share code, notes, and snippets.

@elmariachi111
Created September 26, 2025 17:57
Show Gist options
  • Select an option

  • Save elmariachi111/581790440596cba3508f4aef8aea8952 to your computer and use it in GitHub Desktop.

Select an option

Save elmariachi111/581790440596cba3508f4aef8aea8952 to your computer and use it in GitHub Desktop.
Nillion / Privy
If you need to auth against Nillion using an external wallet (and not a keypair), e.g. Privy / Metamask, you have several options. Good to know: Tim / Nillion Core already has merged EIP-712 support for account auth against NUCs / the Nillion nodes. This will solve *a lot* that I built customly.
Here's the approach that I built at https://welshare.health to make something similar work, but we're additionally deriving purpose driven keypairs from Privy keys, using their signature over purpose-oriented EIP-712 payloads. Here's our docs: https://docs.welshare.app/basics/key-management. We're caching the private keys ephemerally on the user's client. This might change, as `did:nil` seems to be deprecated and replaced with the well understood did:key method soon (ask Nillion for reasoning, I'm just a "client" here ;) )
If you feel adventurous, Privy actually *can* sign raw data, that would imo also work for other ecdsa / secp256 based chains (like Cosmos): https://docs.privy.io/wallets/using-wallets/other-chains. The NUC / blindfold library code that I've read so far required a *keypair* and not a signature, so this will not work if you're using the TS libraries (like secretvaults-ts). But again, the library code is currently extended to support signers instead of keypairs to authenticate.
Here's the ticket that started the implementation -> https://github.com/NillionNetwork/nuc-ts/issues/78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment