The thesis describes a solution to the scalability problem of the cryptocurrency Bitcoin. Some of the key elements that cryptocurrencies use are hash functions and public key cryptography. Technology that constitutes the basis, all cryptocurrenciencies are built upon, is Blockchain. The mechanisms that make it safe and useful in networks without the central authority are the ones that also limit the number of transactions that are possible. The main topic of the thesis is Lightning Network, a solution that uses a network of payment channels to allow for larger quantities of transactions to be processed. We focus on the new mechanism, channels with descending timelocks, that promises secure offchain transactions.