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

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 >
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 >
Cloud Server Security Architecture for Medical Service Group

Cloud Server Security Architecture for Medical Service Group

This document provides a detailed overview of the security architecture we implemented for a medical...

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 >
Case Study: Building a Decentralized Voting System with Ethereum Smart Contracts and .NET C#

Case Study: Building a Decentralized Voting System with Ethereum Smart Contracts and .NET C#

In this case study, we will explore how our team developed a decentralized voting system using Ether...

Read More >
Implementing a Global Chemical Compliance Check System for a Multinational Corporation

Implementing a Global Chemical Compliance Check System for a Multinational Corporation

In the complex world of global chemical imports, multinational corporations face the challenge of na...

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]