Questions tagged [blockchain]

A blockchain is an open, distributed ledger that can record transactions between two parties in a verifiable and permanent way. The ledger itself can also be programmed to trigger transactions automatically.

A blockchain – originally block chain – is a distributed ledger that is used to maintain a continuously growing list of records, called blocks. Each block contains a timestamp and a link to a previous block. A blockchain is typically managed by a peer-to-peer network collectively adhering to a protocol for validating new blocks. By design, blockchains are inherently resistant to modification of the data. Once recorded, the data in any given block cannot be altered retroactively without the alteration of all subsequent blocks and the collusion of the network. Functionally, a blockchain can serve as "an open, distributed ledger that can record transactions between two parties in a verifiable and permanent way." The ledger itself can also be programmed to trigger transactions automatically.

Blockchains are secure by design and are an example of a distributed computing system with high Byzantine fault tolerance. Decentralized consensus can therefore be achieved with a blockchain. This makes blockchains potentially suitable for the recording of events, medical records, and other records management activities, identity management, transaction processing, and documenting provenance.

Definition taken from Wikipedia - Blockchain

One of the most well-known use-cases is cryptocurrencies, but can be used for distributed agreement on other things.

6711 questions
26
votes
2 answers

Where do smart contracts reside in blockchain (Ethereum or Hyperledger)

So, let us consider a typical trade finance process flow. Exporter deploys a contract that has conditions of the shipment and a hash is generated once the deployment is finished. Questions: 1) Where is the contract stored? 2) How other…
Saurabh
  • 1,249
  • 2
  • 13
  • 14
25
votes
4 answers

How to return mapping list in Solidity? (Ethereum contract)

I want to make a simple smart contract that has a list, can set item, and can get the list. Code in solidity: contract lister { mapping(int => string) list; int id = 0; function getList() returns ( /*HERE*/ ) { return list; …
6londe
  • 557
  • 1
  • 8
  • 17
23
votes
11 answers

solidity transaction error, The called function should be payable if you send value and the value you send should be less than your current balance

I'm learning solidity on remix. I was following some tutorial video on youtube and I've got stuck trying to build 2 contracts. contract ERC20Token has function which increases balances. And Mycontract instantiates and call the mint function. I did…
Baaam Park
  • 415
  • 1
  • 5
  • 7
23
votes
6 answers

Blockchain implementation

I am new for blockchain, I want to implement blockchain in our new financial project where prediction will be shared between different parties. A lot of theoretical matter is available on the internet. But where we can start for implementation.
22
votes
14 answers

String concatenation in solidity?

How do I concatenate strings in solidity? var str = 'asdf' var b = str + 'sdf' seems not to work. I looked up the documentation and there is not much mentioned about string concatenation. But it is stated that it works with the dot ('.')? "[...] a…
tObi
  • 1,864
  • 3
  • 20
  • 32
21
votes
1 answer

Performance Test of the Hyperledger Fabric

During trying to achieve the performance with Hyperledger Fabric which IBM team reported in their article Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains, I faced some problems and errors. I collected all useful…
21
votes
1 answer

Is Blockchain a single linked list?

Seen as datatype, is Blockchain a single linked list? As each block refers to the previous block using a hash. Or is it some kind of tree?
tuuttuut
  • 477
  • 7
  • 21
20
votes
1 answer

In Substrate, What is the difference between Babe, Aura, and Grandpa

Substrate supports "pluggable consensus" so a developer can choose from among several consensus algorithms. It comes standard with four algorithms: Aura Babe Proof of Work Grandpa Some of these (eg babe and grandpa) can even be used together in a…
JoshOrndorff
  • 1,591
  • 9
  • 19
20
votes
2 answers

what approve and allowance methods are really doing in ERC20 Standard?

The problem is what allowance and approve are really doing? And what is _spender and what is it doing? Is there anybody who can explain it to me? contract Token { uint256 public totalSupply; function balanceOf(address _owner) constant…
shahabvshahabi
  • 937
  • 2
  • 7
  • 18
20
votes
9 answers

Blockchain and HyperLedger Fabric difference

While I am trying to understand the blockchain technology, I came across HyperLedger Fabric. As per the documentation, it is an implementation of blockchain technology. What does that mean? Is block chain just a concept and HyperLedger Fabric, an…
Manikandan Kannan
  • 8,684
  • 15
  • 44
  • 65
18
votes
1 answer

When should I build a Substrate Runtime Module versus a Substrate Smart Contract?

What are the differences between developing a Substrate Runtime Module and a Substrate Smart Contract (for example with the ink! language)? What are some examples of applications which are best written in one form or the other?
mountbranch
  • 334
  • 2
  • 7
18
votes
1 answer

Handling user profiles in Ethereum DApps

I'm in the process of creating an Ethereum DApp. The DApp consists of users who have associated data like email, name, and a profile picture. I would like to store the contents of the user within IPFS as a JSON object and reference this on chain…
Dondrey Taylor
  • 290
  • 3
  • 10
17
votes
2 answers

Solidity, Solc Error: Struct containing a (nested) mapping cannot be constructed

I am using Solc version 0.7.0 installed by npm. When I try to create a Struct that contains mapping, I received an error: "Struct containing a (nested) mapping cannot be constructed." Please check the code: // SPDX-License-Identifier: MIT pragma…
coding
  • 627
  • 7
  • 20
17
votes
2 answers

Calling external contract in solidity dynamically

I am trying to make a contract have a function that is capable of calling functions of another contract. The key part of my goal is that the contract should not be able to be deployed without any import statements and will not know the name of the…
GK1
  • 447
  • 1
  • 5
  • 11
16
votes
2 answers

How do you convert between Substrate specific types and Rust primitive types?

Using the Substrate blockchain framework, how can I convert between Substrate specific types and Rust primitive types and vice versa? For example: Convert a time (T::Moment) to a u64 Convert a u64 to a T::Balance etc...
Shawn Tabrizi
  • 12,206
  • 1
  • 38
  • 69