Category: Blockchain

  • Blockchain For Trade Finance

    Introduction

    The smooth functioning of international trade relies heavily on trade finance, which serves as a critical enabler for cross-border transactions. A wide range of essential financial instruments and products helps to facilitate the timely and efficient delivery of goods and services across international boundaries.

    However, traditional systems have long suffered from inefficiencies and complexities. For example, these outdated systems heavily rely on paper-based documentation, manual processes, and numerous intermediaries, leading to delays, high costs, and increased risks of fraud and errors.

    Blockchain brings a decentralized and transparent approach that has the potential to revolutionize how business owners participate in international trade. Smart contracts, for instance, leverage self-executing agreements written in code to automate and enforce contractual terms. By eliminating intermediaries, smart contracts streamline processes, reducing delays and costs while enhancing trust and security.

    Furthermore, by implementing a shared ledger system like blockchain among all counterparties, traders will have access to a reliable source of information. This will lead to a greater understanding of global trade and commodity availability, resulting in a more stable and predictable trading environment. It will prevent incidents like the “Great Grain Robbery,” where unknown deals and quantities caused significant disruptions. Additionally, enhanced data availability empowers traders involved in secondary market trading to make more precise and well-informed decisions. The transparent and immutable nature of blockchain ensures the integrity and accuracy of historical price data. This enables traders and finance professionals to identify chart patterns, optimize their strategies, and effectively mitigate risks, ultimately leading to improved trading outcomes.

    This transformative technology has the potential to simplify the challenges associated with international trade by digitizing trade-related documents. Rather than relying on physical paperwork and manual verification, digital storage and access provide a secure alternative. In addition to expediting the information flow, this digital transformation significantly minimizes the likelihood of errors, leading to a substantial improvement in overall operational efficiency.

    Blockchain-Based Trade Finance Solutions

    Blockchain technology has paved the way for innovative solutions and by leveraging the unique features of blockchain, several applications and platforms have emerged. Here are some of the key solutions offered:

    Enterprises embracing blockchain are actively striving to develop smooth and intuitive user experiences while simultaneously tackling the complexities of regulatory and legal requirements.

    Benefits of Using Blockchain in Trade Finance

    The integration of blockchain technology in international trade has a wide range of benefits, transforming the way businesses conduct international trade. Below are some of the key advantages of using blockchain in the industry:

    • Enhanced Transparency and Traceability
    • Streamlined Processes and Efficiency Gains
    • Improved Security and Fraud Prevention
    • Cost Reduction and Accessibility
    • Enhanced Trust and Collaboration
    • Real-time Data and Analytics

    The benefits for trade finance are clear, offering increased efficiency, security, transparency, and accessibility. As more organizations embrace blockchain technology, we can expect further innovation and refinements in trade finance processes, enabling businesses to thrive in the global marketplace.

    Potential Challenges and Considerations

    While the application of blockchain technology presents immense possibilities in revolutionizing global trade transactions, it also brings forth a host of challenges and factors that demand careful deliberation to ensure its widespread integration. Here are some crucial aspects that necessitate attention and resolution to facilitate seamless adoption:

    Regulatory and Legal Issues: The adoption of blockchain in international trade raises regulatory and legal considerations. Given the cross-border nature of blockchain operations involving multiple entities, it becomes imperative to establish a well-defined legal framework that effectively tackles concerns like jurisdiction, data privacy, and the resolution of disputes. To facilitate compliance and promote innovation within the realm of international trade, regulators must adapt and formulate comprehensive guidelines. Such measures will not only ensure adherence to legal obligations but also foster an environment conducive to the advancement of global trade.

    Adoption and Industry Collaboration: The successful adoption of blockchain in the context of international trade requires industry-wide collaboration and consensus. In order to drive progress in the realm of global trade transactions, it is imperative for a diverse array of stakeholders to join forces. This includes financial institutions, trade facilitators, governmental entities, and technology vendors, who must collaborate to lay the groundwork for shared standards, protocols, and exemplary approaches. Through synergistic cooperation, these collective endeavors can surmount obstacles to adoption, foster knowledge exchange, and fuel innovation, propelling the field of global trade transactions towards unprecedented growth and advancement.

    Security and Data Integrity: While blockchain technology offers enhanced security compared to traditional systems, it is not completely immune to cybersecurity threats. As blockchain networks grow, ensuring robust security measures to protect against hacking attempts, unauthorized access, and data breaches becomes imperative. Implementing strong encryption, access controls, and regular security audits are essential to maintain the integrity and confidentiality of data in global trade transactions on the blockchain.

    Addressing these challenges and considerations will be crucial to exploiting the full potential of blockchain technology in the realm of global trade. Through proactive collaboration, regulatory clarity, scalable solutions, and continuous education, the industry can overcome barriers and embrace the benefits, driving efficiency, transparency, and innovation in the world of international trade.

    Future of Blockchain In Trade Finance

    The future of blockchain is being sculpted by a multitude of emerging trends and innovations. Notably, the spotlight is on achieving interoperability among diverse blockchain platforms, facilitating smooth communication and collaboration across networks.

    The landscape of global transactions is on the brink of a transformative era fueled by the boundless potential and thrilling opportunities offered by blockchain-enabled. As this innovative technology continues to evolve and gain widespread acceptance, we can expect remarkable advancements and emerging trends to shape the industry’s future.

    The inherent characteristics of decentralization and transparency that define blockchain provide a sturdy foundation for secure and efficient processes. With growing awareness among key players such as financial institutions, governments, and technology providers, we anticipate an accelerated adoption and seamless integration of blockchain solutions across the realm of global transactions.

  • Blockchain Interview Questions

    Preface – This post is part of the Blockchain Basics series.

    Introduction

    Blockchain is a concept that has a list of records called blocks that store data publicly and in chronological order. In Blockchain, the Cryptography methodology is used to encrypt the information or data to ensure the privacy of the user.

    Blockchain is a combination of the following three important technologies:

    • Cryptographic keys
    • Peer-to-peer network
    • Digital ledger

    The various features of blockchain are:

    1. A public distributed ledger works use hashing encryption to encrypt information
    2. Every block within the blockchain has a hash value (generated everytime before the block is added), which is the digital signature of the block

    The most common uses of Blockchain are:

    • Original content creation
    • Real-time IoT operating system
    • Voting mechanism
    • Supply chain and logistics monitoring

    Blockchain is a technology emerging daily, and choosing a career in this field is a very good decision. In this blog, we will provide you most frequently asked questions related to blockchain in technical interview rounds. The industry experts repeatedly ask these questions of Top-notch companies.

    General Blockchain Interview Questions

    1. What do you know about blockchain?
    2. Explain the difference between Bitcoin blockchain and Ethereum blockchain.
    3. Explain the main principle of blockchain technology.
    4. What are the various types of blockchains?
    5. What are the main reasons for considering Blockchain a trusted approach?
    6. Name the types of records present in the blockchain database.
    7. Is there any difference lies in between block records and transactional records?
    8. What type of database is used by Blockchain?
    9. Explain the features/properties of Blockchain.
    10. Explain Encryption. What is the role of encryption in blockchain?
    11. What do you understand by blocks in blockchain technology?
    12. How will you recognize a block in a blockchain approach?
    13. Is it possible to modify the data once written in a block?
    14. Explain Block Identifiers.
    15. Can we remove one or more blocks from the network of blockchain?
    16. What do you know about the security of a block?
    17. Explain Merkle trees. What is the importance of Merkle trees in Blockchains?
    18. What is a ledger?
    19. Is Blockchain an incorruptible ledger?
    20. Name some common types of ledgers that users in blockchain consider.
    21. How is a blockchain ledger different from an ordinary one?
    22. What types of records are kept in a blockchain?
    23. What are the common types of records that are kept in the blockchain?
    24. What does the system rely upon when a distributed digital ledger is used to record blockchain transactions?
    25. Explain the components of the Blockchain Ecosystem.
    26. Highlight some differences between proof-of-work and proof-of-stake.
    27. Name some popular platforms that are used for developing blockchain applications.
    28. Explain Double spending.
    29. Is it possible for a user to double spend in a Blockchain system?
    30. Explain some benefits of Blockchain.
    31. What does a block of blockchain consists of?
    32. Name the first distributed blockchain implementation.
    33. Bitcoin belongs to which type of Blockchain?
    34. How can we store Blockchain as a flat file, a database, or both?
    35. How are blocks linked in a blockchain?
    36. What is the primary benefit of immutability?
    37. Is a block in the blockchain possible to have more than one parent?
    38. What is the result of blockchain forks?
    39. Name one symmetric encryption algorithm.
    40. Explain decentralized network in the blockchain.

    Advanced level Blockchain Interview Questions

    1. Name some widely used cryptographic algorithms.
    2. Explain the RSA algorithm and highlight the security of this algorithm.
    3. Highlight some significance of the blind signature.
    4. What is secret sharing?
    5. Explain off-chain transactions.
    6. What do you know about executive accounting?
    7. What are the threats to the information with which users are familiar?
    8. What will be your approach in handling the risk management when it comes to securing the transaction records?
    9. Does secret sharing have any benefit in blockchain technology?
    10. Does Blockchain support executive accounting?
    11. What do you understand by 51% attack?
    12. What are the various challenges an organization faces due to information leaks?
    13. Explain information processing according to you.
    14. What are the key challenges associated with information processing?
    15. What are the core requirements for a business Blockchain?
    16. Name the principles of Blockchain that help eliminate security threats.
    17. Explain security policy.
    18. List some of the popular consensus algorithms.
    19. Name the steps that must be followed in the Blockchain project implementation.
    20. What is the need for different consensus mechanisms?
    21. Explain a real-life use-case example where Blockchain is being used.
    22. What is the Genesis Block?
    23. Explain the purpose of the Blockchain node.
    24. Why does Blockchain need coins or tokens?
    25. What is the reason behind a fixed supply of bitcoins?
    26. How do verifiers check if a block is valid or not?
    27. Explain Decentralised application.
    28. Define a smart contract.
    29. Explain the trapdoor function.
    30. What is the importance of the trapdoor function in blockchain development?
    31. Explain mining difficulty.
    32. Explain what a target hash is.
    33. Define stealth address.
    34. Compare PoW and PoS.
    35. Is it possible to brute force bitcoin address creation to steal money?
    36. Explain Double spending.
    37. Define smart contracts and their applications.
    38. Where do nodes run a smart contract code?
    39. Name the very first thing you must specify in a Solidity file.
    40. Explain the term ‘Nonce’ and how it is used in mining.
    41. What do you understand about Coinbase transactions?
    42. What do you think about the future of blockchain?
    43. List some demerits of Blockchain.
    44. Explain the use of cryptographic algorithms in blockchain with the help of an example.
    45. Which cloud computing platform is used for hosting an enterprise blockchain network?
    46. Give one example of a smart contract verification tool.
    47. Explain “Gas” on Ethereum.
    48. Explain how you will deploy and develop an Ethereum smart contract using the Ethereum ecosystem tools.
    49. Explain how you will deploy Ethereum smart contract on Hyperledger Fabric.
    50. How will you create a blockchain application using Node.js?
    51. Make some comparisons between ScriptPubKey and P2SH addresses.
    52. Compare and contrast centralized, decentralized, and distributed ledgers.

     

  • Create Object History in SAP Blockchain

    Preface – This post is part of the Blockchain on SAP Cloud Platform and ABAP Programs series.

    In this article, we will learn how to create a block in Blockchain on the SAP Cloud Platform.

     METHOD create_object_history.
        DATA: lo_http_client TYPE REF TO if_http_client.
        DATA: response TYPE string,
              lv_url   TYPE string,
              lv_auth  TYPE string.
        CONSTANTS : lv_initial_url TYPE string VALUE '<Your_Service>'.
    
        IF iv_object_id IS NOT INITIAL.
    *** Getting Token
          TYPES:
            BEGIN OF t_entry,
              access_token TYPE string,
              token_type   TYPE string,
              expires_in   TYPE n LENGTH 8,
              scope        TYPE string,
              jti          TYPE string,
            END OF t_entry .
          TYPES:
            t_entry_map TYPE SORTED TABLE OF t_entry WITH UNIQUE KEY access_token.
          DATA: m_entries TYPE t_entry.
    
          DATA: lr_instance  TYPE REF TO  /ui5/cl_json_parser.
          CREATE OBJECT lr_instance.
          CALL METHOD me->get_token.
          IF gv_token IS NOT INITIAL.
    
            /ui2/cl_json=>deserialize(
            EXPORTING json = gv_token pretty_name = /ui2/cl_json=>pretty_mode-camel_case CHANGING data = m_entries ).
            DATA lv_auth2 TYPE string.
            lv_auth2 = m_entries-access_token.
    *        gv_token = gv_token+17.
    
            CONCATENATE 'Bearer' lv_auth2 INTO lv_auth SEPARATED BY space.
    
          ENDIF.
          DATA lv_object_id TYPE string.
          lv_object_id = iv_object_id.
          TRANSLATE lv_object_id TO LOWER CASE.
    
          CONCATENATE lv_initial_url lv_object_id INTO lv_url. "Appending Fix URL and the Object ID to get the Request URL
    
          "create HTTP client by url
          CALL METHOD cl_http_client=>create_by_url
            EXPORTING
              url                = lv_url
            IMPORTING
              client             = lo_http_client
            EXCEPTIONS
              argument_not_found = 1
              plugin_not_active  = 2
              internal_error     = 3
              OTHERS             = 4.
    
          "Available API Endpoints
          "https://blockchain-service.cfapps.sap.hana.ondemand.com/blockchain/proofOfHistory/api/v1
          "https://blockchain-service.cfapps.eu10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
          "https://blockchain-service.cfapps.us10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
    
          IF sy-subrc <> 0.
            "error handling
          ENDIF.
    
          "setting request method
          lo_http_client->request->set_method('POST').
    
          "adding headers
          lo_http_client->request->set_header_field( name = 'Content-Type' value = 'application/x-www-form-urlencoded' ).
          lo_http_client->request->set_header_field( name = 'Accept' value = 'application/json' ).
          lo_http_client->request->set_header_field( name = 'Authorization' value = lv_auth ).
    
          "Available Security Schemes for productive API Endpoints
          "OAuth 2.0
    
          CALL METHOD lo_http_client->send
            EXCEPTIONS
              http_communication_failure = 1
              http_invalid_state         = 2
              http_processing_failed     = 3
              http_invalid_timeout       = 4
              OTHERS                     = 5.
    
          IF sy-subrc = 0.
            CALL METHOD lo_http_client->receive
              EXCEPTIONS
                http_communication_failure = 1
                http_invalid_state         = 2
                http_processing_failed     = 3
                OTHERS                     = 5.
          ENDIF.
    
          IF sy-subrc <> 0.
            "error handling
            response = lo_http_client->response->get_cdata( ).
            ev_response = response.
          ELSE.
            response = lo_http_client->response->get_cdata( ).
            IF response IS NOT INITIAL.
              ev_response = response.
            ELSE.
              ev_response = 'Block created successfully'.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDMETHOD.
    

     

  • Get Proof history from the Blockchain Service using SAP ABAP

    Preface – This post is part of the Blockchain on SAP Cloud Platform and ABAP Programs series.

    In this step, we will call the blockchain service again using the token that we have stored in above step. And then we will receive the history of transactions from blockchain.

    METHOD get_proof_history.
        DATA: lo_http_client TYPE REF TO if_http_client.
        DATA: response TYPE string,
              lv_url   TYPE string,
              lv_auth  TYPE string,
              lv_auth2 TYPE string.
        CONSTANTS : lv_initial_url TYPE string VALUE '<Your Service>'.
        IF iv_object_id IS NOT INITIAL.
    *** Getting Token
          TYPES:
            BEGIN OF t_entry,
              access_token TYPE string,
              token_type   TYPE string,
              expires_in   TYPE n LENGTH 8,
              scope        TYPE string,
              jti          TYPE string,
            END OF t_entry .
          TYPES:
            t_entry_map TYPE SORTED TABLE OF t_entry WITH UNIQUE KEY access_token.
          DATA: m_entries TYPE t_entry.
          DATA: lr_instance  TYPE REF TO  /ui5/cl_json_parser.
          CREATE OBJECT lr_instance.
          CALL METHOD me->get_token.
          IF gv_token IS NOT INITIAL.
    *        data: itab TYPE TABLE OF string.
    *        data: access_tok type string.
    *        SPLIT gv_token at '"' INTO TABLE itab.
    *        try.
    *            lv_auth2 = itab[ 4 ].
    *          catch cx_sy_itab_line_not_found.
    *        ENDTRY.
            /ui2/cl_json=>deserialize(
            EXPORTING json = gv_token pretty_name = /ui2/cl_json=>pretty_mode-camel_case CHANGING data = m_entries ).
            lv_auth2 = m_entries-access_token.
            gv_token = gv_token+17.
            CONCATENATE 'Bearer' lv_auth2 INTO lv_auth SEPARATED BY space.
          ENDIF.
          DATA lv_object_id TYPE string.
          lv_object_id = iv_object_id.
          TRANSLATE lv_object_id TO LOWER CASE.
          CONCATENATE lv_initial_url lv_object_id INTO lv_url. "Appending Fix URL and the Object ID to get the Request URL
          "create HTTP client by url
          CALL METHOD cl_http_client=>create_by_url
            EXPORTING
              url                = lv_url
            IMPORTING
              client             = lo_http_client
            EXCEPTIONS
              argument_not_found = 1
              plugin_not_active  = 2
              internal_error     = 3
              OTHERS             = 4.
          "Available API Endpoints
          "https://blockchain-service.cfapps.sap.hana.ondemand.com/blockchain/proofOfHistory/api/v1
          "https://blockchain-service.cfapps.eu10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
          "https://blockchain-service.cfapps.us10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
          IF sy-subrc <> 0.
            "error handling
          ENDIF.
          "setting request method
          lo_http_client->request->set_method('GET').
          "creatung Auth value
    *       lv_auth2 = 'Basic <Your Login Credentials>'.
          "adding headers
    *      lo_http_client->request->set_header_field( name = 'Content-Type' value = 'application/x-www-form-urlencoded' ).
          lo_http_client->request->set_header_field( name = 'Accept' value = 'application/json' ).
          lo_http_client->request->set_header_field( name = 'Authorization' value = lv_auth ).
    *      lo_http_client->request->set_header_field( name = 'APIKey' value = 'zBoCpDtkaT9jexRjtMk0J98Rs8izmQi1' ).
          "Available Security Schemes for productive API Endpoints
          "OAuth 2.0
          CALL METHOD lo_http_client->send
            EXCEPTIONS
              http_communication_failure = 1
              http_invalid_state         = 2
              http_processing_failed     = 3
              http_invalid_timeout       = 4
              OTHERS                     = 5.
          IF sy-subrc = 0.
            CALL METHOD lo_http_client->receive
              EXCEPTIONS
                http_communication_failure = 1
                http_invalid_state         = 2
                http_processing_failed     = 3
                OTHERS                     = 5.
          ENDIF.
          IF sy-subrc = 1.
            "error handling
            ev_response = 'http_communication_failure'.
          ELSEIF sy-subrc = 2.
            ev_response = 'http_invalid_state'.
          ELSEIF sy-subrc = 3.
            ev_response = 'http_processing_failed'.
          ELSEIF sy-subrc = 0.
            response = lo_http_client->response->get_cdata( ).
    *WRITE: 'response: ', response.
            ev_response = response.
          ELSE.
            ev_response = 'Unknown Error'.
          ENDIF.
        ENDIF.
      ENDMETHOD.

     

  • Blockchain Implementation in ABAP

    Preface – This post is part of the Blockchain on SAP Cloud Platform series.

    Introduction

    With the introduction of Blockchain in SAP Cloud Platform, the important questions for SAP developers was its implementation in SAP ABAP. All the client information of SAP is mainly on premise based. The major amount of data is already stored in backend system and if we cannot push this data on blockchain then the Blockchain on SAP Cloud Platform is of no use. In this article we will explain the Blockchain Implementation in ABAP.

    Blockchain on SAP Cloud Platform

    In our previous articles we have already explained the blockchain services (mainly Hyperledger, Multichain and Quorum) on SAP Cloud Platform. These instances are connected with SAP Blockchain enablement services, which acts as an interface between these blockchain services and other SAP services.

    Blockchain Implementation in ABAP

    We can easily understand the blockchain implementation in ABAP using the given block diagram:

    Blockchain Implementation in ABAP

    In the diagram above, you can see that the SAP ABAP interacts with Blockchain Enablement services and the HANA Database. This application can be either displayed using Classical ABAP Report or using Fiori Application which will then use OData to interact with SAP ABAP methods.

    To call any service in SAP Cloud platform, we need to do the following:

    1. Get Token from the service using a read call.
    2. Perform CRUD operation on the service using the token received above.

    Let us understand these steps with respect to the blockchain services.

    Get Token from the Blockchain Service

    In this step we will call the service to get the token and store that token in a global variable for later use.

    METHOD get_token.
        DATA: lo_http_client TYPE REF TO if_http_client.
        DATA: response TYPE string,
              lv_url   TYPE string.
        CONSTANTS: lv_initial_url TYPE string VALUE '<Blockchain Service Link>',
                   lv_auth        TYPE string VALUE 'Basic <your login credentials>'.
    
    
        "create HTTP client by url
        CALL METHOD cl_http_client=>create_by_url
          EXPORTING
            url                = lv_initial_url
          IMPORTING
            client             = lo_http_client
          EXCEPTIONS
            argument_not_found = 1
            plugin_not_active  = 2
            internal_error     = 3
            OTHERS             = 4.
    
        "Available API Endpoints
        "https://blockchain-service.cfapps.sap.hana.ondemand.com/blockchain/proofOfHistory/api/v1
        "https://blockchain-service.cfapps.eu10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
        "https://blockchain-service.cfapps.us10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
    
        IF sy-subrc <> 0.
          "error handling
        ENDIF.
    
        "setting request method
        lo_http_client->request->set_method('GET').
    
        "adding headers
        lo_http_client->request->set_header_field( name = 'Authorization' value = lv_auth ).
    
    
        "Available Security Schemes for productive API Endpoints
        "OAuth 2.0
    
        CALL METHOD lo_http_client->send
          EXCEPTIONS
            http_communication_failure = 1
            http_invalid_state         = 2
            http_processing_failed     = 3
            http_invalid_timeout       = 4
            OTHERS                     = 5.
    
        IF sy-subrc = 0.
          CALL METHOD lo_http_client->receive
            EXCEPTIONS
              http_communication_failure = 1
              http_invalid_state         = 2
              http_processing_failed     = 3
              OTHERS                     = 5.
        ENDIF.
    
        IF sy-subrc <> 0.
          "error handling
        ENDIF.
    
        response = lo_http_client->response->get_cdata( ).
    
       GV_TOKEN = response. "Global Variable
      ENDMETHOD.

     

    Get Proof history from the Blockchain Service

    In this step we will call the blockchain service again using the token that we have stored in above step. And then we will receive the history of transactions from blockchain.

    METHOD get_proof_history.
        DATA: lo_http_client TYPE REF TO if_http_client.
        DATA: response TYPE string,
              lv_url   TYPE string,
              lv_auth  TYPE string,
              lv_auth2 TYPE string.
    
        CONSTANTS : lv_initial_url TYPE string VALUE '<Your Service>'.
    
        IF iv_object_id IS NOT INITIAL.
    
    *** Getting Token
          TYPES:
            BEGIN OF t_entry,
              access_token TYPE string,
              token_type   TYPE string,
              expires_in   TYPE n LENGTH 8,
              scope        TYPE string,
              jti          TYPE string,
            END OF t_entry .
          TYPES:
            t_entry_map TYPE SORTED TABLE OF t_entry WITH UNIQUE KEY access_token.
          DATA: m_entries TYPE t_entry.
    
          DATA: lr_instance  TYPE REF TO  /ui5/cl_json_parser.
          CREATE OBJECT lr_instance.
          CALL METHOD me->get_token.
          IF gv_token IS NOT INITIAL.
    
    *        data: itab TYPE TABLE OF string.
    *        data: access_tok type string.
    *        SPLIT gv_token at '"' INTO TABLE itab.
    *        try.
    *            lv_auth2 = itab[ 4 ].
    *          catch cx_sy_itab_line_not_found.
    *        ENDTRY.
    
            /ui2/cl_json=>deserialize(
            EXPORTING json = gv_token pretty_name = /ui2/cl_json=>pretty_mode-camel_case CHANGING data = m_entries ).
            lv_auth2 = m_entries-access_token.
            gv_token = gv_token+17.
    
            CONCATENATE 'Bearer' lv_auth2 INTO lv_auth SEPARATED BY space.
    
          ENDIF.
          DATA lv_object_id TYPE string.
          lv_object_id = iv_object_id.
          TRANSLATE lv_object_id TO LOWER CASE.
    
          CONCATENATE lv_initial_url lv_object_id INTO lv_url. "Appending Fix URL and the Object ID to get the Request URL
    
          "create HTTP client by url
          CALL METHOD cl_http_client=>create_by_url
            EXPORTING
              url                = lv_url
            IMPORTING
              client             = lo_http_client
            EXCEPTIONS
              argument_not_found = 1
              plugin_not_active  = 2
              internal_error     = 3
              OTHERS             = 4.
    
          "Available API Endpoints
          "https://blockchain-service.cfapps.sap.hana.ondemand.com/blockchain/proofOfHistory/api/v1
          "https://blockchain-service.cfapps.eu10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
          "https://blockchain-service.cfapps.us10.hana.ondemand.com/blockchain/proofOfHistory/api/v1
    
          IF sy-subrc <> 0.
            "error handling
          ENDIF.
    
          "setting request method
          lo_http_client->request->set_method('GET').
    
          "creatung Auth value
    *       lv_auth2 = 'Basic <Your Login Credentials>'.
    
          "adding headers
    *      lo_http_client->request->set_header_field( name = 'Content-Type' value = 'application/x-www-form-urlencoded' ).
          lo_http_client->request->set_header_field( name = 'Accept' value = 'application/json' ).
          lo_http_client->request->set_header_field( name = 'Authorization' value = lv_auth ).
    *      lo_http_client->request->set_header_field( name = 'APIKey' value = 'zBoCpDtkaT9jexRjtMk0J98Rs8izmQi1' ).
    
    
          "Available Security Schemes for productive API Endpoints
          "OAuth 2.0
    
          CALL METHOD lo_http_client->send
            EXCEPTIONS
              http_communication_failure = 1
              http_invalid_state         = 2
              http_processing_failed     = 3
              http_invalid_timeout       = 4
              OTHERS                     = 5.
    
          IF sy-subrc = 0.
            CALL METHOD lo_http_client->receive
              EXCEPTIONS
                http_communication_failure = 1
                http_invalid_state         = 2
                http_processing_failed     = 3
                OTHERS                     = 5.
          ENDIF.
    
          IF sy-subrc = 1.
            "error handling
            ev_response = 'http_communication_failure'.
          ELSEIF sy-subrc = 2.
            ev_response = 'http_invalid_state'.
          ELSEIF sy-subrc = 3.
            ev_response = 'http_processing_failed'.
          ELSEIF sy-subrc = 0.
            response = lo_http_client->response->get_cdata( ).
    *WRITE: 'response: ', response.
            ev_response = response.
          ELSE.
            ev_response = 'Unknown Error'.
          ENDIF.
        ENDIF.
      ENDMETHOD.

     

  • R3 Corda Platform Introduction

    Preface – This post is part of the Blockchain Basics series.

    Introduction

    Corda is an open source private blockchain platform, introduced by R3 that integrates the existing proven technologies such as relational database, Java Machine (JVM) in blockchain for ERP and business solutions.

    Corda has published a whitepaper to discuss the underline technologies; you can read the Corda: A distributed ledger Whitepaper here.

    How R3 Corda Works

    In Corda network, a node firstly undergoes a KYC process to obtain identity certificate. When this node joins the network, they publish this certificate including their legal name, their IP address, public key and some other information. Then the nodes communicate point-to-point using TLS encrypted messaging.

    R3 Corda Use Cases

    R3 Codra is one of the most used Enterprise based blockchain network. Following are some of the common use cases:

    1. International Bank Transaction

    To implement cross border payment without any third party involvement, a bank can use R3 Corda based network to implement it.

    1. Construction Industry

    To share information between multiple sub-contractors, we can submit the information related to construction on Corda Blockchain.

    1. Healthcare Industry

    Healthcare Industry has following two possible use cases to implement blockchain:

    1. Health records exchange
    2. Health Claims management

    Merits of Corda Blockchain

    Following are the merits of Corda Blockchain Network:

    1. Privacy
    2. Agile and flexible
    3. Interoperability
    4. Open development
    5. Open design

    Demerits of Corda Blockchain

    Following are the demerits of Quorum blockchain:

    1. Anonymity
    2. Questionable affair for many companies
  • Quorum Introduction

    Preface – This post is part of the Blockchain Basics series.

    Introduction

    Quorum is a private and permissioned blockchain developed on top of Go and Ethereum technology mainly for Enterprise based solution. An Ethereum is a decentralized platform which is used to run smart contracts. In this Quorum Introduction we will explore more about it.

    Quorum has its Whitepaper published here. Apart from Quorum Introduction, it discusses the core architecture and end to end implementation of Quorum technology.

    How Quorum Works

    Quorum Application are based on three layered structure. The initial layer is the go-Ethereum where all the transaction happens. The second layer is of Quorum where all the logics are implemented which also includes Transaction Manager, Crypto Enclave, consensus and network manager. The last layer includes the distributed blockchain applications.

    Quorum Use Cases

    With its permissioned blockchain paradigm, Quorum can be implemented easily in given use cases:

    1. Financial Applications

    To ensure the transactions between two parties and two financial institutions are secure, private and not revealed to any other financial institutions, then implementing it via a permissioned network like Quorum is a right decision. Quorum supports both client privacy as well as meet legal and regularity requirements.

    1. Payment Applications

    To implement payment across various parties based on various pre-defined conditions might include the implementation of smart contracts. The use of Quorum network helps us to implement the transaction on a common protocol.

    Merits of Quorum Blockchain

    Following are the merits of Quorum blockchain:

    1. Private and Permissioned Network
    2. Alternative Consensus Mechanism
    3. Peer permissioning
    4. Higher performance

    Demerits of Quorum Blockchain

    Following are the demerits of Quorum blockchain:

    1. Anonymity
    2. Questionable affair for many companies
  • Multichain Introduction

    Preface – This post is part of the Blockchain Basics series.

    Introduction

    Multichain is off-the-shelf private blockchain platform developed primarily for institutional financial sectors. It provides privacy, openness and control to the network administrator (that can be either miner of the first “genesis” block or a predefined miners set as Admin by previous Admin). Multichain has published a whitepaper to discuss the underline technologies; you can read the Multichain Private Blockchain Whitepaper here. In this article we will explore the Multichain Introduction with some of its use cases.

    How Multichain Works

    In a Multichain bases blockchain network, the administrator grants privileges to other users in the network. The mining (block validation) in a Multichain is just like a round robin schedule, which means each miner/user in the network must create blocks in rotation to generate an authentic blockchain.

    Multichain Use Cases

    Multichain is one of the widely used blockchain technologies that are being utilized by enterprises and small industries. Following are some of the accepted use cases by Multichain:

    1. Centralized Currency Settlement System

    This is a very generic use case where all the currency exchange system can be scrutinized under blockchain methodology.

    1. Bond Issuance System

    Issuance of bond in a systematic manner becomes a tedious job. Multichain can become a secure solution to this problem.

     

    1. Peer-to-peer Trading System

    Stock trading is not a peer-to-peer system but it can be like bitcoin trading system. This can be easily achieved with the help of Multichain.

     

    1. Consumer facing reward scheme

    It is also a generic scenario where blockchain can be used to win trust and bring fair results in the reward scheme.

     

     

    Merits of Multichain Blockchain

    Multichain Introduction on top of Bitcoin brings following merits:

    • Unlimited capacity
    • Very less or no transaction cost (based on subscription)
    • Relevant Data storage
    • Reduced Mining risks
    • Higher privacy features
    • Openness

    Demerits of Multichain Blockchain

    Although Multichain provides additional features on top of Bitcoin and is better than many permissioned blockchain technology, still it comes with following demerits:

    • No support to smart contracts
    • Typical consensus mechanism
  • Hyperledger Introduction

    Preface – This post is part of the Blockchain Basics series.

    Introduction

    In 2015, many corporations came along and created an open source blockchain platform beneath the guardianship of Linux Foundation and named it Hyperledger. Hyperledger, since then, has evolved a lot. It’s launched multiple frameworks and tools for the same. Among them Hyperledger Fabric is that the most suited framework for Enterprise. Hyperledger provides various industry ready blockchain frameworks and tools that are unique in terms of use and implementation. In this Hyperledger Introduction article we will learn some of the basics related to it.

    Hyperledger Frameworks Introduction

    Based on different business and enterprise scenarios, multiple Hyperledger frameworks were developed. These are as follows:

    Hyperledger Burrow

    It utilizes permissioned Smart Contracts methodology based upon Ethereum Virtual Machine (EVM).

    Hyperledger Fabric

    Hyperledger Fabric is the most stable platform by Hyperledger. It is mostly suitable for business applications. It uses components (consensus and membership services) in form of plug-and-play. It deploys business rules in smart contracts also known as “chaincode”.

    Hyperledger Indy

    It is a framework developed and designed solely for distributed identity.

    Hyperledger Iroha

    It is a blockchain framework designed in such a way that it can be incorporated in infrastructure projects easily.

    Hyperledger Sawtooth

    It is a blockchain framework that keeps the platform highly modular such that the enterprise and consortium can make their own decisions about their blockchain applications.

    Hyperledger Tools Introduction

    We have already discussed various blockchain frameworks provided by Hyperledger. In this section we will discuss various tools provided by Hyperledger that can be used by the frameworks.

    Hyperledger Caliper

    It is a blockchain tool to measure the performance of any blockchain by using set of predefined use cases.

    Hyperledger Cello

    It is a blockchain tool to bring on-demand deployment model to the blockchain ecosystem.

    Hyperledger Composer

    It is a blockchain tool which is used to make development of blockchain application easier.

    Hyperledger Explorer

    It is a dashboard which gives information on the network, blocks, node logs, smart contracts and transaction.

    Hyperledger Quilt

    It is a tool to implement ILP i.e. Interledger Protocol which is a payment protocol for Blockchain technology.

    Hyperledger Whitepaper

    Hyperledger has published several whitepapers to discuss the underline technologies; you can read the Introduction to Hyperledger here.

  • Consensus Mechanism

    Preface – This post is part of the Blockchain Basics series.

    Introduction

    The literal meaning of consensus is “A general agreement” which means a consensus for a Blockchain is a mechanism of validating transaction before pushing it into a block, based on general agreement. The common example of agreement can be seen in bitcoin where it is required to have miner’s agreement of more than 51%. Consensus mechanism used in bitcoin is Proof of Work.

    For example, Gargi sends $100 worth of Bitcoin to Rudra, Gargi will lose 100$ worth of Bitcoin from her wallet, and Rudra will gain 100$ worth of Bitcoin in his wallet. But it must be validated and verified that if Gargi actually had 100$ worth Bitcoin in her account or not. This is validated by the miners in the Blockchain and if more that 51% miners agreed upon this transaction, then only the transaction will be validated.

    There are several ways to reach on a consensus technically, we’ll discuss the few and wide used agreement mechanisms:

    Proof of Work (PoW)

    The process of finding nonce is available for everyone and it will be achieved earlier by the one who has better computational power (because of higher probability to guess). This way of corroborating a block in Blockchain where the work (here guessing a nonce) is taken into account as a signal of validation is termed as Proof-of-Work. This mechanism is employed in Blockchain based cryptocurrencies like Bitcoin.

    Proof of Stake (PoS)

    The process of finding nonce is achieved earlier by the one who has better computational power. This could end in a monopoly of wealth and will lead the monopoliser to impose conditions on the remainder of network. And if this monopoliser has malicious intentions, then it could lead low confidence in Bitcoin. To overcome this issue, an agreement mechanism was designed in such a way that the forger/validator can keep associated quantity of crypto currency as a stake and will be probabilistically appointed an opportunity to be the one validator and build new blocks. This too provides a monopoly to rich as they could stake more and will have high probability to become validator. As stake can be confiscated if dishonourable validation unit are created, hence it seems safer than PoW. This mechanism is employed in Dash, NEO and PIVX.

    Proof of Elapsed Time (PoET)

    In 2016, Intel observed the difficulty of terribly high resource utilization and energy consumption in current agreement mechanisms. To solve this issue and serve the aim “cost should stay proportional to the worth derived from the process”, Intel brought Proof of Elapsed Time. In this paradigm, each participating node of a permissioned Block within the Blockchain are assigned random waiting time. The one with lowest waiting time wins the chance to become a validator. This is more like a lottery type. This mechanism is used in Hyperledger.