Nebulas Incentive Program — Afterthoughts & Recap by the Nebulas Korea Ambassador

RayonProtocol
RayonProtocol
Published in
6 min readJul 30, 2018
Jun Woo Ji of Rayon Protocol has been appointed as a Nebulas Korea Ambassador

Nebulas launched its Eagle Nebula 1.0 mainnet in 1Q18. Nebulas launched & operated the first season of its Nebulas Incentive Program from May 7, 2018 ~ July 2, 2018 in order to encourage the development of Nebulas DApps as well as to further build the Nebulas ecosystem. The Nebulas Incentive Program is held across 8 weeks and winners are announced & awarded on a weekly basis.

Total prize money was 460,000 NAS(KRW4.1 bn equivalent, assuming NAS price as at May 14, 2018), which was particularly large to draw sufficient attention from developers. “Even if you don’t win or get ranked near the top, you were able to receive 100 NAS as a reward for simply developing a new Nebulas DApp, so I thought I should participate in the program no matter what. Thus, I started studying by using the Nebulas tutorial and Wiki” — Jun Woo Ji of Rayon Protocol, Nebulas Korea Ambassador

“I ended up developing 3 Nebulas DApps, of which 2 were approved. As a result, I was rewarded with 220 NAS and also appointed as a Nebulas Korea Ambassador in recognition of my contributions. I continue to contribute to the development of the Nebulas ecosystem today.”

pull requests merged with the Nebulas Project

For a simple tutorial on Nebulas, refer to an earlier post by Jun Woo Ji of Rayon Protocol here.

Easy Programming Language Accessibility

Unlike Ethereum’s Solidity or Vyper, the smart contract language of Nebulas supports JavaScript and TypeScript, which are familiar to developers. “As such, my learning curve was short to the extent that I was able to start developing smart contracts after reviewing the Nebulas tutorial. However, you cannot expect the same level of security as that of Solidity.”

Still Early Stage Ecosystem

Recognition of the Nebulas Blockchain remains low and as such, Korean developers within the community are nearly non-existent. Given that Nebulas was developed in China, the proportion of Chinese developers are dominant. While Nebulas is operating numerous bounty programs which is leading to the writing of Nebulas DApp guides and development of debugging tools among many developers, clearly it will take some time for Nebulas to build a community and ecosystem to a scale comparable to that of Ethereum.

My First Nebulas DApp: Votestagram

“I thought of developing a voting App for my very first Nebulas DApp. This is because I thought voting would be the best fit for a decentralized App. Also, I thought it would be pretty simple to develop. You can view the source code here.”

Development Process

1. Install go-nebulas and run a Nebulas local node (refer to my earlier Nebulas DApp Development Tutorial here).

2. Develop smart contract

i. Deploy to local node

ii. Test

iii. Debugging

3. Develop web front-end (using neb.js, nebPay.js )

Developing the Smart Contract

“While you can develop Nebulas smart contracts by using either JavaScript or TypeScript, given that there aren’t too many public documents on TypeScript, I developed my smart contract using JavaScript. It would be nice if there is a convenient smart contract development environment like Ethereum’s Truffle, but unfortunately, this is currently lacking for Nebulas.”

“I created a VotingItem entity which holds information on each voting item as well as a VotingManager entity which is the main class that manages each voting item. The VotingManager performs functions such as storing, looking up and deleting voting items on the LocalContractStorage.”

Functions implemented within the VotingManager :

// register voting itemenroll(votingItem) {// ...}// look up `id` voting itemget(id) {// ...}// look up all voting itemsgetVotingList() {// ...}//  vote on `index` of the `id` voting itemvote(id, index) {// ...}// delete voting item by user who registered the itemdelete(id) {// ...}

Interacting with Smart Contracts at Web Client Using neb.js, nebPay.js

The Nebulas neb.js, nebPay.js are libraries similar to Ethereum’s web3.js which enables front end interaction with Nebulas nodes. Most uses will be calling smart contract functions developed above to register and look up voting items.

It should be noted that functions which change data values such as enroll, vote, delete require the sending of transactions which results in transaction costs. However, functions such as, get, getVotingList which simply look up data values only require calling and do not require any transaction sending.

Link to the completed DApp is here: Votestagram

Web front-end was developed using React.js, material-ui .

Second DApp: Fortune Cookie

“After receiving a New DApp prize for my first Nebulas DApp Votestgram, I wanted to see if I could also receive a participation prize for developing something super simple. Thus, I was thinking of what would be the simplest and shortest DApp to develop and thought of fortune cookies adored by Chinese people. As can be guessed from its name, this second DApp has the function of displaying fortunes as that of a fortune cookie. However, I thought merely displaying fortunes will be too simple and thus added look up functions of your latest fortune as well as a function to share it on Twitter.”

Source code can be found here.

Developing the Smart Contract

// functions within the CookieManager class.// save fortunes. You can only save fortunes to deployed smart contract addresses.save(fortunes) {// ...}// select fortunes and save to user histories.crackCookie() {// ...}// return user histories.getHistory(address) {// ...}// determine which fortune to display according to address and block height._hash(address) {// ...}

“Given its simple functions, time to complete development was drastically shorter than the first DApp. I used HTML/CSS/JS/jquery for the web front-end without a separate library.”

Link to the finished DApp: Fortune Cookie

Third DApp: Nebulas Address Book

“This DApp was developed for the convenient transfer of funds. Addresses to which funds are sent frequently can be registered as favorites along with names to enable the convenient transfer of funds.”

Source code can be found here.

Developing the Smart Contract

// the four functions below are CRUD related functions.save(address, name) {// ...}get() {// ...}edit(address, newName) {// ...}delete(address) {// ...}// favorited bookmarked addresses are displayed at the very top of the client.addOrRemoveFavorite(address) {// ...}

Link to the finished DApp: Nebulas Address Book

In Closing

Over the course of studying and developing on the Nebulas blockchain and related smart contracts, I was able to think over the meaning of decentralized applications and on the need for decentralization. The Nebulas Incentive Program successfully closed on Jul. 2, 2018 and over 6,800 Nebulas DApps, which are more than double the number of Ethereum DApps, were submitted. While Nebulas has a strong advantage of familiarity to developers given its uses JavaScript, however given that it is not specialized for blockchains such as Ethereum’s Solidity, I received the impression that its completion level falls a bit short. I also thought the absence of convenient development tools such as Ethereum’s Truffle & Ganache will require more time for the Nebulas development ecosystem to truly grow. However, given that the Nebulas blockchain is still in its early stages and multiple programs are either being implemented or planned for the future, I believe its overall ecosystem has abundant potential to grow as large as that of Ethereum.

--

--