Inspiration

I was really interested in the idea of "trustless systems" where neither party has to trust each other but can still verify that everything is going as agreed. I thought it would be cool to see how this concept would apply to public offices. Given that I could talk to CityCoin developers at this hackathon, I knew it was a great opportunity to learn!

What it does

  • Transparent Fundraising allows political campaigns to transparently collect donations in MiamiCoin (and modifiable for other CityCoins).
  • The core of Transparent Fundraising is the Transparency Smart Contract. This is where campaigns are created, donors are labeled, and donations over Transparent Fundraising are processed.
  • To accept a donation over the Transparency Smart Contract, the donors' wallet must first be labeled by the campaign, on the smart contract.
  • This way, because the transactions are public, the funding sources of the campaign are very easily known by the general public.
    • If the campaign is caught lying about the identity of one of the donors, they would not be able to cover it up as the labels are stored permanently in the blockchain through the Transparency Smart Contract
    • On a similar note, donors and the public would know where the funds went because transactions out of the campaigns wallet are public.

Who Benefits

  • Public
    • By seeing the funding sources of politicians, the public can be more informed about potential conflicts of interests.
  • Politicians
    • By having a way to increase transparency, a politician can makethemselves appear more trustworthy by pointing out how others are not as transparent.
    • By helping to adopt CityCoins, politicians can advertise that they are increasing funding for their cities/municipalities.
  • Governments
    • Increased revenue from CityCoins. Find out more
    • Clearer insights into potential conflicts of interest.
  • Political donors
    • By being able to see the transactions in and out of the campaigns wallet, political donors can more easily verify that their funds are not being wasted.
    • By using CityCoins such as MiamiCoin, the donors are also indirectly increasing revenue for the city by increasing demand (then price :) ). This could be used for positive PR as well as gaining the trust of the public by being transparent with donations.

How we built it

  • Clarity
    • The Transparency Smart Contract was built with clarity and the tool clarinet.
    • The MiamiCoin source code was also duplicated for testing purposes.
      • This way the MiamiCoin could be loaded into the Stacks DevNet on local machines.
  • React
    • Material-UI
      • 95% of the styling for the front-end was done with material ui.
  • Stacks
    • Interactions with the public functions of the Transparency Smart Contract was done using the stacks library.
  • Stacks API
    • To access the read-only functions of the Transparency Smart Contract, there is an api that is called the Stacks Blockchain API.

Challenges we ran into

  • Clarity syntax:
    • The clarity language syntax is close to that of LISP. Something I have only had a couple of experiences with.
  • Understanding how to label donors:
    • This one took me a while to conceptually understand. Knowing what I know now, I would have structured the smart contract differently.
  • PostCondition logic on the front end:
    • While the contract itself can handle transactions, the front end is rejected on the presumably to do with PostConditions (one of the stacks security measures). I tried everything I could think of but eventually had to move on to creating the presentation.

Accomplishments that we're proud of

  • Getting a working smart contract
  • Understanding how that smart contract could be significantly improved and how to make better contracts along the way.
  • Creating a front end working along side the contract.

What we learned

  • How fungible and nonfungible tokens can be created an transferred.
  • How contracts can actually interact with one another.
  • I've gone from barely knowing anything about smart contracts to writing clarity smart contracts and interacting with fungible tokens on the blockchain.
  • Understanding of LISP syntax has significantly improved

What's next for Transparent Fundraising

  • It would be cool to rewrite the Transparency Smart Contract to be more efficient
  • Get the UI properly working.
  • Give NFTs to donors?

Built With

Share this project:

Updates