SlideShare a Scribd company logo
IT R&D & Innovation / Blockchain Manager
Blockchain in the Business API Ecosystem:
API Consumption Pricing Using Smart
Contracts
Sergio G. Miranda
Blockchain
Proof of concept
(PoC)
PHASES OF BLOCKCHAIN ADOPTION
Identify the potential of blockchain Identify opportunities
Testing and tech evangelism
Production-ready
Be aware of implications
Not everything is
cryptocurrency
Implies
collaboration
based on
transparency –
decentralization
of data
Internal
promotion of
PoCs
Identify processes,
activities, producst
that can be
optimized with
blockchain
Blockchain
technology is
adopted
Source:
https://www.atsistemas.com/es/blog/
BLOCKCHAIN? WHY?
NETWORK
GOVERNANCE
INTEGRATION WITH
LEGACY SYSTEMS
SCALABILITY
INTEROPERABILITY
DATA PRIVACY AND SECURITY
TRACEABILITY
COMPLIANCE WITH LEGAL AND
REGULATORY ISSUES
1
High level of trust
and risk reduction
2
- Reduced –
operating costs
3
Potential to
identify inefficient
processes
BLOCKCHAIN? WHY?
TOKENIZATION
BLOCKCHAIN? WHY?
TOKENIZATION
IMMUTABILITY
BLOCKCHAIN? WHY?
TOKENIZATION
IMMUTABILITY
DECENTRALIZATION
BLOCKCHAIN? WHY?
TOKENIZATION
IMMUTABILITY
DECENTRALIZATION AUTOMATION
BLOCKCHAIN? WHY?
TOKENIZATION
IMMUTABILITY
DECENTRALIZATION AUTOMATION
AUDITABILITY/PRIVACY
BLOCKCHAIN? WHY?
TOKENIZATION
IMMUTABILITY
DECENTRALIZATION AUTOMATION
AUDITABILITY/PRIVACY
API Economy
Term related to the use of “business APIs” to positively affect the
company. Frequently related to monetary benefits.
Main business drivers:
○ Accelerate time to market
○ Reaching new markets/customers
○ Innovation (at a low cost/risk)
○ Improved sharing of assets across the enterprise (domains) are all
very valuable scenarios for the use of APIs
○ APIs + Cloud = Scalability without limits
API Economy
API Business Models
Partner-Only API
Model
“Closed Model”,
where only partners
of the API’s owner
can access and
consume the AP
“Public” Model
where anyone in
the general public
can access and
consume the API,
usually for a fixed
number of
transactions
Internal APIs Model
which are maintained
privately within an
organization and
aimed at
accelerating and
integrating internal
units and processes
5 Steps to Monetize Your APIs
1. Establish your business case and roadmap
2. Ensure you have the right funding and organizational model
3. Treat APIs as products with an Agile API product lifecycle and
governance
4. Ensure you have the right technology platform to build and manage your
APIs
5. Measure and monitor API KPIs (run-time performance, financials and
developer feedback)
Use cases 1/2
Stubhub Sales of tickets for events
(stubhub.es / developer.stubhub.com)
Success case with WSO2:
https://wso2.com/casestudies/how-apis-are-driving-stubhubs-business/
Use cases 2/2
APIs Mashup
When different APIs from different suppliers are completely necessary to
provide a common service.
e.g.: Mobile payment App for booking parking lots (cameras, IoT,
geopositioning, commercial agreements ...)
Summary - API Economy
7
For example, with the use of an API Manager, that allows the management and
publication of data for its use by third parties.
We have more and more data obtained by the interaction of our users with our
website, mobile applications, sensors and connected devices.
It is possible to monetize the value from this data and its processing.
But for this it is necessary to integrate in a satisfactory way the mechanisms of
interaction with this data.
Allowing control of the use for adequate pricing and monetization.
Business API – Motivation and requirements
8
Use of the Blockchain technology as a trusted
mechanism for the transparent charging of data
consumption.
Trust must be established between the provider and the
consumer of the data
It’s required the use of an API Manager
and Smart Contracts deployed on a blockchain
Implementation Strategy
Implementation strategy of API Economy
Definition of Throttling Policies (Client, App ...)
Service Levels (Requests / sq)
API Analytics Information (Authentication, Backend ...)
Management of Subscriptions and Billing Plans.
Definition of data structures (Data
Management)
Documentation based on Swagger, RAML
To provide
EndPoints for
Integrators
(Prototypes).
Security Policies
(OAuth2, JWT ...)Creation of
Backend
Services
Tokens
Emission
Versions
Management
APIs Planning & Design
Integration
and
Management
of
Consumption
Publication
and
Consumption
Exploitation and Monitoring of APIs
API Governance 1/2
Monitoring
Resources and APIs definition
Standardization for APIs development
API documentation
Testing
API Governance 2/2
Security policies
Monetization
CI and CD strategies
Version policies
Market solutions
Technology stack
WSO2 API Manager
5
It facilitates the development of APIs
by abstracting the security layer. It can
be integrated into the CI/CD Company
and being deployed in Cloud, On
Premise or Hybrid infrastructure
100% Open Source under Apache 2.0
license
It ensures the availability of backends
and facilitates the APIs publication and
their consumption by development
teams.
The WSO2 suite provides a complete
management of the available APIs
(resources) for customer and supplier
systems as well as internal systems of the
company.
It allows analysis and
monitoring of theresources and
design of dashboards and
gadgets
WSO2 API Manager - Components
6
Data Analytics: Statistics for published
and consumed resources
Key Manager: Security layer for
accessing resources with OAuth 2.0.
Portal Publisher: Website for publishing
APIs
- Swagger or WSDL contracts -.
API Gateway: Management of requests
between clients and backends.
Portal Store: It offers a
resources catalog and facilitate
the consumption / testing of the
APIs.
Traffic Manager: Rules
definition to manage traffic
between customers and
backends using throttling rules.
Blockchain solution
7
Not depending on the infrastructure
Smart Contracts
• Development in Solidity
• OpenZeppelin patterns
API Rest Integration
DApps
Frontend -> Events
Explorer
Explorer of Smart Contract
Transactions and events
Using API JSON-RPC with
web3js to connect to the
working node
Direct filter to the
blockchain network
(there’s no processing in
frontend nor backend)
Interaction with Smart
Contracts using java
(web3j), js(web3js) and
golang
Decoupled Architectures
Blockchain network
• Nodes
• Consensus
Blockchain
trilemma
RELEVANT CONSIDERATIONS
Scalability/Speed
Security Decentralization
Distribution of nodes; participant
involvement
Ability to handle a number of transactions
by a number of users on the network
Immutability of the ledger; resistance to
attacks such as 51% attacks
Blockchain network
9
Based on IBFT algorithm, instead
of “Proof of work”->better
features (approx 1000 tx/s),
without “forks” in the chain
It adds constellation to
geth, a way to store and
run private Smart
contracts
Designed to build
permissioned networks,
where all the
participants are well
known and have a solid
reputation
A “lightweight” get fork -> fully compatible
with EthereumBased on QUORUM
Alastria
Permissioned blockchain network. ALASTRIA Ease of
collaboration and integration of participants
RELEVANT CONSIDERATIONS
Other
participants
Multi-industry national blockchain network…
… to support
transactions with full
legal validity… Physical location of ALASTRIA
nodes
Permissioned blockchain network. ALASTRIA Ease of
collaboration and integration of participants
RELEVANT CONSIDERATIONS
Other
participants
Private transaction
among participants
Multi-industry national blockchain network…
… with appropriate levels of privacy:
… to support
transactions with full
legal validity…
Architecture Design
Demo
API Consumption Pricing using Smart Contracts
3- Consuming API
2- New API for that
Application
1- New Application in API
Manager
API Consumption Pricing using Smart Contracts
3- Consuming the API
2- New API for that
Application
1- New Application in API
Manager
Step 1 – New Application
WSO2
API M
+
FRAMEWORK
API_MONETIZATION
WSO2
API GATEWAY
AWS
LAMBDAS
DYNAMO DB
BLOCKCHAIN
NETWORK
------------
ALASTRIA
AWS
SQS
1
NEW APP
2
REQUEST ACCEPTED
3
NEW
SMART CONTRACT
4
TRANSACTION OK
5
ACTIVATE SMART CONTRACT
6
ACTIVATION OK
7
SC CREATED
8
READ SC
9
ACTIVATE APP
API Consumption Pricing using Smart Contracts
3- Consuming the API
2- New API for that
Application
1- New Application in API
Manager
Step 2 – New API
WSO2
API M
+
FRAMEWORK
API_MONETIZATION
WSO2
API GATEWAY
AWS
LAMBDAS
DYNAMO DB
BLOCKCHAIN
NETWORK
------------
ALASTRIA
AWS
SQS
1
NEW API
2
REQUEST ACCEPTED
3
UPDATE
SMART CONTRACT
4
TRANSACTION OK
5
UPDATE SMART CONTRACT
6
UPDATING OK
7
API ACTIVATED
8
READ SC
9
ACTIVATE API
API Consumption Pricing using Smart Contracts
3- Consuming the API
2- New API for that
Application
1- New Application in API
Manager
Step 3 – Updating consumption
WSO2
API M
+
FRAMEWORK
API_MONETIZACION
WSO2
API GATEWAY
AWS
LAMBDAS
DYNAMO DB
BLOCKCHAIN
NETWORK
------------
ALASTRIA
AWS
SES
2
EVENTS
PROCESSED
3
EVENTS SENT
4
UPDATE
SMART CONTRACT
5
EVENTS REGISTERED
6
UPDATE SMART CONTRACT
7
UPDATING OK
8
PDF CREATION
1
PROCESSING EVENTS
PDF Bill
www.atsistemas.co
m 902 888 902
THANK YOU
MADRID
HEADQUARTERS:
C/Valle de Alcudia 3, Ed. 2
28232 - Las Rozas - Madrid
Barcelona
Plaça de Catalunya 21, Plta. 2
08002 - Barcelona
Cádiz
Edificio Jerez Parque Empresarial, C/ del Desarrollo 2, Plta. 1
11047 - Jerez de la Frontera - Cádiz
Zaragoza
Centro Tecnológico TIC XXI, C/Bari 57, Plataforma Logística
(PLA-ZA)
50197 - Zaragoza
A Coruña
Edificio Mans Polígono de Pocomaco, Parcela D22
15190 - A Coruña
Palma de Mallorca
Regus Palma Polígono de Son Castello, C/ Gremi de Sabaters
21, Plta. 2
07009 - Palma de Mallorca
Huelva
Edificio PCTH 2000, Oficina 12, Pol. La Raya
C/ Caucho 1
21110 - Aljaraque - Huelva

More Related Content

[WSO2Con EU 2018] Blockchain in the Business API Ecosystem - API Consumption Pricing Using Smart Contracts

  • 1. IT R&D & Innovation / Blockchain Manager Blockchain in the Business API Ecosystem: API Consumption Pricing Using Smart Contracts Sergio G. Miranda
  • 3. PHASES OF BLOCKCHAIN ADOPTION Identify the potential of blockchain Identify opportunities Testing and tech evangelism Production-ready Be aware of implications Not everything is cryptocurrency Implies collaboration based on transparency – decentralization of data Internal promotion of PoCs Identify processes, activities, producst that can be optimized with blockchain Blockchain technology is adopted Source: https://www.atsistemas.com/es/blog/
  • 4. BLOCKCHAIN? WHY? NETWORK GOVERNANCE INTEGRATION WITH LEGACY SYSTEMS SCALABILITY INTEROPERABILITY DATA PRIVACY AND SECURITY TRACEABILITY COMPLIANCE WITH LEGAL AND REGULATORY ISSUES 1 High level of trust and risk reduction 2 - Reduced – operating costs 3 Potential to identify inefficient processes
  • 12. Term related to the use of “business APIs” to positively affect the company. Frequently related to monetary benefits. Main business drivers: ○ Accelerate time to market ○ Reaching new markets/customers ○ Innovation (at a low cost/risk) ○ Improved sharing of assets across the enterprise (domains) are all very valuable scenarios for the use of APIs ○ APIs + Cloud = Scalability without limits API Economy
  • 13. API Business Models Partner-Only API Model “Closed Model”, where only partners of the API’s owner can access and consume the AP “Public” Model where anyone in the general public can access and consume the API, usually for a fixed number of transactions Internal APIs Model which are maintained privately within an organization and aimed at accelerating and integrating internal units and processes
  • 14. 5 Steps to Monetize Your APIs 1. Establish your business case and roadmap 2. Ensure you have the right funding and organizational model 3. Treat APIs as products with an Agile API product lifecycle and governance 4. Ensure you have the right technology platform to build and manage your APIs 5. Measure and monitor API KPIs (run-time performance, financials and developer feedback)
  • 15. Use cases 1/2 Stubhub Sales of tickets for events (stubhub.es / developer.stubhub.com) Success case with WSO2: https://wso2.com/casestudies/how-apis-are-driving-stubhubs-business/
  • 16. Use cases 2/2 APIs Mashup When different APIs from different suppliers are completely necessary to provide a common service. e.g.: Mobile payment App for booking parking lots (cameras, IoT, geopositioning, commercial agreements ...)
  • 17. Summary - API Economy 7 For example, with the use of an API Manager, that allows the management and publication of data for its use by third parties. We have more and more data obtained by the interaction of our users with our website, mobile applications, sensors and connected devices. It is possible to monetize the value from this data and its processing. But for this it is necessary to integrate in a satisfactory way the mechanisms of interaction with this data. Allowing control of the use for adequate pricing and monetization.
  • 18. Business API – Motivation and requirements 8 Use of the Blockchain technology as a trusted mechanism for the transparent charging of data consumption. Trust must be established between the provider and the consumer of the data It’s required the use of an API Manager and Smart Contracts deployed on a blockchain
  • 20. Implementation strategy of API Economy Definition of Throttling Policies (Client, App ...) Service Levels (Requests / sq) API Analytics Information (Authentication, Backend ...) Management of Subscriptions and Billing Plans. Definition of data structures (Data Management) Documentation based on Swagger, RAML To provide EndPoints for Integrators (Prototypes). Security Policies (OAuth2, JWT ...)Creation of Backend Services Tokens Emission Versions Management APIs Planning & Design Integration and Management of Consumption Publication and Consumption Exploitation and Monitoring of APIs
  • 21. API Governance 1/2 Monitoring Resources and APIs definition Standardization for APIs development API documentation Testing
  • 22. API Governance 2/2 Security policies Monetization CI and CD strategies Version policies
  • 25. WSO2 API Manager 5 It facilitates the development of APIs by abstracting the security layer. It can be integrated into the CI/CD Company and being deployed in Cloud, On Premise or Hybrid infrastructure 100% Open Source under Apache 2.0 license It ensures the availability of backends and facilitates the APIs publication and their consumption by development teams. The WSO2 suite provides a complete management of the available APIs (resources) for customer and supplier systems as well as internal systems of the company. It allows analysis and monitoring of theresources and design of dashboards and gadgets
  • 26. WSO2 API Manager - Components 6 Data Analytics: Statistics for published and consumed resources Key Manager: Security layer for accessing resources with OAuth 2.0. Portal Publisher: Website for publishing APIs - Swagger or WSDL contracts -. API Gateway: Management of requests between clients and backends. Portal Store: It offers a resources catalog and facilitate the consumption / testing of the APIs. Traffic Manager: Rules definition to manage traffic between customers and backends using throttling rules.
  • 27. Blockchain solution 7 Not depending on the infrastructure Smart Contracts • Development in Solidity • OpenZeppelin patterns API Rest Integration DApps Frontend -> Events Explorer Explorer of Smart Contract Transactions and events Using API JSON-RPC with web3js to connect to the working node Direct filter to the blockchain network (there’s no processing in frontend nor backend) Interaction with Smart Contracts using java (web3j), js(web3js) and golang Decoupled Architectures Blockchain network • Nodes • Consensus
  • 28. Blockchain trilemma RELEVANT CONSIDERATIONS Scalability/Speed Security Decentralization Distribution of nodes; participant involvement Ability to handle a number of transactions by a number of users on the network Immutability of the ledger; resistance to attacks such as 51% attacks
  • 29. Blockchain network 9 Based on IBFT algorithm, instead of “Proof of work”->better features (approx 1000 tx/s), without “forks” in the chain It adds constellation to geth, a way to store and run private Smart contracts Designed to build permissioned networks, where all the participants are well known and have a solid reputation A “lightweight” get fork -> fully compatible with EthereumBased on QUORUM Alastria
  • 30. Permissioned blockchain network. ALASTRIA Ease of collaboration and integration of participants RELEVANT CONSIDERATIONS Other participants Multi-industry national blockchain network… … to support transactions with full legal validity… Physical location of ALASTRIA nodes
  • 31. Permissioned blockchain network. ALASTRIA Ease of collaboration and integration of participants RELEVANT CONSIDERATIONS Other participants Private transaction among participants Multi-industry national blockchain network… … with appropriate levels of privacy: … to support transactions with full legal validity…
  • 33. Demo
  • 34. API Consumption Pricing using Smart Contracts 3- Consuming API 2- New API for that Application 1- New Application in API Manager
  • 35. API Consumption Pricing using Smart Contracts 3- Consuming the API 2- New API for that Application 1- New Application in API Manager
  • 36. Step 1 – New Application WSO2 API M + FRAMEWORK API_MONETIZATION WSO2 API GATEWAY AWS LAMBDAS DYNAMO DB BLOCKCHAIN NETWORK ------------ ALASTRIA AWS SQS 1 NEW APP 2 REQUEST ACCEPTED 3 NEW SMART CONTRACT 4 TRANSACTION OK 5 ACTIVATE SMART CONTRACT 6 ACTIVATION OK 7 SC CREATED 8 READ SC 9 ACTIVATE APP
  • 37. API Consumption Pricing using Smart Contracts 3- Consuming the API 2- New API for that Application 1- New Application in API Manager
  • 38. Step 2 – New API WSO2 API M + FRAMEWORK API_MONETIZATION WSO2 API GATEWAY AWS LAMBDAS DYNAMO DB BLOCKCHAIN NETWORK ------------ ALASTRIA AWS SQS 1 NEW API 2 REQUEST ACCEPTED 3 UPDATE SMART CONTRACT 4 TRANSACTION OK 5 UPDATE SMART CONTRACT 6 UPDATING OK 7 API ACTIVATED 8 READ SC 9 ACTIVATE API
  • 39. API Consumption Pricing using Smart Contracts 3- Consuming the API 2- New API for that Application 1- New Application in API Manager
  • 40. Step 3 – Updating consumption WSO2 API M + FRAMEWORK API_MONETIZACION WSO2 API GATEWAY AWS LAMBDAS DYNAMO DB BLOCKCHAIN NETWORK ------------ ALASTRIA AWS SES 2 EVENTS PROCESSED 3 EVENTS SENT 4 UPDATE SMART CONTRACT 5 EVENTS REGISTERED 6 UPDATE SMART CONTRACT 7 UPDATING OK 8 PDF CREATION 1 PROCESSING EVENTS
  • 42. www.atsistemas.co m 902 888 902 THANK YOU MADRID HEADQUARTERS: C/Valle de Alcudia 3, Ed. 2 28232 - Las Rozas - Madrid Barcelona Plaça de Catalunya 21, Plta. 2 08002 - Barcelona Cádiz Edificio Jerez Parque Empresarial, C/ del Desarrollo 2, Plta. 1 11047 - Jerez de la Frontera - Cádiz Zaragoza Centro Tecnológico TIC XXI, C/Bari 57, Plataforma Logística (PLA-ZA) 50197 - Zaragoza A Coruña Edificio Mans Polígono de Pocomaco, Parcela D22 15190 - A Coruña Palma de Mallorca Regus Palma Polígono de Son Castello, C/ Gremi de Sabaters 21, Plta. 2 07009 - Palma de Mallorca Huelva Edificio PCTH 2000, Oficina 12, Pol. La Raya C/ Caucho 1 21110 - Aljaraque - Huelva