Details: Oracle Blockchain Table

This page provide more detailed information about blockchain tables and chained rows by row hash, how the blockchain tables are implemented, managed and how row data is handled in blockchain tables.

Blockchain tables are used to implement centralized blockchain applications where the central authority is the Oracle Database. Centralized blockchains provide organizations with more customizability and control, as they can decide who can participate in the network. The participants are different database users who trust Oracle Database to maintain a tamper-proof blockchain of transactions. All participants must have privileges to insert data into the blockchain table. The contents of the blockchain are defined and managed by the application. Compared to decentralized blockchains, centralized blockchains are useful in scenarios where a higher throughput and lower latency of transactions is preferred over consensus-based distributed blockchains.

Blockchain tables are insert-only tables that organize rows into a number of chains. Each row, except the first row in the chain, is chained to the previous row.

Rows in a blockchain table are tamper-proof. Each row contains a cryptographic hash value which is based on the data in that row and the hash value of the previous row in the chain. If a row is tampered with, the hash value of the row changes and this causes the hash value of the next row in the chain to change. An optional user signature can be added to a row for enhanced fraud detection.

Use blockchain tables when immutability of data is critical for your centralized applications and you need to maintain a tamper-resistant ledger of current and historical transactions. A blockchain table is a building block. You must define the triggers or stored procedures required to perform the tasks that will implement a centralized blockchain. Information Lifecycle Management (ILM) is used to manage the lifecycle of data in blockchain tables. When the data in one or more partitions of a blockchain table is old, it can be moved to cheaper storage using ILM techniques.

Consider the following benefits of using blockchain tables:

  • They provide application-transparent protection from frauds by other participants in the blockchain network.

    Frauds can be detected by verifying rows in the blockchain table. This recomputes the hash value and verifies that it matches the value stored in the corresponding internal column.

  • They do not need new infrastructure because they are part of Oracle Database.

  • They enable you to retain the current architecture and programming model. Therefore, existing database applications that have central authorities can be made more secure.

  • They are easier to use compared to distributed blockchains.

Blockchain tables are append-only tables in which only insert operations are allowed. Deleting rows is either prohibited or restricted based on time. Rows in a blockchain table are made tamper-resistant by special sequencing and chaining algorithms. Users can verify that rows have not been tampered. A hash value that is part of the row metadata is used to chain and validate rows. Blockchain tables enable you to implement a centralized ledger model where all participants in the blockchain network have access to the same tamper-resistant ledger.

Blockchain tables can be indexed and partitioned. You can control whether and when rows are deleted from a blockchain table. You can also control whether the blockchain table can be dropped. Blockchain tables can be used along with (regular) tables in transactions and queries.

Signing Blockchain Table Rows

Signing a row sets a user signature for a previously created row. A signature provides additional security against tampering.

Oracle Database verifies that the current user owns the row being updated and the hash, if provided, matches the stored hash value of the row. You must have the INSERT privilege on the blockchain table. The existing signature of the row for which a signature is being added must be NULL. Use the DBMS_BLOCKCHAIN_TABLE.SIGN_ROW procedure to add a signature to an existing row.

Validating Data in Blockchain Tables

The DBMS_BLOCKCHAIN_TABLE.VERIFY_ROWS procedure verifies that rows in a blockchain table were not modified since they were inserted. Being tamper-proof is a key requirement for blockchain tables. You must have the SELECT privilege on the blockchain table to run this procedure.

You can validate all rows in the blockchain table or specify a criteria to filter rows that must be validated. Rows can be filtered using the instance ID, chain ID, or row creation time.

Deleting Rows in Blockchain Tables

Only rows that are outside the retention period can be deleted from a blockchain table. The DBMS_BLOCKCHAIN_TABLE.DELETE_ROWS procedure deletes all rows or rows that were created before a specified date.