Although Columbia had replaced it as the state capital in 1788, Charleston became even more prosperous as Eli Whitney's 1793 invention of the cotton gin sped the processing of the crop over 50 times. Britain's Industrial Revolution—initially built upon its textile industry—took up the extra production ravenously and cotton became Charleston's major export commodity in the 19th century. The Bank of South Carolina, the second-oldest building in the nation to be constructed as a bank, was established in 1798; branches of the First and Second Bank of the United States were also located in Charleston in 1800 and 1817.