Consultancy – Blockchain Consulting Gmbh Munich https://bcc-munich.com Unlocking the potential of the digital future. Mon, 11 Oct 2021 13:44:29 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 https://bcc-munich.com/wp-content/uploads/2021/09/Site_Icon_BCC.svg Consultancy – Blockchain Consulting Gmbh Munich https://bcc-munich.com 32 32 Voting via Blockchain at Blockchain Consulting https://bcc-munich.com/insight/voting-via-blockchain/ Wed, 29 Sep 2021 09:53:32 +0000 https://bcc-munich.com/?post_type=us_portfolio&p=4652

Abstract

Voting is a fundamental right of citizens who live in a democracy. We at Blockchain Consulting were approached several times to evaluate voting systems. Despite the obvious advantages of using blockchain for voting, there are also some problems such as vote privacy. For years, people have been struggling to find workarounds for these downsides, and it still remains hard to find solutions. In 2021, we decided to develop our own voting application and to use it for in-house purposes. Our goal was to find solutions to some of the problems that could not be solved yet.

Voting on blockchain

Voting was already part of the attic democracy in 500 b.c. and, despite technological advancements , the voting process is pretty much the same today as it was back then. The voter receives the ballot, checks a box next to their preferred choice in private, upon which someone collects and counts everyone’s votes to determine the winner .

One of the first ideas for using  blockchain technology for something other than payment solutions and financial services was to use it for voting processes. People envisioned a faster and more efficient voting process. They also thought the immutability of a blockchain would guarantee trust in the result. Trust is an important component. Just take the 2020 US presidential election and the huge debate around postal votes. Even in modern democracies, the element of trust in a voting process is definitely a weak point.

Most famously, Ethereum founder Vitalik Buterin referred to a statistic which suggested that 27% of mail-in ballots were not counted in South Florida in the 2020 presidential election. He Thereby claimed it would not be that hard to beat an accuracy of 73% and supported the idea of voting on blockchain. (Mapperson, 2020)

Analysis of voting processes on blockchain

At Blockchain Consulting we researched possible blockchain-based voting processes throughout the years and closely followed the developments in this area. When the Republican party Utah GOP convention used a blockchain-based voting application in April 2020, we looked into the application they used and analysed the process once again. (Anzalone, 2020)

The general advantages of blockchain-based voting are:

  • Real time confirmation of the votes
  • Transparency, as all transactions are recorded on the blockchain
  • Data integrity due to decentralized consensus mechanisms
  • High level of security through decentralized infrastructure

Despite these advantages there are also problems that require  widely accepted solutions:

The first and most common  problem is privacy. It needs to be ensured that the person voting can only vote once – therefore, we need to know who is voting. How can the process remain anonymous if it has to be verified that one individual only casts one vote. 

The wide and imprecise answer to this problem is usually “cryptographic methods”. So far we have not yet found a method that ensures 100% privacy without trusting  a third party.

Idea creation

Here at Blockchain Consulting, we use a prototype approach to test concepts and processes, and to find further solutions to potential problems . Upon researching  how to ensure privacy on a public blockchain, the natural choice for a testing environment were the simple, non-critical everyday polls of our daily office lives. Nevertheless our goal was and still is to derive ideas and develop solutions based on the status of the application. We decided to develop a blockchain-based voting application for internal purposes, through which employees were able to democratically vote on questions regarding  

  • Projects
  • Workshops
  • Lunch

Development phase

In our application, the voting process is a smart contract with variable attributes such as:

  • Voter: Eligible users can be added to the voting.
  • Ballot: A set of choices a voter is able to cast.
  • Time: The time span during which valid votes can be taken into account. After this period the election will be closed.

The first step involved deciding on  a suitable blockchain on which  this sort of  voting system can be realized as a smart contract. We decided to go with the Ethereum testnet, as the Ethereum Blockchain is able to fulfill our needs, plus Blockchain Consulting already had experience with coding smart contracts on this blockchain (Cf. Report about Hashrate Token).

The voting application was developed on an Ethereum testnet called “Polygon”. Polygon is a framework for Ethereum-based smart contract developers. (Bhalla, n.d.) By using Polygon you are able to launch your own Blockchain, which has all the advantages of the Ethereum Blockchain, as it communicates with the legacy Blockchain by interoperability. Having your own Blockchain for a voting process has the big advantage of using a sandboxed environment. Additionally, you gain all the advantages of Ethereum. The user authentication will be done by metamask. Metamask is an application through a compatible web browser. It allows users to store and manage account keys and to process transactions on Ethereum based cryptocurrencies and tokens, which is important because smart contracts run on Ethereum.

The ballot is the atomic unit in this system and contains the following parameters:

  • The name of the election
  • A unique identifier
  • End of the voting time frame
  • One or more choices by the voter. The issuer decides how many votes can be cast.

The voting smart contract contains the following functions

  • Vote: This function represents the voting process itself.
  • Results: Shows the results of the election.
  • addVoters: Voters can be added to the election with their wallet address 
  • createBallot: Ballots will be created after all participants are in place.
  • getBallot: See the anonymized results of a ballot
Fig. 1: Structure of the smart contract and its containing functions

Practical usage

This is clearly a very centralized voting application, which is acceptable because for now it is only used for in-house purposes. The polls are issued by our HR department. 

It works as described in the following:

Fig. 2: Workflow of an election

The issuer decides the name of the election and its ending date.

Fig. 3: Dashboard and creation of an election

The issuer then writes down the voting choices. Then the issuer decides who is allowed to vote in this particular election by adding their wallet addresses.

Fig. 4: Creation of a Ballot

All eligible voters are now able to vote and write their choice into the smart contract. All these processes will be stored on the Blockchain and are therefore resistant to fraud.

Our developers designed a clear User interface, so the process looks more like a vote and not like a transaction.

Once the vote is over  or every voter has used the token provided, all votes are counted and it becomes clear which option is preferred and by how many.

Fig. 5: Voting dashboard

Further developments

The voting application is still a prototype and under active development. It may seem simple and almost basic, but that’s certainly not the case. The application so far has strengthened our understanding of blockchain technology and allowed employees from all departments to use a smart contract, get accustomed to metamask and complete a transaction on the blockchain. As a company from the blockchain space it seemed just right to offer a voting system like this. 

Furthermore, our developers get to think more deeply about the problems of voting privacy, how to address them and find a solution that is secure and widely accepted. There is still a long way to go but the first steps have been taken and our goal is to finalize the first version for the market soon.

Bibliography

Anzalone, R. (2020, 04 29). Utah Republican Convention Uses Blockchain Voting Service. Utah Republican Convention Uses Blockchain Voting Service. https://www.forbes.com/sites/robertanzalone/2020/04/29/utah-republican-convention-uses-blockchain-voting-service/

Bhalla, A. (n.d.). What is Polygon MATIC? How does Polygon work? What is Polygon MATIC? How does Polygon work? https://www.blockchain-council.org/ethereum/what-is-polygon-matic-how-does-polygon-work/

Mapperson, J. (2020, 11 05). CZ and Vitalik agree blockchain-based voting is a must. CZ and Vitalik agree blockchain-based voting is a must. https://cointelegraph.com/news/cz-and-vitalik-agree-blockchain-based-voting-is-a-must

]]>
Cryptocurrency Blockchain Explorer https://bcc-munich.com/insight/report-block-explorer/ Thu, 09 Sep 2021 13:41:25 +0000 https://bcc-munich.com/?post_type=us_portfolio&p=4487

Abstract

Our client, a hedge fund specializing in energy and commodity trading, needed our help with a demanding migration project. They wanted to expand their trading operations to cryptocurrencies. Our task was to design and implement a solution that would improve their analysis processes.

In order to monitor and query data from the blockchain with the highest possible performance, a tailor-made Blockexplorer was required, as most functionalities are not covered by public Block Explorers.

Requirements engineering

Our client wanted to focus on six coins and consequently, six blockchains. Due to the rapidly evolving nature of cryptocurrency markets we were facing a tight timeline.

The six blockchains and the corresponding algorithms were:

  • Bitcoin (SHA256)
  • Bitcoin Cash (SHA256)
  • Litecoin (Scrypt)
  • Ethereum (Ethereum)
  • Monero (Cryptonight)
  • Zcash (Equihash)
  • Dash (X11)

Another requirement was to implement  calculations and estimations based on blockchain parameters such as the difficulty, the hashrate and having an address watching feature.

Market analysis

A Block Explorer is not an entirely new tool, and there are already multiple Block Explorers on the market.

  • Blockexplorer.com (Bitcoin)
  • Etherscan (Ethereum)
  • CryptoID (DASH)

These Block Explorers could have delivered the needed base data sets, but a deep analysis revealed the following downsides:

  • Heterogeneous programming interfaces of each Block Explorer.
  • Rate limits for requesting data
  • No proof that the retrieved data is correct due to lack of access to the Blockchain Nodes

If our client had  decided to use existing Block Explorers and their data, we would have had to program our own software which provides a homogeneous interface to all blockchains.

After comparing both possibilities, the client decided to request a customized, trusted Block Explorer.

Development process of the Block Explorer

Fig. 1: Development phases of the Block Explorer

Following this, we split the project into three phases (ct. Fig. “Development Phases”):

  • Construction of a prototype
  • Addition of advanced features to the existing prototype
  • Transition of the prototype to a system ready for production

During the prototype phase our focus lay on the infrastructure and building the architecture. We needed to consider the fact that Blockchain clients are frequently  updated by their respective developers.

These Blockchain clients, which represent the basic backbone of the application, must be updated as soon as a new release is available. This is challenging because new versions are released frequently, and often at short notice. To minimize potential sources of error, we designed the Block Explorer in such a way that it does not rely on additional external sources. It relies directly on blockchain nodes to provide blockchain data. The correct operation was ensured by monitoring all nodes permanently. For this first phase, we involved software developers and a senior technical architect. After we considered different possible base architectures, we decided to go with a microservice architecture based on the containerization of each microservice.

In the next step we focused on stable and correct data acquisition and transfer from the different blockchains. We also implemented features to process data, meaning  analytical visualizations such as charts or graphs can be shown to the stakeholders.

After it was ensured that the data was coming in and processed correctly, our designers and UI experts came on board.

Another task was to develop a User Interface based on the stakeholders’ analysis that was specifically customized to our client’s needs.

In addition, we also made sure the product has flexible interfaces that make it possible to link it to other systems. This was accomplished, as we managed a seamless integration into the customer’s existing ERP system.

Fig. 2: User Interface of the Block Explorer

The last phase of the project involved bringing the Block Explorer to a production-ready state. This included the ability of the services running to be replicated for gaining high availability, and ensuring the IT security of the product by executing an external audit by a third party company.

During all phases the team worked very closely with the client’s IT team to ensure their ability to maintain the Block Explorer after we delivered it.

The result of the architecture is shown in the following figure:

Fig. 3: Architecture of the Block Explorer

Customized features of the Block Explorer

The client wanted  to be able to implement a new blockchain anytime.  We were able to fulfill this request in a very short time, due to the architecture design we chose initially. In addition, the interfaces were able to show the results of the newly added blockchain directly and thus provide integration into the existing systems. This was all made possible without further effort due to the self-developed, uniform data structure and an excellent  understanding of our client’s requirements and the technology.

Another special extension that was requested much later in the development process was the address-watching-feature. The purpose of this extension was to allow the user to monitor certain wallets or transactions, and the blockchain.

A special feature that wasn’t even requested at the time, but was realized later due to the chosen architecture was the fact that any situation from the past can be used and simulated again in models. The data is on the blockchain and the Block Explorer provides the exact data in the specific interval desired by the client. This feature then became very useful for the client’s projecting models.

In the end, the Block Explorer became a general source of data, used for purposes beyond what our client had initially requested.

Further fields of application

The initial purpose of developing the Block Explorer was analytical research, but we were able to utilize it for further projects too.  For instance, the Block Explorer could also be used for quality control purposes, because it allows for comparison between results and data from other external sources (such as  in the case of profitability calculators).

We can proudly say that mining farms are using the Block Explorer to monitor mining pools, too. Many more use cases are likely possible, we just haven’t thought of them – yet!

Authors: Raoul Andersson, Christopher Becker
Editorial: Mia Molnar, Thomas Liebberger, Anna Lauterjung

]]>
Hashrate Token Architecture https://bcc-munich.com/insight/hashrate-token-architecture/ Thu, 19 Aug 2021 11:19:37 +0000 https://bcc-munich.com/?post_type=us_portfolio&p=4239

Abstract

Our client, a leading hashpower provider in the crypto mining business, sought to tokenize hashpower and offer it to over 2,000,000 customers worldwide

The client requested a comparison between classic cloud mining products and this new concept of a hashrate token. Additionally, they asked us to develop an architecture concept for said token

Market Analysis

The first step was to conduct some market research. We discovered two existing products that were relevant for our case, and we proceeded to analyze them:

  • Bitcoin Standard Hashrate Token (BTCST)
  • Blockchain Mining Unit (BMN)

We found that neither product was suitable for our client, due to differences in the target group they were designed for, and lack of transparency. Governance principles could also not be clearly identified. Additionally, it was unclear how the client could integrate their own business method of cloud plans into these tokens. Our findings led us to the conclusion that the best solution for our client’s needs is a tailor-made hashrate token.

Business Analysis

For the analysis of the hashrate token concept we worked closely together with the sales department of our client. In workshops we analyzed the structures of existing cloud mining products and the user experience for their entire life cycle.

Usually, a cloud mining plan is structured as follows:
The customer buys a fixed amount of hashpower at a fixed upfront price in form of a plan.

There are two options of carrying  out this  mining plan:

  • The plan ends after a fixed time period; the user gets their mining output only afterwards.
  • The runtime of the plan is not fixed; the end of the agreement is determined by the natural depreciation of the purchased hashrate.  As the runtime is unknown at the beginning, the maintenance fee cannot be calculated upfront, and therefore, the provider must  deduct a maintenance fee from the user’s daily payouts. Due to the hashrate depreciation, at a certain point the maintenance fee is comparatively  so high that the mining plan is unprofitable and ends automatically.

The profitability of mining, and therefore a mining plan, is determined mainly by these two factors: The price of the mined cryptocurrency and the network hashrate which is directly related Mining Difficulty.

Fig. 1: Working mechanism of cloud mining plans

Requirements Engineering

For this phase of the development we added software developers to our project team. We based the architecture of the hashrate token on the following functional requirements:

F1: Tradeability
F2: Ability to offer different batches of tokens
F3: A cost reduction of 25% compared to classic cloud mining plans
F4: The mapping of business logic of cloud mining contracts to smart contracts

Apart from the functional requirements, some non-functional ones were defined as well:

N1: Scalability
N2: Sustainability
N3: Deeply tested platform
N4: Low cost of issuing of the token

Infrastructure

A major challenge was the fact that smart contracts do not work on the Bitcoin blockchain, and it was not possible to create a token on the Bitcoin blockchain. However, our client required a solution where the token represented Bitcoin hashpower and the token holder would receive their rewards in Bitcoin.
Following this, we looked at blockchains that did allow smart contracts. The token itself does not produce hashrate which is used for Bitcoin mining, but in fact represents the hashpower produced by the corresponding ASIC miners. The distribution of BTC mining rewards must occur on the Bitcoin blockchain via a payout middleware. Therefore, the token (smart contract) could only represent the hashpower, which was actually mining Bitcoin.

Based on the requirements defined upfront, there were two possible ways to go. One possibility was to use the Flow Blockchain, which became very popular with the introduction of NFTs. The other choice was the classical Ethereum Blockchain, which is well-known in the crypto ecosystem. The first step in choosing the right platform was to evaluate both technologies.

The following table shows the differences between the Flow and the Ethereum Blockchain, on which the decision process for the infrastructure was based on: (PixelPlex, n.d.)

Table 1: Comparison of Ethereum and Flow

While Ethereum currently remains the standard blockchain for developing smart contracts, Flow was developed specifically for the needs of NFTs. Due to the broad number of use cases and the resulting popularity and “crowdedness”, the Ethereum system can become cumbersome and expensive.

Flow is a Proof-of-Stake (PoS) Blockchain and relies on a network of validators that can take on four different roles (Consensus Nodes, Verification Nodes, Execution Nodes, Collection Nodes). (Flow Primer, n.d.) The Flow Blockchain, compared to Ethereum, is a new system, so we cannot assume this technology will stay the way it is now.

Both systems have clear advantages which are useful for the token creation process. As the business logic of cloud mining plans is not complex (Cf. Fig. 1), it is possible to represent them in both Blockchains. In the end, the decision was made in favour of the Ethereum Blockchain. The reasons for this are the use of Solidity as a programming language, which is the de-facto standard for coding of smart contracts nowadays. The other reason is the broad acceptance of the Ethereum Blockchain within the crypto ecosystem as a standard platform for smart contracts. Additionally, the Ethereum ecosystem has a well-defined set of possible token standards, which can be used in the implementation of the hashrate token.

Token standard

Choosing the infrastructure also determined the token standard. The following table shows the different token standards that were taken into consideration:

Table 2: Comparison of Token Standards

Our team worked hand-in-hand with the client and came to the conclusion that ERC-20 was not the best standard that fit our goals. The ERC-20 token does not have a proof-of-ownership mechanism, and without that, the central purpose of a hashrate token could not be fulfilled. While ERC-721 fulfilled most of the requirements, at the end, we decided to base the architecture concepts on the ERC-1155 standard, because it allows creating multiple batches of tokens without requiring a new smart contract every time. Furthermore, the client and developers had the freedom to choose the fungibility suitable for the token. Additionally, the ERC-1155 requires less storage space in the network, which reduces the costs of issuing and transferring the hashrate token. This feature makes this product more appealing to possible customers and stakeholders.

Our client requested additional features such as a burning mechanism and a payout engine. The burning mechanism is responsible for ending a cloud mining plan. The event of a so-called “Token Burning” is monitored by a dedicated Ethereum Node which then triggers the Bitcoin payout process.

Throughout this process we worked closely with our client’s IT team and their sales department to ensure that we offer concepts based on our client’s expectations.
At the end, we were able to deliver three different concepts, and all of them met the client’s criteria and goals.

At the end of this process the following ERC-1155 based architecture was developed:

Fig. 2: Flow Diagram of the Hashrate Token

Our team worked hand-in-hand with the client and came to the conclusion that ERC-20 was not the best standard that fit our goals. The ERC-20 token does not have a proof-of-ownership mechanism, and without that, the central purpose of a hashrate token could not be fulfilled. While ERC-721 fulfilled most of the requirements, at the end, we decided to base the architecture concepts on the ERC-1155 standard, because it allows creating multiple batches of tokens without requiring a new smart contract every time. Furthermore, the client and developers had the freedom to choose the fungibility suitable for the token. Additionally, the ERC-1155 requires less storage space in the network, which reduces the costs of issuing and transferring the hashrate token. This feature makes this product more appealing to possible customers and stakeholders.

Our client requested additional features such as a burning mechanism and a payout engine. The burning mechanism is responsible for ending a cloud mining plan. The event of a so-called “Token Burning” is monitored by a dedicated Ethereum Node which then triggers the Bitcoin payout process.

Throughout this process we worked closely with our client’s IT team and their sales department to ensure that we offer concepts based on our client’s expectations.
At the end, we were able to deliver three different concepts, and all of them met the client’s criteria and goals.

At the end of this process the following ERC-1155 based architecture was developed:

Conclusion

Our evaluation provided the foundation for developing a hashrate token which was later published on the Ethereum Blockchain. This approach was built for Bitcoin, which is a Blockchain based on Proof-of-Work consensus. There is a possibility to extend the use case of a tokenwatched like this, and to also develop it for other blockchains that use different consensus mechanisms.

Authors: Christopher Becker, Raoul Anderson
Editorial: Mia Molnar, Thomas Liebberger, Anna Lauterjung

Bibliography

Entriken, W., Shirley, D., Evans, J., & Sachs, N. (2018, January). EIP-721: ERC-721 Non-Fungible Token Standard. Ethereum Improvement Proposals. Retrieved August 3rd, 2021, from https://eips.ethereum.org/EIPS/eip-721

Flow Primer. (n.d.). Multi-Node Architecture. Multi-Node Architecture. https://www.onflow.org/primer#primer-multinode

PixelPlex. (n.d.). Flow vs Ethereum. Which is Best for NFT Development? Flow vs Ethereum: the Ultimate Comparison of Blockchains and Their Programming Languages. Retrieved August 3rd, 2021, from https://pixelplex.io/blog/flow-vs-ethereum-comparison-best-platforms-for-nft/

Radomski, W., Cooke, A., Castonguay, P., Therien, J., Binet, E., & Sandfort, R. (2018, June). EIP-1155: ERC-1155 Multi Token Standard. Ethereum Improvement Proposals. Retrieved August 3rd, 2021, from https://eips.ethereum.org/EIPS/eip-1155

Srivastava, R. (2021, April 4th). Token Standards: ERC20 vs ERC721 vs ERC1155. Token Standards: ERC20 vs ERC721 vs ERC1155. Retrieved August 3rd, 2021, from https://medium.com/coinmonks/token-standards-erc20-vserc721-vs-erc1155-3106f1e3f2f3

Vogelsteller, F., & Buterin, V. (2016, November 20th). EIP-20: ERC-20 Token Standard. Ethereum Improvement Proposals. Retrieved August 3rd, 2021, from https://eips.ethereum.org/EIPS/eip-20

]]>