Blockchain and Cryptocurrencies

The Wolfram Language is your passport to the world of blockchain and cryptocurrencies.

Blockchain

Blockchain

The Wolfram Language has built-in capabilities for interacting with blockchains. It can both retrieve detailed information from Bitcoin, Ethereum and other blockchains and construct and submit transactions to blockchains.

Get information about a transaction from the Bitcoin blockchain:
BlockchainTransactionData["c18ff55d09c596ffbad30321719171c0d5b4d677d3554fc6ab3d12167ea8b9d6",BlockchainBase->"Bitcoin"]//Dataset
Find the top five holders of a Tezos token:
BlockchainTokenData[<|"Name"->"Quipuswap Liquidating kUSD"|>,"HolderList",BlockchainBase->"Tezos",MaxItems->5]//Dataset
Get information about a transaction from the Ethereum blockchain:
BlockchainData[BlockchainBase->"Ethereum"]//Dataset

Cryptocurrencies

Analysis and Visualization

In addition to retrieving blockchain data, the Wolfram Language allows you to easily access financial data, including cryptocurrency prices.

Plot the price of Bitcoin over a period of time:
DateListPlot[FinancialData["BTC/USD", {{2022, 1, 1}, {2022, 7, 1}}]]

You can also execute some kinds of transactions, like sending Ether.

1. Check current sender balance: Use BlockchainAddressData to check your balance and transaction count.
ds=Dataset[BlockChainAddressData[(*sender address*),BlockchainBase->{"Ethereum","Testnet"}]]
2. Create the transaction object: Use BlockchainTransaction to build the transaction object using the preceding transaction count.
ethTXSign=BlockchainTransaction[<|"BlockchainBase"->{"Ethereum","Testnet"},"TransactionCount"->ds["TransactionCount"],"Address"->(*destination address*),"Amount"->Quantity[0.002,"Ether"],"GasPrice"->Quantity[1,"Wei"]|>]
The transaction exists locally until it is submitted to the Ethereum blockchain. 3. Sign the transaction: Use BlockchainTransactionSign to sign the transaction with the private key.
ethTXSign = BlockchainTransactionSign[ethTX, "CAAB89C53A5C8344E7AD79C4EE99B764DDA09F7B1083779470F6C14CA919757D"]
4. Submit the transaction: Use BlockchainTransactionSubmit to send the transaction to the blockchain.
ethTXSubmit = BlockchainTransactionSubmit[ethTxSign]
After the transaction is submitted, you must wait for it to be included in a block. The block can then be mined and added to the blockchain.

Get Started

Learning Resources

Learning Paths

Try it now, learn later

Want to just try it out? Get a feel for what the Wolfram Language is like while trying out real code samples focused on blockchains and cryptocurrencies.

Try these instantly! Access with a free Wolfram Cloud account
Get certified for free in the Wolfram Language

We've made it easy to learn the Wolfram Language your way. Try our free interactive course and earn a certification.

Start the interactive online course now! About 7 hours for completion
Try these instantly! Access with a free Wolfram Cloud account
Start the interactive online course now! About 7 hours for completion

Recommended Product

Consulting Services

Go Further with Blockchain

Let us help you build your blockchain project

Wolfram Blockchain Labs can help make your project a reality. Our powerful codebase, extensive data and R&D expertise have been used by ARK, Cardano, IPFS, Filecoin and more for:

  • DLT ecosystem tools
  • Consulting on decentralized projects
  • Blockchain analytics
Learn more