how to uniquely identify user on ETH blockchain - blockchain

I am currently learning ETH blockchain based DApp development. I want to ask that, if we are developing an eVoting application based on blockchain, then how can we ensure that each citizen is voting only once and votes are calculated properly to avoid duplicate votes?
Thanks

Identity is a very difficult thing to do on the blockchain and is the subject of very active research by many large and small entities.
With this said, the way to limit users to one vote each on the Ethereum blockchain is to limit each public address to one vote each. Your smart contract can check if the user has already voted, and can deny the user a second vote. This does not stop users from simply creating a second account and voting again.
The most effective way to do this given technological limitations is to simply perform the identity check off-chain. You can implement a Know Your Customer (KYC) system on your site and assign each user to a single address. Provided the system is robust, it should be extremely difficult for people to create multiple identities.

Related

Hyperledger network approach

Taking the following service description:
X is a platform matching buyers and sellers.
Buyers can join the platform by creating a buyer account and browse seller shops, buy, manage their account, ..., on the Buyers client application.
Sellers can join the platform by creating a seller account and manage their shops and orders, ..., on the Buyers client application.
I am still confuse about the right approach to adopt.
Here I represented the organization X (the platform). I assume that a buyer is not considered as an organization but rather a user of X. So every time a buyer create an account, I register a user under X, save email and password on an external database and link this entry to a user in X's wallet.
A seller can be considered as an organization (at least to me but happy to debate on that). So every time a seller create an account, I have to create an add a new organization to the existing network. They will however share the same "Seller application", also using a email/password approach.
In most of the sample under the Hyperledger Fabric repo, there is like 3-4 organizations at the start of the network and it is quite painful to add one more to an existing network. In my case, I could end up with 1 million organization or an infinite if the service is a success. Can this scale?
Is it the correct approach for this kind of use case? Any feedback or resource related to this use case is welcome.
This doesn't look like a valid use of hyper-ledger fabric. The blockchain is optimized to store transactional information. It isn't a regular DB, if you try, for instance, to store "user profiles" you will have a hard time trying so. For instance, each member for the blockchain network (again, hyper-ledger fabric) is meant to keep a copy of the ledger. Thus, everyone would get access to all user profiles. You can play around with PDC (private data), or as you mention, having virtually infinite users created on a single organization, but that isn't really how it's supposed to be used..
So, again, hyper-ledger fabric is meant to store transactional information (ledger relates to transaction). I think whatever strategy you try to implement for your use case, you should keep buyer/seller profiles/information off chain, and use the ledger only for transactional information that members of the network can see. In this scenario Fabric would server as an audit trail system, adding trust to each operation between buyers/sellers.

Is it necessary to use a cryptocurrency to make a payment, using blockchain?

I'm documenting in this blockchain world. Basically I would like to make some web application in which a user decides to make a donation, and would like to see who made the donation and to which entity. I have several doubts, the first one:
1-Is it possible to use blockchain using javascript? (can smartcontracts be done in javascript?)
2- If the donation is made using blockchain, is it necessary to use a cryptocurrency? or you can use real money and make the transaction (using some means like paypal)
3- Can real money be transferred by some means such as paypal using blockchain?
Thank you very much, your answers will document me much more
Is it possible to use blockchain using javascript? (can smartcontracts be done in javascript?)
Every blockchain has a SDK, the part of the software which lets you
interact with the real blockchain( A decentralise ledger). There
are generally two parts in the Blockchain , One is client and one
is processor.
As you must have guessed, Client is the one who sends the transaction,
This transaction must satisfy certain rules in order to be accepted by
the transaction processor. If the transaction gets validated by
transaction processor, The transaction will be added to the block alongwith
other transactions and this block will then be added to the blockchain.
Copied to all other nodes (Forks are a different story)
Generally Most blockchains lets you interact with the blockchain through
ABCI which is just an interface to convert your transaction into
a format understandable by the blockchain processor.
Some blockchains has their fixed transaction processing logic like Ethereum for
security and some lets you write your own transaction processing logic like
Sawtooth, Fabric etc.
Permissioned and some public blockchains like Hyperledger projects and
cosmos SDK lets you write your own application layer logic for Blockchain,
So yes, You can write those transactions in Javascript or any other programming
language, as long as it satisfies the interface.
Public blockchain deals with tokens having real worth. Their transaction logic
is already fixed, but some of them does provide javascript API's like NEO
(Not sure about that)
2- If the donation is made using blockchain, is it necessary to use a cryptocurrency? or you can use real money and make the transaction (using some means like paypal)
You can do that and put the donation receipt on Blockchain linked with
real identities of people. This way if anybody wants to check who pays
how much donation, They can query blockchain for the user address.
3- Can real money be transferred by some means such as paypal using blockchain?
This can also be done, but this will involve using a crypt exchange,
centralised or decentralise. You can convert the real money into crypto
of your choice at one end and vice versa at the other hand.
Note: This is based on my limited knowledge of Cryptocurrencies. Please consult more people or any professional company before acting on this advice.
I don't think any protocols offer the possibility to implement their smart contracts in Java Script, but you can build a translator between the two languages which could potentially benefit others in the open source community.
So you want have some engineers do some work for you, in this case build an web application. There are several ways you can get this done, here are some ideas:
a) issue tokens which pays profits based on the success of your new business, you might be able to do this on a protocol that is not tied to any specific crypto or fiat currency.
The users can use an exchange to convert your tokens to their favorite one.
b) approach a private equity or VC fund and get them to pay for it.
c) forget about blockchain, and just pay for the project to your favorite engineers.

Questions abous blockchain and ethereum

I'm reading about blockchain and started devoloping my first smart contract, i have a lot of experience devoloping IT solutions, but everything in blockchain look very different than what i'm used to, i can't visualize some approach and possible i'm losing something in my reading, if someone could help me with those questions below ...
:)
so lets go
Suposing i have a blockchain solution running in ethereum. It's a voting system and this system was devoloped by a district to do a research with your citizens so
If one of the citizens vote, it's a transacation in ethereum and this must be paid using gas. To do that, you need ether and when you create an account this is zero. How would the citizens vote ? will they need to buy ether in a exchange (or mining ?) ?
how can i block votes outside my district if everybody in the network can send data to my smart contract ?
Is it common to have a traditional system for store other datas (address, phones, SSI) and use only a particular transaction, like vote, in blockchain ? how can i integrate them ?
i have created a wallet in myetherwallet. This wallet is the same as a new account command using geth ? is it possible to connect to my wallet created in myetherwallet from geth ?
where can i find a god material for those topics ?
Please find below responses from my end. Remember, the more responses we get to these questions the more diverse it can become as ideas differ from one individual to another based on lots of factors. Anyhow, here we go...
If one of the citizens vote, it's a transacation in ethereum and this must be paid using gas. To do that, you need ether and when you create an account this is zero. How would the citizens vote ? will they need to buy ether in a exchange (or mining ?) ?
Yes, for starters they have to pay the gas. Although, there's an ERC827 out there not to pay fee, and also some discussions around delegating the payment to a specific account, such that instead of individual users the owner of the smart contract can pay. In this case maybe the government can bear the amount.
how can i block votes outside my district if everybody in the network can send data to my smart contract ?
You can run consortium chain like quorum to limit the participants to a specific group. So that the transactions aren’t visible to everyone. Because on the Blockchain main chain of Ethereum it’s visible to everyone.
Is it common to have a traditional system for store other datas (address, phones, SSI) and use only a particular transaction, like vote, in blockchain ? how can i integrate them ?
Yup, you don't want to take the Personal Information (PI) onto Blockchain as its visible for everyone to view. Instead you can have them store in a database and use an Oracle service to be able to talk to outside Blockchain.
i have created a wallet in myetherwallet. This wallet is the same as a new account command using geth ? is it possible to connect to my wallet created in myetherwallet from geth ?
Yes, pretty much possible. You can use your password (or) mnemonic to connect to that account from your geth node.
where can i find a god material for those topics ?
Get this book on amazon or if you are eager to read it before you get the paperback book read it on github here. A better way to read this as a book on github is install an extension called Octotree
Hope, i have answered your questions, except one :)

Smart Contract (Solidity) Auction when bidders abstracted from their wallets

I have a web site which sells certain information for its users for a fixed cost.
I want to go ICO with my business and trying to change my operating model so it can leverage blockchain technology.
However I want to make sure that auction participants are in some way abstracted from their Ethereum wallet and budding in points (they will pay later if action is actually won. i.e. eBay model) without knowing that they are actually using blockchain behind the scenes. Once bidding is complete, ICO investors will automatically get their share distributed to them, and winning bidder will receive their info upon payment (in most cases real money which we will convert to ETH and mark status as paid in solidity contract)
Is there any solution for that problem, can i create wallets on the fly for the bidders accounts? Since my site is always a seller, is there a way to set auctions automatically (interact with my contract from my lets say java backed etc?)
Is there any work around/ suggestions?
Thank You
You can create wallets on the fly for your customers. That's perfectly doable. But as you create the wallets, customers can't trust those wallets you have their private keys, so they should withdraw the funds immediately to their wallets. This took us to step 0: Wallet creation. So either way, your customers have to create a wallet for themselves, for security reasons.

Blockchain as a database for training certifications

I work in a company where in order to send staff to the field, employees have to comply with a certification that expires each 4 years, which probably employees did in their previous job, but the previous job just provided a letter that could be falsified, also, others companies don't spend time and resources to share their databases advocating security for the sensitiveness of data (names, nationality, id, company (including governments), date completion), centralization is a risk they don't want to take. As this is a training that is the same, and conducted everywhere that produces a contract between the company and the person, that expires in 4 years, but the person would like to be able to certify itself with the other companies, I was wondering if there is such implementation in the blockchain world, where writers, public ones, with no interest in 3rd parties, but in consensus due to the training nature, are willing to write/read the transaction on a secure manner providing a "self-service" among producers and consumers.
Assuming the other companies want to participate in the scheme, it is perfectly plausible to use some blockchain solution. You might want to use Hyperledger Fabric to create a privately permissioned blockchain network between the relevant stakeholders.
However don't get sucked into the blockchain hype, evaluate objectively whether the rest of the business processes also fit in the paradigm. Can certifications be revoked? Are there regulations on what data you can store on the employees and rights they have to get their data erased?
There might be many other simpler solutions that achieve the same thing. If the company or training provider just has a private key that signs certificates (PDF?) it might already be enough to solve your letter falsification issue.
Maybe each company could host its list of certified trained people on its own repository which could be queried, such that the list of certified people is maintained up to date (and any revocations can also be handled online), would probably achieve exactly the same result. Just like most other blockchain use-cases, there is a simpler solution that achieves the same thing, and is probably more flexible to fit the rest of the business processes.
Finally, before engaging in too much effort, make sure the other third parties are on-board. Do they really want to share the list of people they trained with competitors? If there is a likelihood they will not play along the project will probably be DOA. Case in point what happened here:
https://www.coindesk.com/ibm-blockchain-maersk-shipping-struggling/