Using NEM Blockchain to build an Innovative Jobs Marketplace

Empleos IO
Game of Life
Published in
8 min readSep 21, 2018

First a little background.

We have long thought about using blockchain in building a Jobs Marketplace that benefits both Employers and Candidates. We don’t want to use Blockchain just for the sake of it. It has to solve a problem.

And what is the problem we are solving? We want to cut out of the middleman? Do we want to make the hiring process really easy and cheap for Employers (compared to models like Upwork or Indeed)? Do we want to put all the hiring agreement terms (like hourly rate, location, skills required for the Job) on a decentralized Blockchain so all parties are privy to this data?

Well it is all of the above.

Plus something more (Algolia search, Machine Intelligence for automatically screening profiles and building keywords etc). We will discuss that in a later article.

What makes us standout? The combination of Low fees, transparency in hiring process, decentralized data and instant communication between the employer and candidate should make our platform compelling among Company Recruiters, HR agencies and Candidates.

Trending Cryptocurrency Hub Articles:

1. Win 200 ETH in New Tournaments!

2. How Much Can You Make on Coinpot in 1 Year?

3. BABB token sale: what you need to know

4. A Crypto that will Pay You

On top of all of that candidates gets paid in PLEO Tokens for allowing employers to access their profile. So the more compelling their profile the more views they have from Employers. The more views their profile gets the more they can earn in our tokens.

Employers pay Candidates directly.

So why NEM?

Let’s talk about the features that we are building and the approach that we are undertaking to integrating NEM Blockchain within our platform.

First a little primer on NEM Blockchain and why we chose NEM over other Blockchain frameworks.

  1. Performance — ​3000 transactions per second (tested)
  2. Built for Enterprise from ground up
  3. Energy Consumption — ​100 times less power consumption than Bitcoin to run a node or harvest. Good for environment.
  4. Transaction Fee​ — Low Transaction fee 0.05 XEM (at the time of writing)
  5. Second largest Blockchain in Japan after Bitcoin.
  6. Proof of Importance model
  7. Billion XEM (defined maximum liquidity)
  8. Anti-Counterfeiting
  9. Encrypted Messaging integration.

As you can see in the above list there are many compelling reasons for us to pick NEM over other Blockchain frameworks. Biggest of all is the low transaction confirmation fee, energy consumption and performance. NEM is API-driven and so it is very flexible when it comes to writing any front end application.

Using NEM is as simple as using a RESTful JSON API. It allows us to configure Smart Assets. We use the Javascript wrapper to access their API. We standardized our platform development on JS full stack.

Implementation Approach

How NEM’s Blockchain framework works

We created our custom mosaic PLEO. NEM has this concept named Smart Asset which can be any tradable asset whether it is a coin, a signature, tickets or stocks.

a. Employers (buyer) use our PLEO tokens to pay candidates (Sellers) in exchange for exposing their profile

b. Candidates can purchase Value added services using their tokens. These services include Resume review, Career counseling, Profile placement in search results, Who Viewed my profile etc.

c. All public data such as Employer contact of Candidates, terms and agreement such as Consulting Rate, time period of engagement, Job responsibilities etc will be placed in the NEM blockchain

d. All Private data including Profile data will be placed in the Private chain to protect security of personal data

In order to enable payment within the platform both the employers and candidates need to hold our PLEO tokens in our custom wallet.

For our initial beta version of our platform we will use NEM’s TestNet. This is to ensure we have sufficient time to conduct our User Acceptance Testing (UAT) to find and fix all the bugs and as well load test the stability of our platform.Once our UAT is completed and approved by our team we will switch our transactions to NEM’s Mainnet.

1. Create Wallet

Candidates — create the Wallet and we will show you the money

First users need to create a Wallet. A wallet is required for all users to perform transactions within our Empleos.io platform.

We use NEM’s createPRNG API call to create a custom wallet with a random wallet name and password. Note for security reasons we encrypt user’s Wallet Private key using Amazon’s Key Management Service. The user ONLY have access to their Wallet address. They can transfer funds to their wallet with the address however they cannot manage the wallet outside the Empleos platform.

So here is how we create a new wallet using NEM’s API. You can find all the API functions on NEM’s API documentation site.

https://nemproject.github.io/

const wallet = await nem.model.wallet.createPRNG(walletName, password, nem.model.network.data.testnet.id);

return callback(null, { walletAddress: wallet.accounts[0].address, privateKey: encryptedPrivateKey, walletName, walletPassword: encryptedWalletPassword, });

2. Mosaic Transfer

Empleos created a custom smartasset mosaic named empleosdev.pleo (for Development purposes and empleos.pleo for Production use) to use within the Empleos ecosystem.

As we discussed in our White paper each Profile access costs the employer 1.0 PLEO token. We deduct 0.3 PLEO from the transaction (towards platform maintenance and NEM network fee) before we deposit the balance 0.7 PLEO to candidate’s wallet.

Tell me how it works again?

First we check if the employer has sufficient PLEO balance. If they don’t we warn the user about insufficient balance. If they have enough balance the transaction goes through and gets added to anoutgoing queue.

if (pleoBalanceRes.balance < process.env.PURCHASE_PROFILE_FEES)

{ throw new Error(‘Insufficient Balance’); }

const result = await nemService.pleoTransfer(privateKey, recipient, process.env.PURCHASE_PROFILE_FEES); if (result.tranferRes.code !== 1)

{ result.message = humanize(result.tranferRes.message); throw result; }

We queue up all transactions and at the end of the day per candidate and then we run a Cron scheduler to transfer all the credited tokens to each Candidate’s wallet. This makes the process more efficient especially when we have thousands of employers viewing one candidate’s profile.

profile.forEach(async (row) => {

const pleoSum = row.dataValues.pleoSum;

const candidateProfileId = row.dataValues.CandidateProfile.id;

const userId = row.dataValues.CandidateProfile.dataValues.userId;

const walletAddress = row.dataValues.CandidateProfile.User.walletAddress; const candidatePart = pleoSum * process.env.CANDIDATE_PART;

const amountTobeTransfred = candidatePart * process.env.PLEO_DIVISIBILITY; const privateKey = process.env.EMPLEOS_PRIVATE_KEY;

// Transferring funds

Hit that button to see everything!

const result = await nemService.pleoTransfer(privateKey, walletAddress, amountTobeTransfred);

if (result.tranferRes.code !== 1) throw result;

const networkFee = result.transactionEntity.fee / process.env.XEM_DIVISIBILITY;

3. Check Token Balance

We provide a near-real time display of token balance for the employers and candidates. For Candidates the pending balance reflects how many tokens they can expect to get credited as soon as the employers view their profile. It also shows the available tokens in the wallet which they can cash out immediately.

Real time balance check

const mosaicBalance = async (req, res, callback) => { try

{ const balanceRes = await nemService.pleoBalance(req.query.walletaddress);

const balance = balanceRes.balance / process.env.PLEO_DIVISIBILITY; return callback(null, { balance }); }

catch (err)

{ return callback(err);

}

};

4. Free Tokens at Wallet creation

So you might be wondering how we finance all the transactions within the NEM Blockchain. NEM uses XEM as the gas money to enable all confirmation transactions. In order to make the transaction seamless for all users we regularly deposit XEMs to user’s account that will help cover all the transaction fee.

So when the employer creates a brand new wallet we deposit 15 free XEMs from our wallet to their wallet to fund future transactions.

const recipient = toWalletAddress;

const amount = quantity;

// create transfer transaction object const transferTransaction = nem.model.objects.create(‘transferTransaction’)(recipient, amount, message);

// prepare transaction const transactionEntity = nem.model.transactions.prepare(‘transferTransaction’)(common, transferTransaction, nem.model.network.data.testnet.id);

// sign and send to NIS return nem.model.transactions.send(common, transactionEntity, endpoint);

Then on a regular basis we check if the XEM balance is below a certain threshold (0.9XEM) and if it is then we automatically refill the user account with XEM. This way employers don’t need to buy XEM from NEM in order to make any transaction within our platform.

// transaction common data initialisation

const common = nem.model.objects.get(‘common’);

common.privateKey = privateKey;

// create transfer transaction object

const transferTransaction = nem.model.objects.create(‘transferTransaction’)(recipient, amount, message);

// prepare transaction

const transactionEntity = nem.model.transactions.prepare(‘transferTransaction’)(common, transferTransaction, nem.model.network.data.testnet.id);

// sign and send to NIS const result = await nem.model.transactions.send(common, transactionEntity, endpoint);

5. How to transfer your balance to your external wallet

The last but not the least is the most important function in our platform. How do the Candidates cash out their PLEO balance from their wallet. As I mentioned earlier in the “Create Wallet” section, the wallets that both the employers and candidates create in our platform cannot be accessed outside Empleos platform. This is to ensure a) security of the wallet and b)prevent abuse of users taking advantage of free promotional tokens and create multiple fake accounts. We encrypt the Private key of the Empleos managed wallet using Amazon’s KMS. No user (including our team) can access the wallet except the platform itself. We don’t store the unencrypted password or private key anywhere in our database. Period.

When the user decides to transfer the balance from their personal wallet to an external wallet address they go to Transfer Balance page under My Account section.

We showed you the money :)

For candidates:

if (req.loggedInUser.userType === ‘candidate’)

{ if (currentBalance >= amount)

{ result = await nemService.pleoTransfer(privateKey, recipient, transferableAmount);

if (result.tranferRes.code !== 1)

{ result.message = humanize(result.tranferRes.message);

result.type = ‘OTHER_WALLET_TRANSFER_TRANSACTION’;

result.fromUserId = req.loggedInUser.id;

result.toUserId = null;

result.fromWalletId = req.loggedInUser.walletAddress;

result.toWalletId = recipient; throw result;

}

Click Initiate Transfer and voila!! The tokens get transferred instantly to the other wallet.

Of course you can check out our complete Blockchain code on our EmpleosGitHub. We welcome everyone to review and provide some comments.

About Empleos

Empleos.io is a new technology platform that brings Blockchain, Machine Learning and Rewards system into the online recruiting market. Our platform transforms traditional recruiting process into a decentralized blockchain environment. It simplifies and incentivizes the “job seekers” in their career search while offering time and cost saving advantages to employers.

Follow us on empleos.io for more up to date announcements on our Platform development

You can join our Beta and get 15 Free PLEO tokens — https://beta.empleos.io

📄 👉 Read Our Whitepaper

📧 👉 Join Our Private Email List

Follow Us:
Twitter | Instagram | Facebook | YouTube | Medium | Telegram

Author:

Co-founder and Chief Product Manager, Empleos.io,

Chan Komagan

--

--

Empleos IO
Game of Life

EMPLEOS.IO - the new Blockchain and Machine Learning powered platform disrupting online recruiting market: no middlemen, just job seekers and employers!