wGrow - Team Notes

Sharing Expertise: Tech Insights and Case Studies

Implementing Blockchain Technology for Secure Financial Forecasting in Commercial Real Estate

Abstract:

This technical article details the process of leveraging blockchain technology to secure complex financial forecasting parameters and reports for a Singapore company that provides financial forecasting systems to commercial real estate management companies. By utilizing the Ethereum blockchain to store hashed values of forecasting settings and completed reports, the integrity and security of the data are ensured, while maintaining confidentiality.

Note: Only high level technical knowledge sharing, no confidential or workflow details revealed.

  1. Introduction

    A Singapore-based company provides a complex financial forecasting system for commercial real estate management companies in Singapore and China. The system takes in 100+ parameters to generate a 5-year forecast report, which is updated quarterly for comparison and analysis. The clients' finance directors require that forecasting parameters and report values remain secure and unaltered after completion.

  2. Solution Design

    To meet the clients' security requirements, the following solution is proposed:

    1. Create an Ethereum wallet
    2. Generate a hash of the forecasting settings and completion timestamp
    3. Store the hashed value on the Ethereum blockchain by sending a zero-value transaction with the hash as the transaction note
    4. Verify the integrity of the settings by comparing the stored hash with the hash of the saved settings and updated timestamp

 

Pre-request:
In the .NET project, install the Nethereum library using NuGet Package Manager:

Install-Package Nethereum.Web3
 

 

  1. Implementation

3.1 Creating an Ethereum Wallet

An Ethereum wallet is created to store the hashed values of the forecasting settings and completed reports. This wallet will be used to send zero-value transactions to store the hashed data on the Ethereum blockchain.

using Nethereum.KeyStore;
using Nethereum.Web3.Accounts;

var password = "your-strong-password";
var ecKey = Nethereum.Signer.EthECKey.GenerateKey();
var privateKey = ecKey.GetPrivateKeyAsBytes();
var account = new Account(privateKey);

var keyStoreService = new KeyStoreService();
var json = keyStoreService.EncryptAndGenerateDefaultKeyStoreAsJson(password, privateKey, account.Address);

 

3.2 Generating a Hash of the Forecasting Settings and Completion Timestamp

After a forecast report is completed and finalized by users, all settings values and the current datetime are combined to form a long text string. A hash of this string is generated, ensuring the uniqueness and integrity of the data.

using System.Security.Cryptography;
using System.Text;

string settings = "your-settings-values" + DateTime.UtcNow.ToString("O");
byte[] bytes = Encoding.UTF8.GetBytes(settings);

byte[] hashBytes;
using (SHA256 sha256 = SHA256.Create())
{
    hashBytes = sha256.ComputeHash(bytes);
}
string hashedSettings = BitConverter.ToString(hashBytes).Replace("-", "");

 

3.3 Storing the Hashed Value on the Ethereum Blockchain

To store the hashed value on the Ethereum blockchain, a zero-value transaction is sent from the created Ethereum wallet to itself, with the hashed value included in the transaction note. This process incurs a small transaction fee (gas fee) to execute the transaction on the Ethereum network.

using Nethereum.Hex.HexConvertors.Extensions;
using Nethereum.Web3;

var web3 = new Web3(account, "https://your-ethereum-node-url");
var toAddress = account.Address;
var inputData = hashedSettings.HexToByteArray();

var gasPrice = await web3.Eth.GasPrice.SendRequestAsync();
var estimateGas = await web3.Eth.Transactions.EstimateGas.SendRequestAsync(new Nethereum.RPC.Eth.DTOs.TransactionInput(null, toAddress, account.Address, data: inputData));

var transaction = await web3.Eth.GetEtherTransferService()
    .TransferEtherAndWaitForReceiptAsync(toAddress, 0m, gasPrice, estimateGas, inputData);

 

3.4 Verifying the Integrity of the Settings

To verify the integrity of the settings and ensure they have not been altered after publication, the stored hash on the blockchain can be queried and compared with the hash value of the saved settings and updated datetime. If the hash values match, it proves that the settings have not been changed since publication.

var blockNumber = transaction.BlockNumber;
var transactionFromBlock = await web3.Eth.Transactions.GetTransactionByBlockNumberAndIndex.SendRequestAsync(blockNumber, transaction.TransactionIndex);
var retrievedHashedSettings = transactionFromBlock.Input.HexToString();

if (hashedSettings == retrievedHashedSettings)
{
    Console.WriteLine("Settings have not been altered since initial publication.");
}
else
{
    Console.WriteLine("Settings have been tampered with.");
}

 

  1. Conclusion

    By utilizing blockchain technology, specifically the Ethereum blockchain, the Singapore company can provide a secure and tamper-proof method for storing and verifying the integrity of financial forecasting parameters and report values. This solution not only meets the clients' security requirements but also maintains the confidentiality of sensitive data. While Ethereum gas fees have increased since the initial implementation, alternative and more affordable public blockchain networks can be considered to achieve the same objectives.

Related

Optimizing a Large-Scale Medical Service Provider's Patient Management System Using Cost-Effective Scalability Solutions

Optimizing a Large-Scale Medical Service Provider's Patient Management System Using Cost-Effective Scalability Solutions

This article outlines the process of improving the performance of a commercial medical service provi...

Read More >
Creating a Windows Service to Monitor Remote Desktop Authentication Attempts and Trigger Alerts

Creating a Windows Service to Monitor Remote Desktop Authentication Attempts and Trigger Alerts

Remote Desktop Protocol (RDP) is a widely used feature in Windows to access a computer remotely. How...

Read More >
Creating a Desktop Application to Backup Gmail Emails and Restore to Gmail or Yahoo Email using C#

Creating a Desktop Application to Backup Gmail Emails and Restore to Gmail or Yahoo Email using C#

Backing up important emails from your Gmail account is essential to ensure data security and availab...

Read More >
TECOM, Order Processing System

TECOM, Order Processing System

TECOM is our in-house ERP system for Order Process. System is great for sellers running multiple sho...

Read More >
Implementing a Secure and Compliant Visitor Logging System for a Singapore Hospital using .NET, MS SQL, and Windows Server 2019

Implementing a Secure and Compliant Visitor Logging System for a Singapore Hospital using .NET, MS SQL, and Windows Server 2019

This article describes a secure and compliant visitor logging system for a Singapore hospital that e...

Read More >
Leveraging Excel VBA and Forms for Rapid Development of a Time-Sensitive Sales Order Management System

Leveraging Excel VBA and Forms for Rapid Development of a Time-Sensitive Sales Order Management System

In the world of enterprise software development, it is crucial to balance the need for rapid deploym...

Read More >
Contact Us
  • Our Address:
    114 Lavender Street, #07-51, CT Hub 2, Singapore 338729
    Malaysia Johor - 99-01 Jalan Adda 3/1 Taman Adda Height 81100 Johor Bahru Johor, Malaysia
  • Phone Number:
    +65 6652 3398
  • WhatsApp:
    WhatsApp Us
  • Email:
    [email protected]