Prior to the Warring States Period (fifth century BC), only the royal family and the aristocratic elite could generally take surnames. Historically there was also difference between xing (姓) and shi (氏). Xing were surnames held by the immediate royal family. They generally are composed of a nü (女, meaning "female") radical which suggests that they originated from matriarchal societies based on maternal lineages. Another hypothesis has been proposed by sinologist Léon Vandermeersch upon observation of the evolution of characters in oracular scripture from the Shang dynasty through the Zhou. The "female" radical seems to appear at the Zhou period next to Shang sinograms indicating an ethnic group or a tribe. This combination seems to designate specifically a female and could mean "lady of such or such clan". The structure of the xing sinogram could reflect the fact that in the royal court of Zhou, at least in the beginning, only females (wives married into the Zhou family from other clans) were called by their birth clan name, while the men were usually designated by their title or fief.
Prior to the Qin Dynasty (third century BC) China was largely a feudal society. As fiefdoms were divided and subdivided among descendants, so additional sub-surnames known as shi were created to distinguish between different seniority of lineages among the nobles though in theory they shared the same ancestor. In this way, a nobleman would hold a shi and a xing. After the states of China were unified by Qin Shi Huang in 221 BC, surnames gradually devolved to the lower classes and the difference between xing and shi blurred.
Shi surnames, many of which survive to the present day, usually from a/an:
1 Xing: These were usually reserved for the central lineage of the royal family, with collateral lineages taking their own shi. Of the six or so common xing, only Jiang (姜) and Yao (姚) have survived as frequently occurring surnames.
2 Royal decree by the Emperor, such as Kuang (鄺).
3 State name: Many commoners took the name of their state, either to show their continuing allegiance or as a matter of national and ethnic identity. Common examples include Song (宋), Wu (吴/吳), Chen (陈/陳), Tan (譚/谭). Not surprisingly, due to the population size of the peasantry, these are some of the most common Chinese surnames.
4 Name of a fief or place of origin. Fiefdoms were often granted to collateral branches of the aristocracy and it was natural as part of the process of sub-surnaming for their names to be used. An example is Di, Marquis of Ouyangting, whose descendants took the surname Ouyang. There are some two hundred examples of this identified, often of two-character surnames, but few have survived to the present.
5 Names of an ancestor: Like the previous example, this was also a common origin with close to 500 or 600 examples, 200 of which are two-character surnames. Often an ancestor's style name would be used. For example, Yuan Taotu took the second character of his grandfather's style name Boyuan (伯爰) as his surname. Sometimes titles granted to ancestors could also be taken as surnames.
6 Seniority within the family: In ancient usage, the characters of meng (孟), zhong (仲), shu (叔) and ji (季) were used to denote the first, second, third and fourth eldest sons in a family. These were sometimes adopted as surnames. Of these, Meng is the best known, being the surname of the philosopher Mencius.
7 Occupation: These could arise from both official positions, as in the case of Sima (司马/司馬), originally akin to "Minister of War". They could also arise from more lowly occupations, as with Tao (陶), meaning "potter" or Wu (巫), meaning "shaman".
8 Ethnic groups: Non-Han Chinese peoples in China sometimes took the name of their ethnic group as surname.