General Question on how to use Quorum blockchain - blockchain

I am very new to quorum programming. I already made some Smart Contracts with solidity on ethereum and made some dapps with Truffle, React and Metamask.
Now I did this Quorum Tutorial: https://truffleframework.com/tutorials/building-dapps-for-quorum-private-enterprise-blockchains
Before I get to the problem I have, I tell you what I am trying to do:
Right now we have a database in our school, where the teacher can save the marks of the students, and the students can log in and see the marks they have. I'm trying to make a prototype, where this data is stored on a private blockchain like quorum.
So what I already did is a react front end for the prototype and I want that teachers can log in, save marks for a student and then the students can log in and see their marks. This means that students and teachers all need a login.
The Problems I face:
How can I set up a local productive quorum node?
For ethereum and ganache, you can use metamask and then use the
metamask account in the react front-end to make transactions. How
does it look like with quorum?
How can I make a login? Or does the teacher and student need to know
a private key for their account?
As you can see, Im very new in this world and I need to learn a bit more about the concept.
Thank you for your help

How can I set up a local productive quorum node?
Something like Quourum Maker may assist you in being able to quickly bootstrap a Quorum network without having to go through tedious manual configuration. The Quorum documentation is also full of tutorials that can guide you through this process.
For ethereum and ganache, you can use metamask and then use the metamask account in the react front-end to make transactions. How does it look like with quorum?
You could utilize something akin to ethereumjs-wallet to create wallets in-code and send the transactions via the Quorum web3.js library. You would need to then map these wallets to users in an off-chain database which leads into your next question.
How can I make a login? Or does the teacher and student need to know a private key for their account?
You can handle authentication in your web application via an IDP in which students and faculty already have existing credentials with if you have the appropriate access to do so. Otherwise, you could utilize SSO with well-known IDPs via something akin to Auth0.
Your flow would essentially involve first having the user authenticate, then tying their identity to a generated Ethereum wallet upon their first authentication and persisting these tied identities to an off-chain database. Subsequent authentications would pull the persisted wallet information from the off-chain database and use that for transaction signing. Other considerations would involve utilizing appropriate key management services as well as utilizing an HSM for secure transaction signing.

I could have given you the steps but on a second thought, I think its a good idea to start using something simpler like https://github.com/ssbc/ssb-db and then, come back to Ethereum.

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.

Handling user data and storage in Ethereum Dapps-Understanding

I've just started writing smart contracts and developing Dapps on the Ethereum Blockchain, basically users interacting with the smart contract and storing some lightweight data into the blockchain.
I have a general but very vague idea on how to do all of this so I simply wanted to make sure that I got stuff right, so please beare with me .
What I want to do:
User Login : I am not very sure about this. Should I handle it as a traditional user login ( database) or I could use the blockchain for that? and if so , how would I be able to do so?
Store data (Strings, boolean and an Image) into the blockchain via a web interface: I've seen some tutorials but most of them don't 'store' the data, I want to be able to show this data to my user . So maybe I should use a JSON file? I read about IPFS fo image storing but I dont know how to associate a hash to my Eth account.
What I did :
Set up my own private Ethereum Blockchain
Written a contract that handles a string ( user's name) and then returns it on the GUI
Written the web interface
TL;DR: I am trying to store user's data into the blockchain so that I can show it again but I dont know how to proceed. I am also confused about the user Login . Please help me ( any links would be greatly appreciated) or at least tell me if I'm on the right path.
For login you can have a user to sign a message using the private key in their wallet on web or mobile Then on the server-side you can verify this message came from a certain Ethereum address and create the database record for the matching address in fly
You can store data in a transactional blockchain, but it is discouraged and not the purpose of a blockchain. The data storage cost on a public Ethereum blockchain will be millions of times more than in a database or other dedicated storaeg. If you do this for learning I suggest you try products like Storj or Sia for decentralised file storage.

Is it possible to query the Blockchain API to get information on currency exchanges?

Coinbase stopped publishing it's user stats in 2017, so I haven't been able to find a way to see how many users currently use the exchange.
My (albeing limited) understanding is I should be able to work this information out from querying the Blockchain.
Is this possible?
I'am not sure about Ccinbase, but i know that a lot of exchanges creates completely different wallets(addresses) for each user, so its impossible to track them. You can do it for decentralized exchanges as Idex/Bancor/0x etc, because they are using specific smart-contract(only in Ethereum network)

Blockchain dApp: How end user use dApp without care of Ethereum Account

I want to develop a dApp (Smart Contract) on Ethereum and have a mobile application on top of it.
My concern is: every time we interact with Smart Contract to inquiry or change data, we need a account as well as a certain number of ETH used as Gas. It looks no problem on the development environment, but getting into trouble in real life, I mean about user experience (UX).
- Whenever a user download and install the app, we will create for them an Ethereum account. BUT where they can get ETH to interact with Smart Contract? And absolutely, they don't care and don't want to be bothered with exchange ETH.
I have an alternative solution: we have only 1 Ethereum account with some ETH in their and act as the Proxy to the Smart Contract. Whenever user's request come, we delegate the request to Smart Contract and return to user. BUT it seems we will lost the main characteristic of Blockhain: Decentralized :) Who know we might arbitrarily change the Smart Contract without user attention.
Any suggestion is appreciated. Thank you!
You can send some ether to each new user that is just enough to call your contract.

How does the blockchain verify new assets?

how to verify new assets in a blockchain? For example: in order to participate in blockchain transactions, a member must first claim to have an asset that the network has not seen before, how would the network verify this claim? I've read a bunch of papers, but they're too bitcoin centric, which is that there are centralized institutions that issue block assets to members in exchange for real world currencies. And the non-bitcoin-centric mechanism seems to just assume that the new asset is inalienably verified, so just hash it directly with a timestamp as a new block. There doesn't seem to be any verification process. Is it incumbent on the application to determine a specialized verification algorithm? Am I just completely missing something? Please any response is appreciated.
To track assets using the blockchain you create your own token and create a owner which can then assign people the asset using contracts or manually. If you are talking about currency then you either need to work and mine it or buy.
Yes it is the application's and mostly the user's responsibility. A real world asset cannot be pegged to a digital asset, blockchain or not, without a central authority enforcing such a peg.