concept contract in category blockchain

appears as: contracts, contract, contracts, The contract, contract
Blockchain in Action

This is an excerpt from Manning's book Blockchain in Action.

Even though Bitcoin appeared to have launched suddenly in 2009, the idea of a working digital currency has been a quest since the dawn of computing. Bitcoin’s blockchain technology stands on a strong foundation of more than 40 years of scientific research in cryptography, hashing, peer-to-peer networks, and consensus protocols. Figure 1.1 provides a brief history of blockchain, its innovation and robust scientific foundation, and its transformative effect on modern networked systems.

  • Replace a course. This function replaces a course in the certificate program. The user probably will add a different course to improve their GPA or update their grade after retaking the course.
  • if(registeredStudents[msg.sender].prereq115 > 0 &&
            registeredStudents[msg.sender].prereq116 > 0) {
     
                preRequisitesSatisfied = true;
                emit preRequisiteSatisfied(personNumber);
                totalGPA += registeredStudents[msg.sender].prereq115 + 
                            registeredStudents[msg.sender].prereq116;
    Permissioned Blockchains in Action

    This is an excerpt from Manning's book Permissioned Blockchains in Action.

    Now that you met Joe, it is time to meet Smart Contracts. Or at least, take a peek at them from across the street. Simply put a Smart Contract is a piece of code that we place on the blockchain. Instead of including transactions in a block, we put in the conditions of a contract. Now that they are secured and immutable with the use of DLT, we wait. Once the conditions occur (one of them could be a particular transaction being sent to an address) – the code is executed. This means that there is no need to rely on a third party to execute it; moreover, this helps with making sure that no one can change the output of the smart contract after execution. There are (ideally) no disputes, the speed of execution is much higher, they are self verifiable, self executable and extremely tamper resistant.

    Some argue that Smart Contracts are, to date, the most successful application of blockchain and DLT.  It is pretty clear that, although Szabo introduced the concept in 1994, the world has not really moved to a digital contract space. Most documents today are paper-based, and if there are digital versions of it, there is always a trusted third party that attests to its validity. We are used to this situation, but this does not mean it is a good one: anything that relies on a trusted third party leads to security threats, potential for malicious activities and, of course, fees. Smart contracts work best where traditional contracts are the fallback basis of conducting businesses, as these benefit from the transparency, increased trust and time efficiency. As the contract is effectively a computer program, there is no way to only partially fulfill terms and conditions. We see most uptake of Smart Contracts in insurance, IoT, mortgage loans, HR contracts, copyright and supply chain management.

    Figure 4.11. Successful deployment of a contract

    Now here is an important point: if parties involved in the agreement start a transaction, they communicate to the network that certain requirements have been fulfilled (or not) and the code should be executed, according to the definition of the contract. However, if a transaction isn’t sent to the network, the code will not be executed. Yes - smart contracts always need external triggers to be executed. If no one tells the network you received the wine, Joe will never get the money.  It is not the case that you can just ask a smart contract to “listen” to what is happening in the outside world and find events that it’s waiting for. To put it in software development terms, smart contracts cannot poll for data.

    var Dealer = new web3.eth.Contract([ <<abi>> ], ‘<<address>>’);

    Here, we supply the ABI of the contract and the address of the deployed contract to the web3 library. This returns an object that is assigned to the Dealer variable. Dealer is the Javascript representation of our deployed contract: it is how we’ll interact with the contract.