I am starting to learn about blockchain. After reading about the main concepts composing a blockchain network, I have some doubts that I am not able to solve despite performing many searches on the internet.
On the one hand, it is clear that transactions are grouped into blocks and the miner node that solve the consensus algorithm is the one putting the block in the distributed ledger. However, I have read that Ethereum (usually used for cryptocurrency with Ether) could be used as blockchain platform for different applications such as food traceability, assets management, etc. In this case, all these applications are using the same distributed ledger, i mean, the Ethereum distribution ledger can store different kinds of blocks, i.e. blocks from a food traceability application, from the assets management one or those derived from cryptocurrency?
On the other hand, I understand the role of smart contracts but it is not too clear for me which is the difference among the consensus and contract layer and when smart contracts are needed.
Could you help me with these doubts?
Thank you in advance for your help
Can the Ethereum distribution ledger store different kinds of blocks, i.e. blocks from a food traceability application, from the assets management one, or those derived from cryptocurrency?
Food traceability, assets management, cryptocurrency, whatever the use case or name you provide at the marketing layer will have no effect on the stored data in a smart contract that runs on EVM. For example, if you use postgresql as your backend database for your next food delivery or asset management app does that changes how postgresql stores data in blocks, it's internal data representation, its indexing mechanism, or its query interface?
When smart contracts are needed?
The need for smart contracts is to provide permanent, transparent logic in a programming language like solidity, vyper which gets converted to bytecode, and only that bytecode is deployed in the network (Internally, it's just a transaction sent to zero address). In return, you get the contract's address to interact with the contract's ABI and you do have that permanently with its state.
Additionally, the consensus layer will be handled by eth-node implementation so don't worry about it. You may have a look at layer 2 scaling in later phases.
More reading should help:
Mastering Ethereum
Ethereum Yellow Paper
Related
I ask this question because I want to facilitate a workflow that utilizes a managed blockchain service such as the Azure or AWS blockchain service.
Is the true purpose attestations, provenance and interoperability?
In that aspect, aren't regular (legacy and or current) methodologies sufficient for data interoperability and the transfer and consumption of said data?
Lastly, if all this effectively is doing is creating a ledger account of data flow would a true advantage be the encryption of the data existing on the entire flow including up unto the edge?
If it cannot be encrypted up to the edge so that it is not readable at any point in time of the data flow into the data archive/traditional store is effectively worth any of the previous described gains of provenance and interoperability?
I think there is some nuance to this answer. The purpose of Azure Blockchain Service is to allow enterprises to build networks (consortiums) that enable the business workflows. The unique value that blockchain is adding to business workflows is a logical data model/flow with infrastructure shared to the participants (businesses). That is not easy to do with a traditional database model.
With regards to the encryption you mentioned above, the value with blockchain is providing a digital signature for every change in the system that is shared between enterprises. The typically is done at the client to provide the least chance for manipulation. Privacy, which can use encryption techniques, is something that can be used to allow participants to control access to change details. The fact that changes were made is still cryptographically verifiable, without sharing all the data details with everyone.
If you look at something like EDI that is done today with supply chains, this essentially is a complex network of enterprises, synchronizing databases. This typically suffers breakage of keeping all these things in sync. With a blockchain based system, the "syncing" is abstracted and the focus is more about the business logic, which is always cryptographically signed and verifiable. So it functions like a single "logical" data store, but is actually distributed.
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.
Everything I've been reading about blockchain from my understanding says that even on a private blockchain, every participant can view all transactions. I've seen it mentioned that a use case for block chain could be the sharing of medical data. So for example if I had a blockchain that holds the medical history of every person from birth to death in a country. Is there no way of setting up permissions so that only data relating to a person and those who have been given permission to that person's data can view it? If the data is stored on every node in a blockchain, how is a person's computer supposed to have the capacity to store the medical data of every person in a country?
I would advise looking up Medrec when related to health care. Most of the research is geared towards dealing with keeping the data off the chain. In addition, there are other blockchains that might provide a better solution, for more privacy, for example, I would look up quorum by JP Morgan. There are different formats being looked at but these can give you two possible solutions. Also, check out Health Nexus' whitepaper, it deals with medical blockchain technology. Let me know if you need more.
https://www.pubpub.org/pub/medrec
https://github.com/jpmorganchase/quorum
There are blockchains that allow defining permissions. Hyperledger Fabric is one of them. You have the ability to configure channels with data stored in the ledger of the participants in the channel only.
to pass the scalability problem of blockchains and their solutions for this purpose, you should concentrate on off-chain architecture.
right now this scenario should be considered:
save tx's to the blockchain(it should be formal)
save hashed data to an off-chain repository like DB's.
save the address of that data-hash to blockchain for future access.
yeah, you pointed to the right thing. a central point of access as an admin-node or god should be the opposite of blockchain as a distributed dream.
for this issue, the mechanism like secret-sharing or re-encrypt proxy should be realized to guarantee the privacy and security of data-hashed.
for more information read this article:
https://www.sciencedirect.com/science/article/pii/S2210670717310685
GoQuorum has an 'enhanced permissioning' model where you can do all that, and at the same time stay compatible with Ethereum standards.
Check this out: https://consensys.net/docs/goquorum/en/latest/configure-and-manage/manage/enhanced-permissions/
I am learning blockchain technology. I read many tutorials and I got the basic idea of what blockchain is but I am confused with the fact that are there individual separate blockchains for separate DAPPs and the people who are using that DAPP, will only be the part of that DAPP's blockchain and what the blocks in Ethereum blockchain really contain ?
If anyone can clear my novice doubt, that would be very helpful.
Thanks in advance :)
A dApp, which is a decentralized application, may or may not have it's own blockchain. It depends.
For example, there's the Ethereum mainnet, which is public, and anyone can have their dApp interact with it. In this case the dApp doesn't have it's own blockchain.
However, anyone can fork or run their own copy of Ethereum, which in this case, it's a separately owned blockchain instance so it'll have it's down data and blocks not pegged to the public mainnet blockchain.
A DApp is a decentralized Application. This is usually a set made of:
a smart contract (your backend if you like)
some web frontend to interact with it (UI)
A specific smart contract is deployed on one or several chains. It depends what the author decided to do.
Regarding your frontend, you could implement it so it can interact with your smart contract on all the chains you support.
So if your smart contract is deployed on mainnet + testnet for instance, you could write your frontend to support both.
So a given DApp may support multiple chains but an author may also decide to write different Smart Contract + UI depending on the chain it is supposed to run on.
The most basic DAPP you'll write is a (javascript) frontend with a single Smart Contract stored on Ethereum as the backend. A Smart Contract is a Robot Account. It's a regular account WITH code AND storage.
When a transaction hits the Robot Account, the "Ethereum Machine" will start the robot and run its code. Maybe the robot will write to its storage, start other robots, etc. But this is still part of "THE" Blockchain, because it's just a transaction. Slightly more complicated than "move X$ from A to B", but still a simple transaction with a source, target and payload.
There's ONE Blockchain on Ethereum, it's a chain of Block. And a Block is a list of transactions. And a Transaction is a source, target and payload.
Once you start writing more complex DAPPs, maybe Ethereum won't be sufficient anymore. Maybe you need to store large files which is too expensive on Ethereum. That's where you may use other PLATFORMS, that are going to use their own Blockchain.
If you want more implementation details, checkout the Ethereum Yellow Paper:
"The Transaction" is described in section 4.3
"The Block" is described in section 4.4.
Each Smart Contract have their own Merkle Patricia Trie which ressemble a Blockchain but it's more of an implementation detail.
I wrote in more details about how Ethereum Storage works with gas & cost considerations & why you may want to use something else, I hope that can help you.
I understand that the BigChainDB is a distributed DB at the basic level.
It claims that is solves the problem of Scalability in the BlockChain world. What i don't understand is that how it fits into the overall block chain architecture.
In the typical Block Chain world, each node has the full copy of the
data and validates any new transactions? How does this work in the
BigChain DB when the data is distributed? Each node validates only the
blocks that it holds? Even if thats the case, it needs the entire
chain? Not clear on the processing scalability here.
Can i build a block chain network just with the BigChainDB or do i
need something like Ethereum or Hyperledger to build the block chain
network itself?
If i can build the blockchain network with BigChainDB, then what is
the equivalent of smart contract in BigChainDB?
BigchainDB internally uses RethinkDB as a datastore. Technically, the blockchain is stored as JSON strings inside RethinkDB. And BigchainDB is a kind of wrapper on top of this storage which provides the needed cryptography, techniques for building the blocks, parsing the blocks and provides utility methods to access the database. RethinkDB provides clustered storage with possible shard based architecture. This makes BigchainDB scalable when RethinkDB is configured accordingly.
Yes. It is possible to build a blockchain network just with BigchainDB.
BigchainDB library provides APIs to be called from our code. So we can build any application(preferably in Python) and integrate BigchainDB into it. This means, the business logic stays inside our application code. This is totally different from Smart contracts used in Ethereum.
You can have a look at my github code for more insights. It is my college project and not much documentation is available :-D It is a voucher transfer application where company like Sodexo issue vouchers and users can redeem it in private companies like Starbucks.