Imagine a situation: you come to the store, say, expensive watches, buy the goods you like, go home with impatience to open the treasured box, open it, and, suddenly, it turns out that the purchased goods are a cheap fake.
Familiar? What to do and who is to blame? The credibility of the watch manufacturer begins to fall sharply. Is it the fault of the manufacturer of watches that his products are forged? A controversial issue, it seems to me. One way or another, it is obvious that counterfeit causes huge reputational losses and damages to legitimate manufacturers.
The solution could be to use EMC DPO product and Emercoin blockchain.
How it can work:
')
Imagine you come to the same expensive watch shop, choose a product, but before you buy it you see on the box a QR code with the accompanying inscription something like “scan me to make sure that I’m not fake”. You are scanning a QR code that sends you to the manufacturer’s website, where it opens directly, whether information exists on a product with such a serial number and whether it was previously purchased by someone else:

and, also, a brief description of the product and its manufacturer:

Also, you can see that some product has already been bought and activated by someone (in this case, you can definitely conclude that the product sold in the store was either already in use or was fake):

So, let's say you in the store made sure that the goods are not fake and have not been previously used. You get it and come home. Unpack and see another QR code inside the box, hidden behind an opaque protective film with the accompanying inscription something like “scan me to activate the product”. Remove the film, scan the QR code, click "Activate product":

then, enter (optionally) your name and product review, and also set a password (with which you can later change your product review once):

And then, after 10 minutes, information on the purchase of this product will be publicly available both on the manufacturer’s website and on the Emercoin blockchain, where anyone can view it:
{ "name": "dpo:Your Company:DEMO-1001:0", "value": "Item=Name of your product\nDescription=The description of your product\nPhoto=http://www.blockchainengine.org/wp-content/uploads/2016/04/Smart4.png\nOTP=bb680a8bcae3e5be23f3c9ed4d3d0e97d42cebe561f53a5a7502e2d150a937fb\nOwner=Garrett\nSecret=3aff84a0afcd7201b112652b8692975bcfdeb0060de5efbdaeb16d806f62848d\nComment=Cool !\nUpdated=1", "txid": "ee1ed730e16c41c7a42b3b87bf5bd5936b2e69a6448f510e08dd70d40bf57c1e", "address": "ERGPQNKpmJNaXeaq6ZDYwgghQDMBQGVema", "expires_in": 255036, "expires_at": 471574, "time": 1488110346 }
You can say: “And here is the blockchain? This can be done centrally by the manufacturer of the goods! ” Yes, indeed, it is possible. But the use of a decentized repository in the form of a blockchain will provide complete transparency over the actions of manufacturers. So, they will not be able to release an unrecorded "left" product - everything will be public and open. If it is important for the manufacturer to be open and honest - then this is definitely a choice towards the EMC DPO solution based on the Emercoin blockchain.
Deploy EMC DPO on your server
In this section, we will look at how to deploy and configure EMC DPO on your server running Ubuntu 16.04 LTS (amd64). However, other operating systems are also supported: Ubuntu 14.04 LTS (amd64), Debian 8 (amd64, armhf), RHEL / CentOS 7 (x86_64).
1. Installing the Emercoind service
Let's use the standard tools for installing Emercoind:
apt-key adv --keyserver keyserver.ubuntu.com --recv B58C58F4 add-apt-repository 'deb http://download.emercoin.com/ubuntu xenial emercoin' apt update && apt -y install emercoin
Make sure that emercoind is installed, it works and starts downloading the blockchain:
emc getinfo
{ "version": 60000, "protocolversion": 70002, "walletversion": 60000, "balance": 1.090000, "newmint": 0.000000, "stake": 0.000000, "blocks": 216541, "moneysupply": 39554119.651462, "timeoffset": 0, "connections": 8, "proxy": "", "ip": "0.0.0.0", "difficulty": 206196413.012576, "testnet": false, "keypoololdest": 1487850355, "keypoolsize": 501, "mintonly": false, "unlocked_until": 0, "paytxfee": 0.010000, "relayfee": 0.000100, }
We are waiting for the blockchain to download. We send some coins to the wallet (at the rate of approximately 0.12 EMC per one operation for creating / updating info in the blockchain).
You can create a new wallet address with the command:
emc getnewaddress
2. Creating NVS Records
It is necessary to create entries in the blockchain NVS for the manufacturer (vendor) and, directly, for the goods (a separate entry for each item).
2.1. Creating a vendor master record
We define the initial information. Let be:
- Manufacturer (vendor) is called "Your Company"
- The vendor logo is located at the link:
http://emercoin.com/images/main-logo.png
- Also, we want to create an additional field “Description” and place in it information: “The description of your Company”
- The recording will be active for 730 days.
Then, such an entry can be created with the following command:
emc name_new "dpo:Your Company" "Name=Your Company Description=The description of your Company Logo=http://emercoin.com/images/main-logo.png" 730
After executing this command, we get the Transaction ID code, if everything went well.
We are waiting for this entry to hit the blockchain. To do this, execute the command:
emc name_show "dpo:Your Company"
after hitting the blockchain, we should see something like this:
{ "name": "dpo:Your Company", "value": "Name=Your Company\nDescription=The description of your Company\nLogo=http://emercoin.com/images/main-logo.png", "txid": "b11384b162e2d3d2900d10e942c6ae3aa8bca94801dc119677685d68d35c9712", "address": "ERGPQNKpmJNaXeaq6ZDYwgghQDMBQGVema", "expires_in": 127749, "expires_at": 343616, "time": 1487856529 }
remember the value of the "address" field - this will be the main address on whose behalf all subsequent product records should be created.
Additionally, we need to come up with a “salt” of user passwords in order to make it more difficult for attackers to search for passwords — an arbitrary set of characters. Let for example it be "
johNah2koosie3iG
".
2.2. Creating Product Records
We define the initial information. Let be:
- The product is called "Name of your product"
- Product photos are located at the link:
http://www.blockchainengine.org/wp-content/uploads/2016/04/Smart4.png
- Also, we want to create an additional field “Description” and place in it information: “The description of your product”
- To begin with, we want to create 100 serial numbers of goods: from SN-55001 to SN-55100
- Records of each product will be active for 730 days.
Then, such records can be created using the execution of the following script (after installing php-cli and pwgen):
where URL is the web address of the EMC DPO deployment.
The result of the execution of this script will be the creation of NVS records (if you did everything correctly) with data output to the console like:
Creating serial SN-55001: * SECRET: maifeB32 * OTP: bb680a8bcae3e5be23f3c9ed4d3d0e97d42cebe561f53a5a7502e2d150a937fb * Public URL: http://emcdpo.info/dpo/key/SN-55001 * Private URL: http://emcdpo.info/dpo/key/SN-55001?otp=maifeB32 * NVS Record: dpo:Your Company:SN-55001:0 * Transaction ID: 7e1c5a131887a08971225790047bf9e8asq3ca5f947beb9ba0ced6541931939f
We save the Public URL and Private URL for each individual serial number, make QR codes of them and place them: one on the outside of the box, and the second, respectively, inside the box under the protective film.
3. Deploy the EMC DPO Web Application
Install dependencies and activate the necessary modules:
apt install curl git apache2 libapache2-mod-php php-xml a2enmod rewrite
Clone the git repository in / var / www:
cd /var/www git clone https://github.com/Emercoin/emcdpo
Install the composer and its components:
cd /var/www/emcdpo/engine curl -sS https://getcomposer.org/installer | php php composer.phar install --prefer-dist
Assign the owner of the emcdpo folder of the user www-data (or any other from which the web server will execute the code):
chown -R www-data:www-data /var/www/emcdpo/engine
We set our parameters in the /var/www/emcdpo/engine/src/settings.php file:
The credentials for connecting to Emercoin RPC can be found in the /etc/emercoin/emercoin.conf file
Next, set up a web server. To do this, create the Apache configuration file /etc/apache2/sites-available/emcdpo.conf, an example of which is:
Alias /dpo /var/www/emcdpo/engine/web <Directory /var/www/emcdpo/engine/web> Options -MultiViews RewriteEngine On RewriteBase /dpo RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L] </Directory>
Activate the configuration and restart Apache:
a2ensite emcdpo systemctl restart apache2
EMC DPO is now available at
http://YOURHOSTNAME/dpo
and is ready to use.