One of the most important problems that any payment network has to solve is double-spending. It is a fraudulent technique of spending the same amount twice. The traditional solution was a trusted third party - a central server - that kept records of the balances and transactions. However, this method always entailed an authority basically in control of your funds and with all your personal details on hand.
According to the Library of Congress, an "absolute ban" on trading or using cryptocurrencies applies in eight countries: Algeria, Bolivia, Egypt, Iraq, Morocco, Nepal, Pakistan, and the United Arab Emirates. An "implicit ban" applies in another 15 countries, which include Bahrain, Bangladesh, China, Colombia, the Dominican Republic, Indonesia, Iran, Kuwait, Lesotho, Lithuania, Macau, Oman, Qatar, Saudi Arabia and Taiwan.
In 1998, Wei Dai published a description of "b-money", characterized as an anonymous, distributed electronic cash system. Shortly thereafter, Nick Szabo described bit gold. Like bitcoin and other cryptocurrencies that would follow it, bit gold (not to be confused with the later gold-based exchange, BitGold) was described as an electronic currency system which required users to complete a proof of work function with solutions being cryptographically put together and published. A currency system based on a reusable proof of work was later created by Hal Finney who followed the work of Dai and Szabo.
Every transaction is a file that consists of the sender’s and recipient’s public keys (wallet addresses) and the amount of coins transferred. The transaction also needs to be signed off by the sender with their private key. All of this is just basic cryptography. Eventually, the transaction is broadcasted in the network, but it needs to be confirmed first.