diff --git a/cmd/chantools/vanitygen.go b/cmd/chantools/vanitygen.go index 68c46f3..7f6a809 100644 --- a/cmd/chantools/vanitygen.go +++ b/cmd/chantools/vanitygen.go @@ -73,6 +73,10 @@ func (c *vanityGenCommand) Execute(_ *cobra.Command, _ []string) error { if len(prefixBytes) < 2 { return fmt.Errorf("prefix must be at least 2 bytes") } + if len(prefixBytes) > 8 { + return fmt.Errorf("prefix too long, unlikely to find a key " + + "within billions of years") + } if !(prefixBytes[0] == 0x02 || prefixBytes[0] == 0x03) { return fmt.Errorf("prefix must start with 02 or 03 because " + "it's an EC public key")