The ScriptPubKey is a script which controls how bitcoin can be spent. In english, most bitcoin scripts translate as follows: “In order to spend this bitcoin, one must produce a signature belonging to this public key…”, followed by a public key. More commonly, public key hashes are used instead of the public keys themselves, but the concept is the same.

A ScriptPubKey is often called a locking script because it locks the bitcoin until someone can provide an answer to unlock the bitcoin. The answer, called the ScriptSig, is provided when this bitcoin is spent in a future transaction.