Blockchains initially serve the purpose of storing information in an immutable manner. This information usually consists of transaction data with encrypted recipient and sender addresses, along with the underlying history of the transaction. However, a blockchain is much more than a gateway for various transactions, as the blockchain itself is an immutable repository of information that can be of any nature.
The applications for blockchain as a repository are immense, and can range from anything like banking account information to voting results. The greatest value of such a database resides in the fact that it would contain a full record of all transactions leading up to the most recent one in a solidified manner, thus excluding any attempts at tampering with history.
The Data Transactions allow blockchain users to input data of various formats into the blockchain. Data inside a transaction is structured as key-value pairs. The keys are case sensitive UTF-8 strings. Each value has a data type associated with it, and initially, four data types will be supported, boolean, integer, byte array, and the string.
All subsequent transactions using the same key within the hash can overwrite/supersede previous data transactions, but there will be no way to erase them. However, no user will be able to override values.
Data transactions issued by a single account define the account’s state in a cumulative fashion. The definition of accounts will take place, once the following two transactions have been mined. In other words, the latter transaction can overwrite existing keys, but not delete them, as deletions are unforeseen within the blockchain per se.
For illustration purposes, we will take the example of the Waves Platform, which is currently testing its own format of Data Transactions for launch on its mainnet.
The main application for Data Transaction can be directly attributed to the essence of blockchain, or its ability to store data in an immutable manner and serve as a repository of transaction history that can be used for verification purposes at any time.
One important application for Data Transactions can be the certification of authorship of a document by publishing its hash on the blockchain. It is quite easy to imagine a scenario when a document needs to be signed, and there is no way to ensure that it was signed by an authorized entity. The human factors of errors, corruption or collusion are excluded through the application of blockchain, as Data Transactions would simply not allow an unauthorized entity to sign a document if the given entity is not foreseen within the string of keys allowed to sign it. And even if a correlation of circumstances does lead to the erroneous signing of a document, the blockchain would allow instantaneous tracking of the error directly to the source.
In addition, given that each Data Transaction is signed upon entry into the hash, its authorship is sealed permanently and can be identified without any difficulty by tracing the genesis block or any subsequent signed blocks, depending on the case.
The world of arts is fertile ground for the application of blockchain. There have been far too many cases of forgeries being sold as authentic masterpieces. Given that many of the original artists are long committed to memory and cannot be questioned, the only means of verifying penmanship is by means of art experts and certificates. Such certificates can be reduced from costly documents to blockchain entries, thus instantly granting access to a full history of any given art work and certifying its authenticity.
Another important application of Data Transactions is serving as a source of data for smart contracts in various operations. For instance, if an oracle publishes some data using a publicly known account, the smart contracts can use that data in their logic and execute the terms of various agreements. Serving as third party validators, the oracles would then grant smart contracts additional connections to the real world and confirm the occurrence of various scenarios, or grant additional information sources.
For example, the Waves Platform is already finding applications for the Data Transactions after partnering with the LegalThings project, a platform that makes drafting and signing documents, such as NDAs as simple as filling in a questionnaire, or creating, reviews and audits in one single process in a matter of minutes.
By partnering with LegalThings, Waves will be providing the project with the blockchain necessary to serve as a repository of the documentation turnover within the LegalThings project’s framework. Naturally, all of the documentation will be filed in Data Transaction form.
The maximum size for a key within Data Transactions is 100 characters. A key can contain arbitrary Unicode code points, including spaces and other non-printable symbols. String values have a limit of 32,768 bytes and the maximum number of possible entries in any Data Transaction is 100 characters for one transaction. Overall, the maximum size of a Data Transaction is around 140kb, or about the size of Shakespeare’s immortal tragedy of the Montague and Capulet families.
All Data Transactions operate on the smart contract language, which has functions getLong(), getBoolean(), getByteArray(), and getString(). All of these functions accept two parameters, the address and the key. They return Some(value) if successful, and None if no value exists for the given key. The smart contract will fail validation if the value stored under the key is of a different type.
Fees for data transactions are proportional to transaction size, that is 100,000 per kilobyte rounded up to the nearest kb. Аor instance, on the Waves Platform, fees are payable in WAVES Tokens only. Since the largest transaction size on the Waves mainnet is 140kb, this means it will cost just 0.14 WAVES (less than $1) to post the entire text of a Shakespearean classic on the blockchain.
Data Transactions are the lifeblood of blockchain and ensuring their proper operation is the key to the system’s successful development and implementation.