## Inspiration

When tackling the issue of sustainability, we looked first at the major sources of emissions. One thing that caught our eye was agriculture – Particularly, livestock production (especially cattle) which is the largest contributor for carbon emissions. Annually, each cow produces 220 pounds of methane and in totality accounts for 14.5% of global greenhouse gas emissions. Agriculture continues to be one of the most important industries that technology overlooks. As a team, we are driven to build in communities and industries that are underserved by existing technologies and from this, *GrazePro was born*.

We decided to focus on rotational grazing, a popular farming technique that involves moving livestock between paddocks so that only one or some paddocks are grazed at any given time. On the contrary, continuous grazing involves only one paddock, and the forage is not allowed to fallow. We realized that there was an efficiency maximization problem related to when farmers should switch paddocks to maximize cattle health and ability for grass to regrow. We decided to model this using a simulation.

## What it does

GrazePro is a virtual simulation intended to enable farmers to accurately predict and forecast the optimal approach to rotational grazing. This means that we can take real data points provided by farmers, input them into the algorithm that we’ve created and generate actionable suggestions to improve cattle health, sustainable practices and cost efficiency.

Our algorithm can help answer questions such as: How many segments farmers should divide their paddock into? What is the optimal time that cattle should stay within one area to ensure that the grass has time to regrow?

The prediction algorithm is built on a cellular automata model, which is a collection of cells on a grid that evolves over discrete time steps according to a set of preferences and rules. In this case, we modeled how fast grass grew back based on various factors, including number of cattle, amount of water used, fertilizers used, previous cover crops and more.

Users have the ability to change certain inputs, such as number of paddocks, number of cows, growth rate of grass and rotation time. When the simulation is played, the dashboard also displays the health of the grass and the cattle and how they change over time according to the feeding patterns of the cattle. Farmers can then use this data to inform their farming practices.

## How we built it

We used a combination of coding languages, including Typescript, React, Netlogo. A number of technologies, frameworks and packages were used, including Next.js, Convex, Vercel, Tailwind. We designed and built our wireframe in Figma.

## Challenges we ran into

On our journey to TreeHacks this year, our car was broken into and our laptops, belongings and personal items were stolen. While this unfortunately has severely impacted our ability to hack, as we were unable to begin until 12 hours into the hackathon, *there is nothing that builds stronger bonds than trauma*. Thankfully, we were still able to build GrazePro with the limited resources we had, and were able to find some hacky solutions (i.e, figuring out a way to locally install Node.js on Stanford's admin protected computers). A huge shout-out to the TreeHacks organizers!

## Accomplishments that we're proud of

This was our team's first major in-person hackathon since the pandemic began, and it presented a significant learning opportunity. While we encountered some initial challenges, we are proud of the progress we were able to achieve as a team without any laptops or personal devices (explained above) AND the additional time constraint of 24 hours instead of 36.

## What we learned

We learned to *never* leave our suitcases unattended…kind of a hard thing to do at a hackathon. In all seriousness, as the first hackathon that we have participated in as a team, one of the most important lessons that we learned is how to work together. This was integral in dividing the workload of this huge project into manageable and sizable chunks that we could delegate effectively to maximize the use of our time.

On a technical level, we were able to use, learn, and implement some really interesting frameworks and packages from the TreeHacks sponsors (shoutout to Convex and Vercel!). We also had the chance to participate in a mock interview with YC which really taught us how to navigate the business-side of a startup alongside a technically-refined product.

## What's next for GrazePro

Where to even begin? Firstly, incorporating satellite and drone imaging technology into our platform and setting up a method to scan the uploaded image to determine the existing health of the grass would help streamline the onboarding of new users. Secondly, using more data to train our simulation would make it more realistic and improve scientific accuracy and predictability. Thirdly, we would introduce features that would complicate our simulation, such as changing the shape of each paddock, reproduction and death of cattle, incorporating weather patterns and forecasts into the model to determine crop growth, use of rivers and riparian buffers to prevent waste contamination from cattle feces, nitrogen fixation mechanisms and their effect on soil quality.

## Works Cited

<https://www.ucdavis.edu/food/news/making-cattle-more-sustainable>
Prediction Market revolving around the following question: Which privacy oriented token will perform better, ZCash or Monero?

In the nascent crypto space without significant understanding or regulation, companies have been launching subpar ICOs to capitalize on hype, and currency trading is extremely volatile. Tokens often serve as a means for companies to raise money quickly with users either genuinely believing in the success of a venture, or looking to make a quick profit by playing off of volatility. There aren’t many valid written sources producing actionable information on the legitimacy of such companies. In order to obtain useful information, incentives must be aligned.

With prediction markets, users stand to profit off of outcomes if they occur, and as such are incentivized to “vote” in accordance with their views. Furthermore, these markets provide insight into public opinion and help hold companies accountable, when there aren’t any other entities that do so. By pitting two competitors against each other in a prediction market, they are each automatically incentivized to take action that would satisfy consumers, aligning with user behavior versus the alignment with investor needs brought about in ICOs with app tokens. Moreover, beyond just human users, bots with access to data streams on certain performance indicators can also contribute to the market. This whole process introduces oversight and accountability by a decentralized mass versus having any sort of centralized regulation. Users are able to hold corporations accountable through the simple economic principle of competition aligning incentives.

This specific use case focuses on the privacy token space in which accountability is especially necessary as consumers inherently expect privacy from each specific service, simply based on what each service promises to provide. Without a specific measure of accountability, these companies aren’t necessarily incentivized to uphold their promises.

Looking into Monero, up until September of 2017, RingCT was not mandatory in client software, meaning that 62% of transactions made before 2017 can be deanonymized, which presents a significant consumer vulnerability. This issue has been present since the inception of the currency, however, the company did nothing to resolve the issue until [MoneroLink](https://monerolink.com) published such results. With a prediction market, those aware of such issues can display their concerns allowing such vulnerabilities to be resolved sooner.

ZCash and Monero are the current leading tokens in this space - each one promising privacy, but tackling the issue from different perspectives. Monero takes the approach of distorting information utilizing RingCT, while ZCash makes use of zero-knowledge proofs. With ZCash working on protocol improvements to increase efficiency and reduce currently high costs, and Monero resolving some of its anonymity issues, these two cryptocurrencies are becoming more competitive in this space. Using a prediction market, we can determine which token is expected to perform better within the scope of the next year as both platforms plan to roll out significant improvements. In this manner, as they release updates and announcements, each company will be able to measure user satisfaction in relation to its competition and thus prioritize the needs of the user. This is basically a real-time indicator of feedback for each company.

The first iteration of this market is scheduled to run for one year, giving both companies time to build improvements, attend to user feedback, and respond accordingly. The market will decide on which token performed better. When we say “performed better,” we define this metric in relation to how widely used each token is. Since both ZCash and Monero are usage tokens, meaning that the token is needed to access the digital service each provides, actual usage of a token represents its value to consumers. In this case, that would be using ZCash or Monero to complete transactions which keep user data private. Thus, in measuring transaction volume of each token throughout the course of the year, we can measure token performance.

This same sort of ideology of pitting competitors against each other to benefit consumers can be applied to tokens in general beyond just the privacy space and multiple companies can be entered into such a marketplace.

This is implemented as a use case of [Gnosis'](https://gnosis.pm) prediction markets using gnosis.js and the gnosis market testing environment.
## Inspiration

Inspired by carbon trading mechanism among nations proposed by Kyoto Protocol treaty in the response to the threat of climate change, and a bunch of cute gas sensors provided by MLH hardware lab, we want to build a similar mechanism among people to monetize our daily carbon emission rights, especially the vehicle carbon emission rights so as to raise people's awareness of green house gas(GHG) emission and climate change.

## What it does

We have designed a data platform for both regular users and the administrative party to manage carbon coins, a new financial concept we proposed, that refers to monetized personal carbon emission rights. To not exceed the annual limit of carbon emission, the administrative party will assign a certain amount of carbon coins to each user on a monthly/yearly basis, taking into consideration both the past carbon emission history and the future carbon emission amount predicted by machine learning algorithms. For regular users, they can monitor their real-time carbon coin consumption and trading carbon coins with each other once logging into our platform. Also, we designed a prototyped carbon emission measurement device for vehicles that includes a CO2 gas sensor, and an IoT system that can collect vehicle's carbon emission data and transmit these real-time data to our data cloud platform.

## How we built it

### Hardware

* Electronics

We built a real-time IoT system with Photon board that calculates the user carbon emission amount based on gas sensors’ input and update the right amount of account payable in their accounts. The Photon board processes the avarage concentration for the time of change from CO2 and CO sensors, and then use the Particle Cloud to publish the value to the web page.

* 3D Priniting

We designed the 3D structure for the eletronic parts. This strcture is meant to be attached to the end of the car gas pipe to measure the car carbon emission, whcih is one of the biggest emission for an average household. Similar structure design will be done for other carbon emission sources like heaters, air-conditioners as well in the future.

### Software

* Back end data analysis

We built a Long Short Term Memory(LSTM) model using Keras, a high-level neural networks API running on top of TensorFlow, to do time series prediction. Since we did not have enough carbon emission data in hand, we trained and evaluated our model on a energy consumption dataset, cause we found there is a strong correlation between the energy consumption data and the carbon emission data. Through this deep learning model, we can make a sound prediction of the carbon emission amount of the next month/year from the past emission history.

* Front end web interface

We built Web app where the user can access the real-time updates of their carbon consumption and balance, and the officials can suggest the currency value change based on the machine learning algorithm results shown in their own separate web interface.

## Challenges we ran into

* Machine learning algorithms

At first we have no clue about what kind of model should we use for time series prediction. After googling for a while, we found recurrent neural networks(RNN) that takes a history of past data points as input into the model is a common way for time series prediction, and its advanced variant, LSTM model has overcome some drawbacks of RNN. However, even for LSTM, we still have many ways to use this model: we have sequence-to-sequence prediction, sequence-to-one prediction and one-to-sequence prediction. After some failed experiments and carefully researching on the characteristics of our problem, finally we got a well-performed sequence-to-one LSTM model for energy consumption prediction.

* Hardware

We experience some technical difficulty when using the 3D printing with Ultimaker, but eventually use the more advanced FDM printer and get the part done. The gas sensor also takes us quite a while to calibrate and give out the right price based on consumption.

## Accomplishments that we're proud of

It feels so cool to propose this cool financial concept that can our planet a better place to live.
Though we only have 3 people, we finally turn tons of caffeine into what we want!

## What we learned

Sleep and Teamwork!!

## What's next for CarbonCoin

1) Expand sources of carbon emission measurements using our devices or convert other factors like electricity consumption into carbon emission as well. The module will be in the future incorprate into all the applicances.

2) Set up trading currency functionality to ensure the liquidity of CarbonCoin.

3) Explore the idea of blockchain usage on this idea