[#CPubKey-IsValid]
= xref:CPubKey.adoc[CPubKey]::IsValid
:relfileprefix: ../
:mrdocs:

Check syntactic correctness&period;

== Synopsis

Declared in `&lt;pubkey&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
IsValid() const;
----

== Description

When setting a pubkey (Set()) or deserializing fails (its header bytes don&apos;t match the length of the data), the size is set to 0&period; Thus, by checking size, one can observe whether Set() or deserialization has failed&period;

This does not check for more than that&period; In particular, it does not verify that the coordinates correspond to a point on the curve (see IsFullyValid() for that instead)&period;

Note that this is consensus critical as CheckECDSASignature() calls it!

== Return Value

true if the key has a nonzero size (syntactically valid)&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
