Lin Shuangwen rebellion

The Lin Shuangwen rebellion occurred in 1787–1788 in Taiwan under the rule of the Qing dynasty. The rebellion was started by the rebel Lin Shuangwen and was pacified by the Qianlong Emperor. Lin Shuangwen was then executed.

It started when the Qing Taiwan governor Sun Jingsui (孙景燧) outlawed the Tiandihui society and arrested Lin Shuangwen's uncles. Lin then murdered Sun and formed an army to resist. Lin's forces which were mostly Zhangzhou people attacked several Taiwan sites, and fought militias mostly made out of Quanzhou and Hakka people, however some Quanzhou fought on Lin's side and some Zhangzhou people were on the Qing side. The Qing sent troops to quell the rebellion and execute Lin and the rebels.

Predecessors
Zhangzhou militias under Zhu Yigui rebelled against the Qing in 1721 and fought against militias mostly composed of Quanzhou and Hakka people.

Start of rebellion
Lin was an immigrant from Zhangzhou who came to Taiwan with his relatives in the 1770s. They were involved in the secret anti-Qing Tiandihui (Heaven and Earth Society). Internecine fighting between Zhangzhou, Quanzhou and Hakka plagued the island.

In 1786, the Qing-appointed Governor of Taiwan,, discovered and suppressed the Tiandihui. He also arrested Lin Shuangwen's uncles. The Tiandihui members gathered Ming loyalists, and, and other leaders organized the rest of the society members in a revolt in an attempt to free his uncle.

On January 16, 1787, Lin murdered Sun Jingsui and other officials. The number of insurgents quickly rose to 50,000 people. By February, in less than a year, the rebels occupied almost all of southern Taiwan except for Zhuluo County and Lugangzhen (鹿港镇). They managed to push out some government forces out of Lin's home base in Changhua and Tamsui.

In response, Qing troops were sent to suppress them in a hurry. The eastern insurgents defeated the poorly organized troops and had to resist falling to the enemy. However, Lin's Zhangzhou forces fought against militias made out of mostly Quanzhou and Hakka people - who together made up approximately half of the Han migrants to Taiwan, with Lin's Zhangzhou people comprising the other half. Militias made out of majority Quanzhou and Hakka people cooperated with the Qing army to defeat Lin's armies.

The Tiandihui rebels under Lin Shuangwen performed rituals like cockerel sacrifice.

Quanzhou and Hakka
By this point, the fighting was drawing in Zhangzhou people beyond just the society members, and activating the old feuds; this brought out Quanzhou networks (as well as Hakka) on behalf of the government. Lin's forces were made mostly of Zhangzhou people, and the Zhangzhou and Quanzhou people were already feuding with each other, so the rebellion sparked a large-scale battle between the two sides. The Quanzhou faction formed their own army and cooperated with the Qing forces to resist Lin.

Zhangzhou militias also fought against Hakka militias. Hakka people from Taozhumiao (桃竹苗), Liudui (六堆), and other places organized a Taiwan Hakka volunteer army. The Hakka cooperated with the Qing army to defeat Lin's forces and defend their homes. Under the leadership of Chen Ziyun (陳紫雲), the Qing and Hakka forces battled in Hsinchu and other places.

Eventually, the government sent sufficient force to restore order. The governors of Zhejiang and Fujian then sent Fuzhou general Hengrui (恆瑞) and 4,000 troops to Taiwan to help quell the rebellion. After April 23, another 10,000 Qing troops were sent to Taiwan, and then another 7,000 were added.

Qing reinforcements
Finally, in December 10, the Qing imperial court sent Fuk'anggan to quell the rebellion with a force of 20,000 soldiers, while, Counsellor of the Police, deployed nearly 3,000 people to fight the insurgents with the majority from the Green Standard Army and a minority from the Eight Banners. These new troops were well equipped, disciplined and had combat experience which proved enough to route the insurgents.

The Qing annihilated Lin's army and captured Lin on February 10, 1788. As many as 300,000 took part in the rebellion. The Ming loyalists had lost the war, their leaders were executed, and the remaining rebels hid among the locals.

Punishment
Lin Shuangwen was executed, and the Heaven and Earth Society was dispersed to mainland China or sent into hiding. Other criminals and rebels were sentenced to death by Lingchi (a method of torture). The tombs of their ancestors were excavated. The female relatives of the rebel leaders (daughters, wives, concubines) were sentenced to penal transportation and were sent to the northeastern frontier in Ningguta in Heilongjiang to become slaves of the Solon. Sons of rebel leaders above 15 were beheaded. The Qianlong emperor and Heshen ordered that sons of rebel leaders under the age of 15 to be taken to Beijing and castrated by the Imperial Household Department to work as eunuch slaves in the Yuanmingyuan (Summer Palace). The boys who were castrated were aged 4 to 15 years old and 40 of them were named on one memorial. This new policy of castrating sons of killers of 3 or more people and rebels helped solve the supply of young eunuchs for the Qing Summer Palace. The Qing were willing to lower their normal age limit for castration all the way to 4 when using castration as punishment for sons of rebels when it normally wanted eunuchs castrated after 9. Other times, the Qing Imperial Household Department waited until the boys reached 11 years old before castrating them, like when they waited for the 2 young imprisoned sons of executed murderer Sui Bilong from Shandong to grow up. The Imperial Household Department immediately castrated the 11 year old Hunanese boy Fang Mingzai to become a eunuch slave in the Qing palace after his father was executed for murder. The Qing Summer palace, due to this policy of castrating sons of mass murderers and rebels received many young healthy eunuchs. 130 sons of rebels 15 and younger were taken into custody by the Qing. The rebel leader Zhuang Datian's 4-year-old grandson Zhuang Amo was one of those castrated. There was another Lin family who joined the Lin Shuangwen rebellion. Lin Da was ordered to lead 100 people by Lin Shuangwen and given the title "general Xuanlue". Lin Da was 42 when he was executed by Lingchi. He had 6 sons, the 2 older ones died before and his 3rd son Lin Dou died from sickness before he could be castrated in Beijing while hi's fourth and fifth sons were castrated, the 11 year old Lin Biao and 8 year old Lin Xian. However his 6th and youngest son, 7 year old Lin Mading was given away to a relative (uncle) named Lin Qin for adoption, and Lin Qin remained on the Qing side and joined a pro-Qing "righteous" militia and did not join the rebellion so Lin Mading was not castrated. Lin Mading had 2 children after marrying his wife in 1800 when he was 20.

Imposing a penalty of castration upon the sons of rebels and murderers of 3 or more people was part of a new Qing policy to ensure a supply of young boy eunuchs since the Qianlong emperor ordered young eunuchs to be shifted towards the main imperial residence in the Summer Palace. Norman A. Kutcher connected the Qing policy on obtaining young eunuchs to the observation that young boy eunuchs were prized by female members of the Qing Imperial family as attendants, noted by the British George Carter Stent in the 19th century. Norman Kutcher noted that George Stent said young eunuchs were physically attractive and were used for "impossible to describe" duties by female imperial family members and they were considered "completely pure". Kutcher suggests the boys were used for sexual pleasure by Qing imperial women, connecting them to the boy eunuchs called "earrings" who were used for that purpose.

Sons of murderers above 15 were not beheaded unlike sons and grandsons of rebels and instead they were also castrated as eunuchs in the palace. The wives and daughters of murderers would be given to the murder victims' relatives if they still lived unlike wives and daughters of rebels. Qianlong and the Imperial Household Department under Heshen later decreed that sons of murderers who were 16 years old and older would be exiled as slaves to become slaves of the Solon on the frontier in Ningguta in Heilongjiang or Ili in Xinjiang after castration while the sons 15 and younger would be kept as eunuchs in the Imperial palace since the younger sons could be controlled while the older sons were uncontrollable in a decision made in 1793.

Lin Shuangwen had some relatives like Lin Shi (Lin Shih) who founded the Wufeng Lin family in Taiwan and did not take part in the uprising but instead hid out in a Qing loyalist town, Lukang, Changhua. He was briefly imprisoned  and 400 jia (chia) of farmland was seized by the state from Lin Shi as punishment for being related to a rebel but he relocated to Wufeng and his son Lin Jiayin (Lin Chia-yin) (1782-1839) regrew the family fortune. Lin Shi's great grandson Lin Wencha (Lin Wen-ch'a) (1828-1864) help the Qing dynasty crush the Hakka Taiping rebels Zhejiang and Fujian provinces.

Zhuang Datian had enlisted Taiwan Plains Aboriginal female shaman Jin Niang to support Lin Shuangwen during the rebellion She healed Zhuang Datian's son. She was taken to Beijing to be executed by lingchi as well. A novel was written about her later by Lin Jyan-long

During Qianlong's reign, was involved in graft and embezzlement. Li Shiyao was demoted of his noble title and sentenced to death. However, after assisting in quelling the Lin Shuangwen rebellion, his life was spared.

Aftermath
After the rebellion, local feuds between the Zhangzhou, Quanzhou, and Hakka people appeared only sporadically through the early 19th century, coming to an end in the 1860s. However, they never again were serious to push out the government or encompass the whole island. There were more than a hundred rebellions during the early Qing. The frequency of rebellions, riots, and civil strife in Qing Taiwan is evoked by the common saying "every three years an uprising; every five years a rebellion" (三年一反、五年一亂).

In total, the Qing deployed fewer than 40,000 troops, and it took over one year to stamp the rebellion. However, through clever use of ethnic relations, forming good relations with the aborigines, and taking advantage of the feuds between the Taiwan internal factions (the Zhangzhou, Quanzhou migrants), the Qing successfully annihilated Lin's family and forces. In 1787, the Qianlong Emperor changed the name of Zhuluo County to Jiayi County (嘉義縣) to reward the Zhuluo people in helping resist and defeat Lin Shuangwen.