Since Vitalik Buterin Ethereum has developed, are Smart Contracts without the block Chain Ecosystem. But what is behind the “smart contracts”? In five Parts, Ingo Rammer explored for us the implications of the technology. Today: Why is a Smart Contract for sure?
part 1: Smart Contracts: bringer of salvation, or a better database?
part 2: More than just crypto-currencies: transactions and Smart Contracts
part 3: Solidity: How to program Smart Contracts?
Why, exactly, the Whole thing is safe?
So far, So good. But what about the safety of this approach? What would happen if one of the participants exchanging the Smart Contract on the controlled Blockchain Node is simple and a variant is used, which is advantageous to him? (According to Blockchain, the attacker would have to dive to do this, by the way, is relatively far into the internals of the implementation of the Blockchain-a platform – but it is still a valid attack vector, you have to at least consider, at the theoretical level.)
What would have to do an attacker?
In our example could try an attacker to take control of all the telephone numbers, by changing the conditions of the test in its Version of the Smart Contract. But that would lead to the World State is only changed on the Node of the attacker: for him, it looks as if he is in control of all the phone numbers.
All of the other participants would continue to run the correct Version of the Contracts. It comes on the basis of the consensus mechanism between the participants that the attacker is selected by the network itself, in order to generate new blocks, they would be immediately rejected by the other participants.
The attacker would lose the Status of the block generator, since, depending on the configuration of the Blockchain, the half or two-thirds of all participants must be the result of a transaction agree to before you will be considered across the network as correct. A attack attempt to harm, therefore, only the attacker himself.
You can compare, therefore, this attack in, for instance, a Bank customer writes the status on his printed statement of account by strokes and increased credit. From his point of view he now has much more money than before. Once he tried but, on this money to access, he will be brought very quickly to the bottom of the facts: The own point of view, remains a wish and will to be acknowledged by his Opposite, in the best case, with a Smile.
is called a Smart Contract?
After we have seen so far, such as a Smart Contract is technically defined, and to know that he can trigger events which external (Non-Blockchain)can handle systems that are missing now for the last piece of the puzzle: How the Smart Contract is called?
there are for the most Blockchain platforms and relevant SDKs in JavaScript .NET and/or Java. These SDKs allow the creation, signing and Transmission of transactions on own or third-powered Nodes of the Blockchain network.
In the case of Ethereum-derivatives is called a Smart Contract, such as: First, the method name and the methods to be converted arguments in a custom binary format. For this, helper methods of the SDK are provided, the process interface description (ABI – Application Binary Interface) of the Smart Contract and the corresponding binary can generate data. Thereafter, a transaction is created, which is used as a destination address the address that has been created in the above-described instantiation of the Smart Contracts.
This whole Operation can be carried out by the client code explicitly, in individual steps, or – as in Listing 5 is shown by the auto-generated methods like a normal function call look. In the Listing, we see the relevant part of the call-up of the above-presented Contract method request transfer, of the web3.js [4], the JavaScript SDK for Ethereum.
Listing 5
// Contract-object is based on the ABI and a sample destination address are liable to be generated
let OJ = JSON.parse(fs.read file sync(“demo contract.abi”));
let address = “0xFe363D7030Db8E93517bB6315165B68ac4387de8”;
let demo contract = new web3.eth.Contract(OJ, address);
// In the Background of the method call in an Ethereum is translated transaction, this signed with a configured (and, in the run-up to explicitly shared) Default-identity, and sent to the network.
let numberto transfer = “491511234567”;
demo contract.methods.request transfer(numberto transfer)
.send({/* options */})
.then(function (receipt) {
// … further processing
});
Smart Contracts and crypto-currencies
We have seen that Smart Contracts are simply a way to program code distributed across a network. In order to achieve the respective Blockchain platform guaranteed data integrity. However, as the Hype in the IoT area (e.g., the in the introduction mentioned automatic cold chain monitoring with penalty payments)? In such cases, the Smart Contracts consistently take over the administration of monetary accounting units (crypto-currencies).
for Example, could set up for a refrigerated container, you want to Singapore to Amsterdam to transport, a Smart Contract. This implements the Monitoring of the maximum allowed temperature fluctuation (the Logistics company guarantees) and at the same time, an automatic penalty in case of deviation.
The Contract could be designed so that a IoT Sensor reports during the entire transport every hour, the temperature on the Smart Contract, and a deviation from the agreed temperature range immediately another Blockchain transaction for the Transfer of a settlement currency as penalty payment.
Also in the case of Blockchain networks, the take over the automatic processing of distributed power supplies, is similar to the combinations of IoT Sensors with Smart Contracts in the Background. (In fact, the term “Smart Contract” based on such a specific pre-agreements, without any manual or even judicial follow-up and technically, be automatically implemented.)
The really Interesting and New to Blockchains is that they allow for the establishment of fully decentralized structures. Network operators need to agree on a Central, trusted location, but only on the contents of the Smart Contracts. These then run decentralized in the Blockchain network. Not only for the logistics sector but for all sectors of the market, the hope is that the market can implement the participants in digital processes, without their autonomy through the election of a Central processing organ (which may be drawn from a Pool of competitors in the same industry).
And personally, I find this really exciting.
Ingo Rammer is a Speaker at the Blockchain Technology Conference from November 19-21. November in Berlin. There you can collect practical experiences with international experts. In addition, there are Live Demos and case studies of real implementations, individual interaction with experts and Networking opportunities with people from various industries. It also has a variety of Sessions, Workshops and lectures of international speakers.
Exclusive discount Code for our readers: blockchain Easy-to-btc-15 input and 15 percent discount. Tickets can be purchased here.