(covers information from several alternate timelines)
Vessels were often registered by agency. They may have recorded a vessel's name, registry number, history, and basic ship information. (TOS: "The Ultimate Computer") This information was generally transmitted via registration beam. (TOS: "Mudd's Women") These registries could also be forged. (DS9: "The Maquis, Part I")
Throughout the 20th century, both civil and military aircraft were registered. In addition to registration, military aircraft were given serial numbers. One of these registry abbreviations, first used by American civil aviation, later appeared on Earth shuttles and starships. This was the abbreviation NC. An example of an NC registry was "NC 18602" (the California Clipper). (TOS: "Tomorrow is Yesterday"; VOY: "The 37's"; ENT: "Broken Bow")
In the 23rd and 24th centuries, Starfleet vessels were able to check both historical registries from Earth and Vulcan as well as the Starfleet Registry. (TOS: "Space Seed", "The Ultimate Computer"; TNG: "Unification I")
Registry numbers and prefixes
In some governments and agencies, a ship entered into a registry received a prefix that was placed before the vessel's name. This prefix was used to easily identify the vessel as belonging to that agency.
A registry prefix should not be confused with a ship's prefix code.
Vessel prefixes include:
† With Earth's national prefixes (British HMS and Russian VK) still in use up to the founding of the Federation, it is probable that "USS" still meant "United States Ship" in the same time frame, but we only have one example to look at.
Items listed in a registry generally had a number or code to help identify the specific entry.
In some registries, the registry number was preceded by an abbreviation as well:
Aside from the registry prefixes, Starfleet has also used letters after the main registry prefix to further define specific types of craft. This was seen in the freighter USS Huron, with its registry of NCC-F1513 and the Antares-type ships with the registry NCC-G1465. (TAS: "More Tribbles, More Troubles", "The Pirates of Orion")
The first Earth ship to have warp drive installed, Bonaventure, had an anomalous arrangement of the registry numbers, 10281NCC. (TAS: "The Time Trap") So did USS Nash, with the registry NCC-2010-5, and the SS Columbia, with the registry NC-5940-1. (TOS: "The Cage"; DS9: "Trials and Tribble-ations")
Shuttlecraft assigned to starbases and other installations were given registries indicating their origin. Such vessels were the da Vinci SB4-0314⁄2 from Starbase 4 and the Picasso SB11-1201⁄1 from Starbase 11. (TOS: "Court Martial", "Let That Be Your Last Battlefield") The shuttlecraft Verne assigned to Relay Station 47 was simply given the registry RS-47. (TNG: "Aquiel")
On Starfleet display graphics, Klingon, Romulan, and Cardassian starships had had registry numbers or identification codes without a letter prefix. These included ships like the Klingon IKS Fek'lhr (454435), Romulan warbird PWB Tomal (19386), and a Cardassian warship (324384950). (DS9: "Image in the Sand"; TNG: "The Wounded")
In the alternate reality, an escape pod of the USS Enterprise was registered as 313-C. Starfleet did not use registry prefixes on small craft such as jumpships and military shuttles that were not assigned to a starship. (Star Trek; Star Trek Into Darkness)
Starfleet sometimes used sequential lettering after a registry number was repeated to honor a former vessel. (Star Trek IV: The Voyage Home)
Examples of this include:
|USS Excalibur||NCC-1664-M||31st century|
|USS Enterprise||NCC-1701-J||26th century|
|USS Relativity||NCV-474439-G||29th century|
|USS Tikhov||NCC-1067-M||32nd century|
|USS Voyager||NCC-74656-J||31st century|
The most famous registry number, of course, is "NCC-1701" of the original USS Enterprise. It was chosen by Matt Jefferies, who was a pilot before joining the Star Trek staff, and based the registry number on 20th century aircraft registration codes. In the early 20th century, the letter "N" indicated a United States origin, and the letter "C" indicated a civilian aircraft. As American craft used NC and Soviet craft used CCCC, Jefferies combined the two as NCC. His philosophy was, "If we do anything in space, we (Americans and Russians) have to do it together." In a sketch of the Enterprise, drawn by Jefferies, he states the numbers "1701" stand for the 17th cruiser design, serial number #1.  Also, upon choosing the Enterprise's registry number, Jefferies decided that the number should be easily readable, so he was careful to avoid numbers that could be confusing, such as 3, 6 and 8. (Star Trek Magazine issue 162, p. 25)
According to the Star Trek: Deep Space Nine Technical Manual, the registry prefix NXP was used for study models, also called pathfinders, in the development phase of a starship class. For the Defiant-class escort, the pathfinder was designated NXP-2365WP/T. According to the Star Trek Encyclopedia, the registry prefix for the SS Odin was NGL and for the Milan it was NDT.
Based on usage – VK Yuri Gagarin and VK Velikan – it is probable that the "VK" prefix was used on Russian starships in Star Trek. In the real world, the Russians do not use prefixes for their ship names. VK, however might be an homage to Tom Clancy. In the book The Hunt for Red October, the primary Alfa-class attack sub is named V.K. Konovalov, in honor of Vladimir Konstantinovich Konovalov.
According to the Star Trek: Ships of the Line (2009) calendar (for the month of December), the registry prefix "X" was used for static test models. An example was the "X-17B", which was used for evaluating the performance of a refitted Constitution-class heavy cruiser in the mid-2260s.