• +65 6652 3398
  • info@wgrow.com
  • 114 Lavender St, #07-51 CT Hub 2

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

Integrating Python's Rembg Library with C# for Background Removal in .NET Applications

Integrating Python's Rembg Library with C# for Background Removal in .NET Applications

In this article, we will explore how to integrate Python's Rembg library with C# to add backgrou...

Read More >
Unlocking Possible Supports: A Guide to Grants for Singapore SMEs

Unlocking Possible Supports: A Guide to Grants for Singapore SMEs

If you are a small or medium enterprise (SME) in Singapore, you may be looking for ways to grow your...

Read More >
Streamlining Monthly Billing Reports for a Singapore Energy Company: A .NET-Based Solution

Streamlining Monthly Billing Reports for a Singapore Energy Company: A .NET-Based Solution

Efficient and accurate billing processes are crucial to the financial health of a business. In the c...

Read More >
Designing a Secure and High-Performance EC Sales and Report System for Property Developers

Designing a Secure and High-Performance EC Sales and Report System for Property Developers

In light of policy changes, property developers are now expected to create their own Executive Condo...

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:
    info@wgrow.com