Skip to main content

Overview

The aim of the social impact feature was to perform calculations of expert formulas on-chain, but due to limitations in Stellar, these calculations cannot be performed on-chain. As a result, off-chain calculations will be verified through this protocol, which is expressed on-chain in the Stellar Blockchain. Under this feature, two protocols for formulae defined by individual experts and metrics defined at the tenant level are taken into consideration.

What is an expert formula?
A carbon footprint expert formula is a single formula meant to capture certain sorts of carbon emission possibilities using common measures such as consumption amount, active time, power usage type, and so on. For example, an expert formula could be established to compute the carbon emissions caused by the use of the national water supply. An expert formula is designed and documented by an expert who is working in the field of analyzing carbon footprint impacts.

What is a metric?
A carbon footprint metric is a well-documented collection of expert formulas that align with the needs of a particular business or production process. While there are certain carbon footprint expert formulas which can be applied to many use cases, a matric is always unique to a user. Still, there can be similar carbon footprint metrics applied to users from similar business or production backgrounds.

Handling Transactions for Social Impact Feature on Stellar Blockchain

Under this feature, a transaction is considered to be a memo followed by a specific number of "manage data" operations. The transaction time will vary according to the number of manage data operations included in the transaction. As the transaction time increases, the chance of failure also increases. To account for this, the number of manage data operations that can be included in a transaction is limited to 25 in this protocol. Depending on the number of manage data created, there may be multiple transactions needed to represent an expert formula or metric on the Stellar blockchain.

When it comes to a "manage data" operation, it has two fields called "name"(or key) and "value." Both fields have a limit of 64 bytes. The "name" field can only contain string values, while the "value" field can contain byte arrays. All the manage data operations for this feature are designed with this in mind.

Handling Manage Data Operation Overflows

If representing a formula requires a number of "manage data" operations that exceeds one transaction (when the overflow occurs), the following convention will be applied.

If the sequence number of the current transaction is K, the new transaction will be created with the sequence number K+1. To maintain the connection with the previous transaction, the last "manage data" operation of a transaction is used to store the previous transaction hash. The key field will be a string with the value “PREVIOUS TRANSACTION” and the value field will be the transaction hash. The "formula ID" and "author ID" "manage data" operations will also be included, just like in the original transaction. This process can be continued for any number of transactions as needed.

The memo of a new transaction will be as follows: Memo format for overflow Here, the formula continuation manifest will carry the byte sequence 0x0000000000BBBBBBBBBB.

Details that are applicable to both protocols

Value Types

There are different types of values that can occur in a formula on the blockchain. The following permitted values are considered in both protocols:

  • Variables (tracking data or master data)
  • Referred constants (constants referred from somewhere, e.g. electricity consumption per 1L of water in Sri Lanka)
  • Semantic constants (e.g. '2' in the formula 2*Electricity consumption)

String Handling

For all string fields, there is a specified maximum allocated number of bytes in the protocols. The actual string value can use any number of bytes less than or equal to this limit. In case the string takes up less than the byte limit, it needs to be terminated with the character '/0'. The reason for using '/' instead of '\' is that Go does not allow using '\0'. Due to the limited number of bytes used in each field, '/0' is chosen as the termination character.

Future Use

When allocating bytes for the necessary fields in the manage data operations, there may be some bytes left over. These remaining bytes will be reserved for future use. The value for this "future use" field will be a string or hexadecimal string filled with zeroes.