Restore your follow list with nak

Uh-oh, you just followed someone on a new Nostr client, and it wiped your entire follow list!

Let’s use nak to check if an older version of your follow list still exists somewhere on the network:

nak req -k 3 -a YOUR_PUBKEY wss://relay.example.com
  • Replace YOUR_PUBKEY with your hex pubkey (run nak decode <npub> to get it).
  • Replace wss://relay.example.com with a real relay. Keep trying different relays until you find it.
  • If you’ve set up NosDrive, make sure to check there too, as it backs up all versions of your replaceable events.

Once you’ve found your follow list on a relay, let’s sign a new event and republish it:

nak req -k 3 -a YOUR_PUBKEY wss://relay.old.com | jq -c '{kind, content, tags}' | nak event --sec YOUR_SECKEY wss://relay.new.com
  • Replace YOUR_PUBKEY with your hex pubkey.
  • Replace YOUR_SECKEY with your hex secret key (run nak decode <nsec> to get it).
  • Replace wss://relay.old.com with the relay where you found your follow list.
  • Replace wss://relay.new.com with any relay where you want to create your new follow list.

If this succeeded, go ahead and run history -c to clear your terminal history, since you copied your private key into the terminal session.

Now you can copy the new follow list to any additional relays:

nak req -k 3 -a YOUR_PUBKEY wss://relay.new.com | nak event wss://relay.other.com

Run this any number of times, replacing wss://relay.other.com each time.

That’s it! 🎉

If you couldn’t find your event, you may be out of luck.

To learn more about syncing data with nak, read Sync your data between relays with nak.


No comments yet.