Smart contracts are deployed onto blockchain networks as transactions. They contain executable functions and have the capability to store and amend data. Using smart contracts, financial and real-world assets or data can be represented on a blockchain network as tokens.
The Ethereum network and smart contracts
Not all blockchain networks support smart contracts. The first networks (such as Bitcoin) didn’t, although there was some support for rudimentary variable logic.
The founders of the Ethereum network identified the huge potential that blockchain represented, particularly if the distributed ledger could also be used as a distributed application, by placing executable functions onto the network for anyone to use.
The code that defines how the Ethereum network operates also contains the rules for a simple programming language (called Solidity) that can be used to write such functions. The functions are coded into transactions that are deployed on the blockchain network.
These are called smart contracts.
Smart contracts can be used to tokenize assets as well as creating logical processes that can be invoked by transactions on the network.
Later networks copied and adapted this concept so that most networks support smart contracts and tokenization.
How a smart contract works
The first step is for the owner of the smart contract to write (and test) the code and then deploy it on the network as a transaction.
Once deployed, the data components and functions of the smart contract are fixed and can be used reliably by anyone who knows the location of the contract and how to invoke the functions.
Data is stored in variables that can be in storage (where it is saved to the blockchain) or memory (where it is used only during execution). There are also environment variables supplied by the blockchain network such as the time or the sender of the invoking transaction.
Functions can be public (available to everyone) or private and can be view-only or modify the data within the smart contract. Some functions are invoked only at the time that the smart contract is deployed (to initialize variables).
Functions may also receive or emit events to interface to either other smart contracts or with an off-chain application.
Smart contracts and tokens
By using smart contracts, tokens can be created on the blockchain to represent a financial asset such as a mutual fund, a bond or an equity, or a piece of digital artwork, or even real-world objects such as paintings or real estate. The act of generating a token to represent such assets is called “tokenisation”.
The executable code in the smart contract governs how the off-chain asset is represented and behaves in its on-chain, tokenized form. Functions in the smart contract allow the asset to be created (minted), destroyed (burnt), transferred or impacted in some other way.
Standards are employed to ensure tokens with the same use case can communicate with each other. The most commonly known standard is the ERC-20, a standard used to create cryptocurrency tokens. Another is ERC-721 the non-fungible token (NFT) standard. These standards ensure a common set of fundamental functions for every token smart contract.
At Tokenbridge, we commonly talk about two kinds of tokens: asset tokens and personalisation tokens.
Asset tokens could be for mutual funds, central bank digital currencies (CBDCs), even equities. The token issuer (such as the fund manager or the central bank) will deploy the smart contract that governs how individual asset tokens can be minted, burnt, transferred and so on.
It is worth noting that the token doesn’t actually exist as a separate entity on the blockchain – it is represented as data within the storage area of the smart contract. The data will identify the owner of the token (the wallet address) and any parameters relevant to the token (such as the quantity held for an asset token).
Smart contracts and functions
Functions are invoked by participants on the blockchain network posting transactions that contain data referencing the location of the smart contract and the required function (along with any parameters).
For an asset token (for example), the “Mint” function could be invoked, to create a token within the smart contract’s storage.
Personalisation tokens could be used to record consumer data such as their KYC or AML status or to set out the rules for a model portfolio. Again, the issuer will deploy the smart contract which will govern how individual tokens can be minted and used.
The role of Tokenbridge
Tokenbridge is on hand to provide software and expertise to support issuers of smart contracts.
The issuer could make use of TBDirecT for the initial deployment and subsequent management of the smart contracts, supported by the expertise of the Tokenbridge team and the information provided in the relevant playbook.
Depending on the nature of the smart contract, further interaction may be supported by TBConnecT or through TBInspecT (to view the smart contract and its associated data).
For example, a distributor may use TBConnecT to buy and sell asset tokens through the funds transaction lifecycle.