Blockchain in der Softwareentwicklung: Anwendungen jenseits von Kryptowährungen

Die Blockchain-Technologie hat in den letzten Jahren erheblichen Einfluss auf den Sektor der Softwareentwicklung genommen. Meistens kennen Sie Blockchain im Kontext von Kryptowährungen wie Bitcoin und Ethereum. Aber die Technologie bietet weit mehr Möglichkeiten als nur den Bereich der digitalen Währungen. Sie hat das Potenzial, die Art und Weise, wie wir Software entwickeln und nutzen, grundlegend zu verändern. In diesem Artikel werfen wir einen Blick auf die Anwendung von Blockchain in der Softwareentwicklung jenseits von Kryptowährungen. Wir werden die Grundlagen der Blockchain-Technologie erläutern, bevor wir auf ihre Anwendungen in verschiedenen Branchen wie dem Gesundheitswesen und dem Lieferkettenmanagement eingehen. Schließlich beleuchten wir auch die Herausforderungen und ethischen Überlegungen, die mit der Implementierung von Blockchain in der Softwareentwicklung verbunden sind. Begleiten Sie uns auf dieser spannenden Reise durch die Welt der Blockchain.

Die Grundlagen der Blockchain-Technologie: Wie sie die Softwareentwicklung revolutioniert

Um zu verstehen, wie Blockchain die Softwareentwicklung revolutioniert, sollten wir zunächst einen Blick auf die Grundlagen dieser Technologie werfen. Im Kern ist eine Blockchain eine verteilte und dezentrale Datenbank, die Informationen in digitalen Blöcken speichert. Diese Blöcke sind chronologisch und unveränderlich miteinander verknüpft, was eine hohe Sicherheit und Transparenz gewährleistet.

Microsoft Office, das weltweit führende Bürosoftwarepaket, kann als Analogie dienen. Stellen Sie sich vor, anstatt auf einer zentralen Festplatte gespeichert zu werden, würden Ihre Word-Dokumente auf mehreren Computern gleichzeitig gespeichert und ständig synchronisiert. Jede Änderung an einem Dokument würde auf allen Computern gleichzeitig erfolgen. Dies ist ein zentrales Prinzip der Blockchain-Technologie.

Die Blockchain-Technologie bringt folgende Vorteile in die Softwareentwicklung:

  • Dezentralisierung: Es gibt keinen zentralen Punkt des Versagens, was die Systeme robuster macht.
  • Transparenz: Alle Änderungen sind nachvollziehbar und transparent.
  • Sicherheit: Durch die Verschlüsselung und die Verknüpfung der Blöcke ist die Blockchain sehr sicher.

Diese Vorteile haben dazu geführt, dass die Softwareentwicklung auf eine neue Ebene gehoben wird, die über traditionelle Methoden hinausgeht.

Anwendungen von Blockchain in verschiedenen Branchen: Gesundheitswesen, Lieferkettenmanagement und mehr

Die Anwendungen der Blockchain-Technologie gehen weit über Kryptowährungen hinaus und erstrecken sich auf verschiedene Branchen. Ihre inhärente Sicherheit, Transparenz und Dezentralisierung eröffnen immense Möglichkeiten.

Im Gesundheitswesen beispielsweise können Blockchains dazu beitragen, Patientendaten sicher und transparent zu speichern. Alle medizinischen Aufzeichnungen könnten in einer Blockchain gespeichert werden, wodurch Ärzte und medizinisches Personal sofortigen Zugriff auf genaue und aktuelle Informationen hätten. Dies könnte die Patientenversorgung erheblich verbessern.

Im Bereich des Lieferkettenmanagements können Blockchains dazu beitragen, den gesamten Ablauf von der Produktion bis zur Lieferung zu verfolgen. Dies würde:

  • Transparenz für die Verbraucher schaffen, indem sie die Herkunft der Produkte nachverfolgen können.
  • Betrug und Fälschungen minimieren, da jede Änderung in der Kette sofort sichtbar ist.
  • Effizienz steigern, indem Verzögerungen und Engpässe identifiziert werden.

Die Blockchain-Technologie hat das Potenzial, die Art und Weise, wie wir Software nutzen, in vielen Bereichen zu verändern, und ihre Anwendungen nehmen ständig zu.

Die Herausforderungen und ethischen Überlegungen bei der Implementierung von Blockchain in der Softwareentwicklung

Obwohl die Blockchain-Technologie viele Vorteile bietet, gibt es auch Herausforderungen und ethische Überlegungen bei ihrer Implementierung in der Softwareentwicklung. Ein zentrales Problem ist der hohe Energieverbrauch. Da jede Transaktion auf mehreren Computern gleichzeitig verarbeitet wird, kann der Energiebedarf erheblich sein.

Ein weiterer Aspekt sind die Datenschutzbedenken. Während die Transparenz einer Blockchain viele Vorteile hat, erfordert sie auch eine sorgfältige Handhabung der Privatsphäre. Besonders in Branchen wie dem Gesundheitswesen müssen strengste Datenschutznormen eingehalten werden.

Einige der Herausforderungen und ethischen Überlegungen sind:

  • Energieverbrauch: Wie kann die Effizienz der Blockchain verbessert werden, um den Energieverbrauch zu minimieren?
  • Datenschutz: Wie können wir die Transparenz der Blockchain nutzen und gleichzeitig die Privatsphäre der Nutzer schützen?
  • Zugänglichkeit: Wie können wir sicherstellen, dass alle Menschen, unabhängig von technischem Wissen oder Ressourcen, Zugang zu den Vorteilen der Blockchain haben?

Die Auseinandersetzung mit diesen Fragen ist entscheidend für die nachhaltige Integration der Blockchain-Technologie in die Softwareentwicklung.

Simple EOS Dev Environment

This is a beginner’s guide, to setup a simple development environment for the EOSIO blockchain, which will get you up and running in five simple steps from zero to your first smart contract in less than 10 minutes. Afterwards, you will know how to code and test your own smart contracts on an EOS testnet quickly and for free. In this guide we make use of simple tools, which offer a great developer experience, such as the eosio.cdt (Contract Development Toolkit), the Kylin testnet and the eosc command line wallet. We’re using a development machine, running the Ubuntu 18.04 operating system.

So let’s get started!

1. Account, Keys and Tokens

The Kylin Testnet, which is run by several high class block producers, allows easy and fast access to a (non-productive) EOSIO blockchain, using it’s free Account and Faucet services. We’re going to create a new EOS account (12 character name) on the testnet, including @owner and @active keypairs and charge it up with 100 dummy EOS tokens.

Let’s call our new EOS account: dummyaccount

curl http://faucet.cryptokylin.io/create_account?dummyaccount

{
  "msg": "succeeded",
  "keys": {
    "active_key": {
      "public": "EOS7kNBssiunoW7VGcx79BXGUvjbgcaPva4azRwhuTXRfJJ192DJ2",
      "private": "5J1SYvRP1JpWBtk85a4zAbXUmAyBqtr3r58hLuDF5YX6HdcfTYo"
    },
    "owner_key": {
      "public": "EOS6nUXrdodNwRspd7Z42Yp8nRH44wuJNYYoVHSMddr28KKS6Ke4J",
      "private": "5KQzVMR9sZ8sRmRb3NQEzyW43peUow6pYLo831AAXGyEZP7h77z"
    }
  },
  "account": "dummyaccount"
}

curl http://faucet.cryptokylin.io/get_token?dummyaccount

{ "msg": "succeeded" }

Save your @owner and @active keypairs somewhere safe, you’ll need them for the next steps.

2. Wallet and CLI

Next we will download and install the eosc command line wallet, by EOS Canada, in order to interact with the EOS blockchain (currently v1.1.0). This will help us to safely store our private keys and send transactions to the blockchain.

mkdir eosc && cd eosc
curl -LO https://github.com/eoscanada/eosc/releases/download/v1.1.0/eosc_1.1.0_linux_x86_64.tar.gz
tar xzvf ./eosc_1.1.0_linux_x86_64.tar.gz

Now we can use it to import our EOS account via the @active key. This will create a file, named eosc-vault.json, which will contain your encrypted private key.

./eosc vault create --import

- Paste your @active private key from above.
  5J1SYvRP1JpWBtk85a4zAbXUmAyBqtr3r58hLuDF5YX6HdcfTYo
- Hit ENTER.
- Choose a passphrase

3. Account Setup

Here we will issue three ./eosc commands, to setup our account for the deployment of a smart contract. We delegate 20 EOS tokens as blockchain resources (5 EOS staked for NET, 15 EOS staked for CPU) and use some more EOS tokens to buy 500 KiB of RAM as storage for our smart contract. Finally, we check our account with the eosc get account command.

Hint: We need approximately 10x the bytes of RAM as is the filesize of our WASM binary contract, due to the overhead of the virtual machine. So if our compiled contract file (e.g. hello.wasm) has a filesize of 10 KiB, we need approximately 100 KiB in RAM resources on the EOSIO blockchain, to deploy the contract.

./eosc -u https://kylin.eoscanada.com system delegatebw dummyaccount dummyaccount 5 15

./eosc -u https://kylin.eoscanada.com system buyrambytes dummyaccount dummyaccount 512000

./eosc -u https://kylin.eoscanada.com get account dummyaccount
privileged:   false
created at:   2018-11-15 14:45:25 +0000 UTC

permissions:
     "owner" w/1         :  +1 EOS6nUXrdodNwRspd7Z42Yp8nRH44wuJNYYoVHSMddr28KKS6Ke4J
           "active" w/1  :  +1 EOS7kNBssiunoW7VGcx79BXGUvjbgcaPva4azRwhuTXRfJJ192DJ2

memory:
      quota:           506.8  KB   used:           3.490  KB

net bandwidth:
      staked:              5.0000  EOS    (total stake delegated from account to self)
      delegated:           1.0000  EOS    (total stake delegated to account from others)
      used:                   257  bytes
      available:            11.18  MB
      limit:                11.18  MB

cpu bandwidth:
      staked:             15.0000  EOS  (total stake delegated from account to self)
      delegated:           1.0000  EOS  (total stake delegated to account from others)
      used:                 1.129  ms
      available:            807.2  ms
      limit:                808.3  ms

EOS balances:
      liquid:             67.8553  EOS
      staked:             20.0000  EOS
      unstaking:           0.0000  EOS
      total:              87.8553  EOS

voted for:
      

voter info:
      proxy:                
      is proxy:             false
      staked:               200000
      vote weight:          0.000000
      proxied vote weight:  0.000000

4. Contract Development Toolkit

Download and install the latest version of eosio.cdt (currently v1.4.1). This will give you access to the smart contract WASM and ABI compilers/generators, as well as to the eosio C/C++ libraries and header files. Get it at: https://github.com/EOSIO/eosio.cdt/releases

curl -LO https://github.com/EOSIO/eosio.cdt/releases/download/v1.4.1/eosio.cdt-1.4.1.x86_64.deb
sudo dpkg -i ./eosio.cdt-1.4.1.x86_64.deb

5. Compile and Deploy a Smart Contract

Let’s create a simple “Hello World” smart contract, by creating a file with the following contents, named hello.cpp:

#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>

using namespace eosio;

CONTRACT hello : public contract {
  public:
      using contract::contract;

      ACTION hi( name user ) {
         print( "Hello, ", name{user});
      }

      ACTION yo( name user ) {
         print( "Yo, ", name{user});
      }
};
EOSIO_DISPATCH( hello, (hi)(yo) )

This C++ file can now be compiled and deployed to the EOS blockchain, using the eosio.cdt Contract Development Toolkit. After compilation we will get a binary WASM file hello.wasm of about 2.3 KiB (needs ~23 KiB of eosio RAM) and a file named hello.abi, which describes the interface of our code’s actions.

eosio-cpp -o hello.wasm hello.cpp --abigen

./eosc -u https://kylin.eoscanada.com system setcontract dummyaccount ./hello.wasm ./hello.abi

./eosc -u https://kylin.eoscanada.com tx create dummyaccount yo '{"user":"bob"}' -p dummyaccount

Congratulations!

After finishing the five simple steps above, you can now officially call yourself a “Blockchain Expert”. 😉

Feel free to experiment with the above mentioned tools, keep on improving your EOSIO knowledge with help of the hyperlinks I put into the article and continue to develop you very own EOS smart contracts!

If you liked this tutorial, please consider a donation to my EOS account: teammaerdian