status-im/hackathon

CoinPanion - The Ultimate Blockchain Subscription Solution

Alonski opened this issue ยท 5 comments

Status Hackathon Submission

Type: DApp
Github Repo: https://github.com/Alonski/CoinPanion
Description:
CoinPanion is the ultimate blockchain subscription solution. The idea is that any user can go to CoinPanion, then they can choose to subscribe to any other CoinPanion user's Ethereum Address with a payment of X ETH per Y days/weeks/months.

CoinPanion users will have rich profiles which will tell potential coiners about themselves and what they create, work on, or are interested in. Coiners can "coin" friends, family members, or content creators whose work they want to support. With category-based discovery features, search, and a user dashboard CoinPanion is the best and easiest to use blockchain subscription service.

Team Members:

Preferred Name: Alon
Github Handle: @Alonski
Slack Username: @alon

Preferred Name: Rahul
Github Handle: @rhlsthrm
Slack Username: @rahul

Prefered Name: Tim
Github Handle: @imbaniac
Slack Username: @treznich

Prefered Name: Joseph
Github Handle: @Josephrp
Slack Username: @JosephP

Youtube Video: https://www.youtube.com/watch?v=LBntnzvhDmM

Troubles we ran into:

  1. Deployment:
  • Deploying was tough both deploying the DApp itself to the internet as well as deploying the Smart Contracts to Ropsten. From what I understood Ropsten isn't the best test network to be using today and there are other better ones?
  1. Getting the DApp running in Status
  • Getting up and running on Windows is tough. Even after being able to get everything running some members of the team weren't able to view their DApp running in Status locally.
  1. Figuring out how Status injects the web3 object and figuring out how to make sure that it is injected in your DApp.
  • I think that the Truffle Status Box should have a working example of using the injected web3 object instead of creating a brand new one.

More from README:

Description

CoinPanion is the ultimate blockchain subscription solution. The idea is that any user can go to CoinPanion, then they can choose to subscribe to any other CoinPanion user's Ethereum Address with a payment of X ETH per Y days/weeks/months.

CoinPanion users will have rich profiles which will tell potential coiners about themselves and what they create, work on, or are interested in. Coiners can "coin" friends, family members, or content creators whose work they want to support. With category-based discovery features, search, and a user dashboard CoinPanion is the best and easiest to use blockchain subscription service.

Forward

This project was started as a submission to the Status.IM Hackathon.
#20

How it works

Simple put: Any CoinPanion can subscribe to any other CoinPanion.

Use Case 1 - Creators

Rahul is a program. He creates Open Source DApps for free for a better blockchain tomorrow.
Rahul however has a family to feed and a home to pay for. He needs a monthly income to be able to continue writing great DApps.
He goes to CoinPanion, for the first time, and is presented with his dashboard.
His Ethereum Address is already filled in as Rahul is using Status to browse the DApp.
He decides to personalize his profile by uploading a profile picture and setting his name, email and profile description.
He writes a meaningful description and mentions some of his current projects.
This will later be used when his supporters go to visit his profile.

Alon loves DApps and the whole crypto community.
He recently started using one of the Open Source DApps that Rahul made.
He decides that he wants to support Rahul with 1 ETH a month.

Alon visits CoinVault . His CoinVault is currently empty.
He clicks on Add to CoinVault and sends 2.1 ETH to the CoinVault, a smart contract which handles subscriptions for Alon.
The reason for the extra .1 ETH is for Gas fees.
This funding will allow Alon to support Rahul for two months.

The he clicks on the button Coin Someone.
A modal pops up where Alon enters the ETH address of Rahul.
He enters 1 ETH per month and clicks Send.
1 ETH is instantly sent from the CoinVault to Rahul.
The CoinVault also schedules to send another 1 ETH in a month.
Every time the CoinVault sends a subscription payment, it also schedules the next one.

When the CoinVault starts to get low on currency, will be empty before next payment, it sends an email notification to Alon.

When a CoinVault is empty it stops sending out coins until it is replenished.

Rahul gets an email that he has a new CoinPanion!
He visits his CoinPanion Dashboard and sees his new subscriber Alon.

For more Use Cases look at USECASES.md

Getting up and running instructions

  1. Clone this repo
  2. Run TestRPC local node or similar.
  3. Download and install truffle and its dependencies
  4. Compile CoinPanion with truffle compile
  5. Install CoinPanion on the blockchain with truffle migrate
  6. Run Yarn start or npm run start
  7. Visit: http://localhost:3000 to checkout the Dapp

How To Coin Someone

  1. Visit CoinPanion in Status.IM or similar
  2. Search for the person you want to Coin
  3. Visit their Profile Page
  4. Click Coin User
  5. Select an amount and a time interval
  6. Press Send

How to accept payments

  1. Visit CoinPanion in Status.IM or similar
  2. Visit your dashboard to view your available payments
  3. If the time interval has passed for a specific payment an Accept Payment button will appear.
  4. Accept Payments by pressing Accept

Technical Description:

First Time + Loading Vault

  1. Alon visits his Dashboard
  2. Firebase returns that Alon doesn't have a Vault Contract Saved in DB
  3. Alon has a button: Initialize Vault
  4. This fires off vault..deployed(userAddress, userAddress, 0, 0, userAddress, 0)
  5. The vaultAddress is saved into the DB so that next time that Alon visits his Dashboard his vault is loaded again.
  6. Now Alon can Load his Vault, Coin Someone etc

Coining Someone:

  1. Alon visits the Profile Page of Tim
  2. Alon Clicks Coin Tim
  3. Alon inputs 5 ETH per Month
  4. Alons VaultInstance is called using vaultInstance.authorizePayment
vaultInstance.authorizePayment( 'alon', coinSomeoneAddress, Number(coinSomeoneValue), Number(subscriptionDelay), { from: userAddress,gas: 500000 })
  1. This function returns a paymentId. This needs to be saved into the DB of Tim along with the vaultAddress of Alon, payoutTimestamp (Timestamp when Tim can get Payment)

Receiving Payment:

  1. Tim enters his dashboard
  2. He sees that he has a payment with paymentId xyz.
  3. If the payoutTimestamp has passed. Tim can click on Accept to receive his Ether.
  4. If the payoutTimestamp hasn't passed. Tim can see how long until he can receive his Ether.

Receiving Ether is done with: alonVaultInstance.collectAuthorizedPayment(xyz, {from: timAddress})

Dependencies

  • Truffle
  • React
  • WebPack
  • Blockchain - TestRPC or Ropsten

File Structure

  • Src - contains the front-end's source code
  • Config - configuration and install scripts
  • The rest of the folders connect us to the Ethereum universe via
  • Web3 with Truffle through the Status.Im platform

Contact Us

Join us on the Status.IM Slack channel to chat with us!

I'm looking to be a part of a great team! Let me know how I can help.

Awesome ;-)

Current balance: 0.00000000
Contract address: 0x62d09c4a322159229d131dd76f656cb87d846c0b
QR Code
Network: Mainnet
To claim this bounty sign up at https://commiteth.com

hey @Alonski you and i are both interested in creating a product in the subscription space. I just opened up an EIP for an idea to bake this into the core Ethereum protocol. Could I get your feedback on the EIP? ethereum/EIPs#948