How does blockchain technology ensure security in cryptocurrencies?