Note: Brightlink is a prototype, an experiment - it is not designed to be deployed to any real world network. It’s also now getting a bit old and probably needs some updating.


Brightlink was an excursion into the world of ReFi (regenerative finance) and solarpunk (a techno-optimistic aesthetic that focuses on nature and environment).

It was an experiment in blending emerging technologies to create an automated system that rewards people for greening some location. This can mean reforestation, urban greening, rooftop gardening - it doesn’t matter, as long as the detectable chlorophyll signature as measured from three satellites within some given area provably increases.

At the same time as paying out rewards to users that green their environment, the system generates a profit by lending out funds while they are in escrow, using DeFi protocols - this means profits and positive environmental impacts are aligned.

I posted a long walkthrough video about Brightlink here that goes through the app and the codebase and show it working.


Why?

It’s interesting to see how emerging technologies such as DeFi (decentralized finance), stablecoins and smart contracts on blockchains can interact with other technologies including satellite remote sensing in ways that have positive externalities for the physical environment.


How does it work?

The basic logic

The app allows donors to escrow money in a smart contract as an incentive for a community to “green” a target area. Greening can include rooftop gardens, planting on verges and scrub-land, reforesting, etc. The donated funds are paid out if, and only if, the target area is demonstrably greener after a set time has elapsed. This is measured using satellite remote sensing. Multispectral sensors onboard NASA’s MODIS and LANDSAT and ESA’s Sentinel-2 platforms have sufficient spectral resolution to detect chlorophyll using its reflectance signature, and the data is freely available and accessible via an API. Chlorophyll is unique to photosynthetic plants and algae, and is therefore diagnostic of added vegetation in an urban environment. Using the chlorophyll index protects against communities gaming the system by laying astroturf or painting surfaces green, and also enables expansion of the term “greening” to include improving the health of existing vegetation as well as adding more, since healthier plants produce more chlorophyll.

To achieve this, a financial model is encoded in a smart contract written in Solidity, intended for deployment to Ethereum (actually, just one of Ethereum’s testnets). Donors are able to deposit funds into the contract along with a target change in chlorophyll index and an Ethereum address for the payee. For example, a donor might say that 10,000 DAI is available if a community manages to green by 10% above its baseline.

The baseline chlorophyll index for a target area is determined by an initial external call, made via a Chainlink oracle, to three bespoke Google Earth Engine apps hosted on Heroku. The oracle will accept polygon coordinates for the target area, start and end times as arguments and will return the area-averaged chlorophyll index, averaged over the given dates (eg. the mean for the 3 most recent summers), and averaged across the three sensors. The oracle brings this value onchain where it can be queried by the Brightlink smart contract. This value then acts as the baseline used to determine whether a payout happens.

After a deadline expires, the contract triggers the chainlink oracle a second time to gather updated measurements. If the difference between initial and final measurements exceeds the given threshold, the smart contract automatically pays out the donated funds. If not, the funds are returned to the donor. In the mean time, the contract deposits the funds in an Aave lending pool where it accrues yield. That yield is profit for the platform - it can be withdrawn by the contract owner.


Embedded DeFi

This platform makes a profit during the time between a new project being agreed and the payout. This is achieved using an internal function that takes the deposited funds and sends them to an Aave lending pool. When a payout is requested, the funds are withdrawn from the Aave pool back into the contract. The principal is then paid out according to the results of the urban greening, while the remainder is accumulated as profit in the contract which can be retrieved at any time by the contract owner. Please note this functionality will not be apparent from interacting with the system via the public frontend - but the video walkthrough demonstrates how it works and, if you wish, you can use brownie console to replicate using instructions below.


Remote Sensing

The remote sensing scripts use Google Earth Engine to calculate the normalised-difference vegetation index (NDVI) for the given area on the given dates. This is done using three separate data sources from three different satellites (Landsat, MODIS, Sentinel-2). For each dataset, the NDVI is averaged (arithmetic mean) over time and space to give a single value for the NDVI of the region for the given time period. The three values (one from each satellite) are each pulled onchain by a Chainlink oracle using the weighted mean. By default, the three satellites are equally weighted, but the contract owner can update this as necessary (e.g. if the lower resolution of MODIS gives less confidence, if one dataset has more cloudy images, etc).


Lessons learned

This was an interesting experiment - smart contracts are a very powerful way to programmatically incentivize some real world action, especally since contracts are composable and can be stacked up - like the way a lending protocol was easily bolted on to the core contract here.

The costs of running a program to do something similar without smart contracts would presumably be pretty large, but the smart contract can be deployed for a few dollars and then run autonomously in perpetuity, and generate its own revenue.

The main technical friction was connecting real world observations to smart contracts on the blockchain - oracles are the solution for this, but it wasn’t exactly straightforward to implement. Also, the need to own three different crypto assets just to get the app to run (DAI as a stablecoin for escrow, lending, payouts and accruing profit; ETH to pay gas when the contract state is updated; and LINK to pay the Chainlink oracles) is irritating - “account abstraction” may ease this eventually.

Also, I guess doing something like this for real would probably has legal and regulatory ramifications because it has to do with moving money around.