diff --git a/key.go b/key.go index 2005ea2..2f193c1 100644 --- a/key.go +++ b/key.go @@ -59,10 +59,18 @@ var public = &cli.Command{ Action: func(ctx context.Context, c *cli.Command) error { args := c.Args().Slice() if len(args) == 0 && !isPiped() { - kr, _, err := gatherKeyerFromArguments(ctx, c) + kr, sk, err := gatherKeyerFromArguments(ctx, c) if err != nil { return err } + if c.Bool("with-parity") { + if sk == (nostr.SecretKey{}) { + return fmt.Errorf("--with-parity requires a plain secret key, not a bunker") + } + _, pk := btcec.PrivKeyFromBytes(sk[:]) + stdout(hex.EncodeToString(pk.SerializeCompressed())) + return nil + } pk, err := kr.GetPublicKey(ctx) if err != nil { return fmt.Errorf("failed to get public key: %w", err)