Inspiration

Currently patreon only enables supporters to sponsor the content creator. A creator can promise to do some work, but if he doesn't, we can't do anything to him/her. Also the monthly subscription model is not ideal for supporters who only want to support the project rather than the creator.

So we want to change this situation by introducing the NekoHit project.

What it does

NekoHit project is a better patreon on NeoN3 blockchain. It enables supporters to more specifically support a project, rather than paying monthly subscription fee. To gain trust from potential buyers, a content creator need stake some token first, then supporters can transfer tokens to his/her project. And if the creator violates the promise, then he/she won't get those supported tokens and those tokens will safely go back to supporters' account, what's more, the staked tokens will also be divided and distributed to buyers based on their purchase amount, which acts like a punishment to creator for violating their promises.

We thought NekoHit project will not only allow supporters to pay to support creator's project, that will also encourage content creator to being responsible to supporters.

How we built it

NekoHit project is made of two major parts. The basic token is the CAT token, CAT stands for Completion Agreement Token (not only because we love cats). This token is a standard Nep17 token and mainly used by the WCA contract.

CAT Token

The CAT token has a fixed amount of supply, 1 billion tokens in total, with no change in the future. And with the decimals of 2, we are trying to mimic the real world currency to make it's value more familiar to users when they spending it. By supplying this amount of tokens, we hope we can eliminate the situation that the price of this token varies dramatically and preventing users spend it to support content creators.

WCA Contract

WCA contract is the core of NekoHit project. WCA stands for Work Completion Agreement, as the name indicated, this contract focus on work and their degree of completion. For short, WCA enables content creator to stake CAT tokens, and then allow buyers to pay a certain amount of token to creator's project. Then creator can update the project, when it finished, contract will automatically calculate each buyers' refund amount and do the transfer. After this, creator will get what left as the sponsor (if he meet his promise).

Everyone can use WCA, just by requesting contract with your project's basic info and a identifier, if the identifier is available for use, the contract will return the identifier and record your project to blockchain. Then you transfer the correct amount of token to the contract, you will stake those tokens and enable buyers to support the project. Some key ideas are detailed descripted below:

The total stake amount and total available amount for buying is specified by creator. By deciding stake pre token and total sell token, total stake is stake per token multiplied by total sell tokens. For example, I want to sell 5000 tokens, which means buyers can send 5000 tokens in total to this project. And I want to stake 0.5 token per token, so I have to pay 0.5 x 5000 = 2500 tokens as the stake. If I didn't finished any part of this project, I'll lose all those tokens.

Project's basic info also including your milestones for your project. Each milestone will have a deadline timestamp, if you cannot finish a milestone on time, then you will lose that portion of tokens. That portion of staked tokens will be distributed to buyer, and that portion of buyer's token just go back to buyer's account. At least one milestone is required for each WCA.

Creator can also specify a milestone as threshold, before creator finish that milestone, buyers can make a regret and take 100% their tokens back. But once creator finish that milestone, buyers can only get their remained tokens back.

For example, I create a project with 10 milestones, and the threshold is #3. Before I finish the third milestone, everyone can get their 100% tokens back. But once I finished the first three milestones, then 30% of total tokens are unlocked for me(yet still hold by contract), and each buyer can only get the remained 70% tokens back.

Currently each milestone is equally weighted, but supporting custom weights for each milestone is on the todo list.

To finish a milestone, creator must attach a link to their works, thus buyers can review his/her work and decide if they want their money back. The link can be a URL, or a IPFS CID, or something else. The only require is buyer can use this link to find creator's work, otherwise buyers may make a refund.

To prevent some evil creators just quickly finish milestones and take tokens away, a cooling time is required. This is the minimal time interval between two completion of milestones. If cooling time is not met, contract will refuse to finish the following milestone. This gives buyers time to notice if anything goes wrong and can let them get their tokens back.

All project basic info will be displayed to buyer before the purchase, so they can decide if they really trust on this project.

Once the last milestone is finished, the contract will accounting all tokens based on milestones, and then decide how many tokens are transferred to creator and how many tokens are distributed to each buyer based on their purchase amount and the milestones status.

For example, I set up a WCA with 5000CAT in total, stake 0.5CAT per token, then I staked 2500CAT. Milestones are [1, 2, 3, 4, 5, 6]

Buyer A purchased 1000CAT, Buyer B purchased 3000CAT. I finished milestones [1, 3, 5, 6], which means buyer A's total amount is 1000 + 1000 * 0.5 = 1500CAT, since I finished 4 of 6 milestones, 1500 * 4 / 6 = 1000CAT will transferred to my account, rest of them will transferred to buyer A.

Buyer B is the same: 3000 + 3000 * 0.5 = 4500CAT, so I got 4500 * 4 / 6 = 3000CAT, rest of them go back to buyer B's account.

The stake remains (5000 - 1000 - 3000) * 0.5 = 500CAT, since no one purchased this part, so this will be refund to my account.

Buyers can send token to this contract with the global unique project id as the purchase. Tokens are accepted only if the id is validate for purchase, if not, contract will reject this transaction and buyer's tokens will be safe. A project is available for purchase before it's first milestone. Once the first milestone is reached, contract will refuse new buyer for this project, even the total sell amount is not reached.

And as we said before, a buyer can request their tokens back (refund) anytime before the last milestone is reached (which is considered this project is finished, contract will transfer tokens to the correct accounts), based on current milestone and threshold, contract will transfer tokens automatically.

Our analysis towards the Project

By directly competing with patreon, we did a short SWOT analysis for NekoHit project.

Strength

  • Compared to conventional sponsor model like patreon, WCA Contract enables supporters to gain more control on their sponsorship based on creator's work, also encourage creator to meet their promises.
  • For creators, by giving supporters more initiative will make getting sponsorship easier. Rather than showing people your work first, you can have a "contract" with your supporters, if you miss that promise, then you lose what you stake. That will make your project more trustable. This will help creator more focused on the project, and encourage them to properly set up the milestones of their projects, and finish the project.
  • By using Neo Blockchain, it's borne to be decentralized. There is no limitations for how you make the purchase or how you receive tokens, no matter where you are, who you are, what regulations your country (or other country) has. It's already open, transparent and trustable (we even open source the contract code, if you don't trust us, you can fork and deploy your own).

Weaknesses

  • We cannot guarantee that everyone want use WCA contract. Patreon has proven to be a success, it's more conventional, more powerful (in the meaning of finance and developer team), more easy to get hands on (as long as you have a credit card or something). And it already has a large amount of user stick with it.
  • The idea of Blockchain is still new. And we are new to the blockchain developing. The finance power and the quality of code is not that powerful. It will be a little bit hard to convince people try our project.

Opportunities

  • Although blockchain is new to a lot of people, but the trend is there. More and more people are getting started with blockchain, asking about it. And we have the chance to make public recognize our work.
  • The "creator economy" is also a trend. NFT is an example of it. Creator can make their own token and sell it for a considerable price, that means people want to pay to support creator's work. But this market still pretty primitive. Besides NFT and patreon, there are not much ways for people support creator. And our sponsor model with blockchain might have a chair in that market.

Threats

  • Some country's policy doesn't benefits the blockchain tech.
  • The current crypto-currency market is based on BTC. In past few month, China banned miners caused a crash on price. The huge price fluctuations are not conducive to our users. Nobody like those tokens suddenly drop to a very low price. And that price fluctuations might stop some people to really make use of this project.

Challenges we ran into

The biggest challenge we ran into was getting familiar with somewhat unknown technology. I (@hurui200320) am a java developer, experienced in traditional application involving database. @ykoitzsch had a bit experience with developing smart contracts, and I'm the first time doing public chain development. Both of us ran into troubles of where we didn't know how to solve or tackle a certain issue. Such as what is the best way to handle storage in a smart contract, how to test it automatically, and getting to know the Neow3j and neonjs library itself.

Since Neo N3 is completely new and with a lot of exciting but breaking changes compared to the legacy Neo, there are not really much best practices and you have to figure it out all by yourself, sometimes there are also some bugs in the library you used. Some experiences from traditional field could work, such as the debug technique and the guidance of writing unit test, but most of them don't, since the final contract running on NeoVM rather than JVM. So we tried different things and see what works best.

Talking about the contract running on NeoVM rather than JVM, we think this is another big challenge. Unlike traditional JVM application running on a beefy server, or even a cluster, contracts are running on NeoVM, not only the execution model is different, but also every single instruction cost gas. During the development of Smart Contracts, we have to keep GAS costs in mind at all times so it requires a different way of thinking that we were used to from ordinary software development.

Accomplishments that we're proud of

The first accomplishment we're proud of is of course the NekoHit project. During this frontier launchpad, we learned a lot and building this project from scratch. Though it's not perfect, but still we are proud of it.

Also we are glad to help neow3j's team to improve the library. During the development, we found serval bugs or issues of neow3j, we reported them to axlabs (the maintainer of neow3j) and we are glad to see from neow3j 3.8 to 3.11.2, that's a huge improvements. We are proud of what we contribute to this open sourced library, also huge thanks to AxLabs for maintaining this handy library.

Nevertheless, we have a great team. @ykoitzsch and I (@hurui200320) are doing the developing, and I'm glad to say both of us are motivated and tries our best to develop this project. Rest of teammates helping me sort out this project story, and some other paperwork. We are a great team, this is what we are proud of.

We are also proud that we are an early adopter of working with the N3 ecosystem. N3 has great potential and we are glad to be a part of it.

What we learned

The most important thing we learned is how to deal with blockchain. As I said, building smart contract is different from building traditional application. To build a working contract is not that hard, just make sure you followed the limitations or features in Neo N3 and neow3j's documents. But to make sure there is no security flaw, you have to familiar with this stack: how NeoVM works, how the neo node works, even sometimes how dBFT works. And of course you have to understanding your code, i.e. what's going to happens if someone invoke your contract with bad parameters. All of those are new to us, and we are glad to learn new things.

What's next for NekoHit

After this hackathon, we will continue working on this project to do some work to lower the gas fee.

Also we intend to integrate with NeoID, though it hasn't any developer documents yet, but we plan to let our contract support it. If you want to gain more trust among the community, then you can use NeoID, which allows buyer identify you better. But if you want to be anonymous, you can stick with wallet address.

In near feature, we will keep improve this project, do some airdrop to let people get them hands on, and give us feedbacks, then we improve the contract as much as we can before we deploy them on the main net.

For a long run, we will make this contract open. Currently it's already open-sourced. But the code itself is not quite readable and understandable. We plan to keep refactoring codes to make anyone can contribute to this project. The governance of this project will finally be distributed all over the community.

Built With

+ 4 more
Share this project:

Updates