Back then, people didn't even use paper money. Local traders gathered by the wall, a barricade built to protect the early settlers from Native Americans. They exchanged pieces of silver for notes worth a certain amount of the food and products making their way on boats into New York harbor. During the American Revolution, the new independent government needed to buy supplies for war. It did this by selling bonds.
Bonds are loans to the government.
People buy them knowing that they can sell them back later for more money. Whoever bought a share was a part-owner of the company, and became personally concerned with that company's future. This is the essence of the modern stock market. In 1792, some of the traders decided to start their own exchange. By the 1890s, Wall Street was booming.