Lessons From PIX
Lessons From PIX
CREATING THE
NEXT GENERATION OF
PAYMENT RAILS:
LESSONS FROM PIX
HOW TO BUILD A REAL-TIME PAYMENTS
PLATFORM AT ITS FULL POTENTIAL
,6%1
KWWSVGRLRUJVZFM
TA B L E O F C O N T E N T
TABLE OF CONTENT
1. IntroductIon 3
1.1. About Pix
1.2. About the authors
1.3. About this paper
5. references 87
6. authors 88
7. about ctPI 90
1.1.
About Pix
1.
INTRODUCTION
1.2.
About the
authors
1.3.
About this
paper
3
ABOUT PIX
1.
Introduction
1.1.
PIX
About Pix
4
ABOUT
1. THE AUTHORS
Introduction
1.1.
W
About Pix
MARIANA JONAS
CUN HA E M E LO ABREU
5
ABOUT
1. THIS PAPER
Introduction
1.1.
T
About Pix
6
2.1.
Pix’s essential
properties and
2.
PROPERTIES
AND PLATFORMS:
their systemic
consequences
A HIGH-LEVEL
2.2.
Fast payment rail
as a platform, not
VIEW OF PIX
a specific product
implementation
2.3.
Lessons from Pix
7
PROPERTIES AND
PLATFORMS: A HIGH-
2.
2.3.
Lessons from Pix
a. Nine properties of Pix
1 Government-driven
8
2.
PROPERTIES AND
PLATFORMS: A HIGH-
LEVEL VIEW OF PIX
2 High availability
2.1.
Pix’s essential Pix is, of course, available 24 hours a
properties and day, 7 days a week, 365 days a year,
their systemic with no downtime on payment or any
consequences other key services.
2.2.
Fast payment rail
as a platform, not
a specific product
implementation
3 Instant gross settlement
2.3.
Lessons from Pix
Pix offers instant payments, with
settlement and clearing in up to 10
seconds (P50 = 6s; P99 = 10s). After
that period, there is a timeout and the
transaction fails. So in 10 seconds either
the money is in the payee’s account or the payer can
safely try the transaction again.
4 Reliability
9
2. all, the Payee can trust the notification from their bank
PROPERTIES AND
that the money is already available in their accounts.
PLATFORMS: A HIGH-
LEVEL VIEW OF PIX
For PSPs, both Payer PSP and Payee PSP can know
2.1. with certainty the status of a payment order at any
Pix’s essential given time for two reasons: every transaction is
properties and assigned a unique end-to-end ID that allows tracking
their systemic the transaction throughout the flow; and the Payments
consequences Systems Operator (BCB in the Pix rail) is the single
source of truth about the status of the payment so
2.2. that any PSP can query the status of any individual
Fast payment rail transaction. Apart from that, every message in the
as a platform, not payment flow is signed using digital certificates, so
a specific product
there is always cryptographic proof of every event
implementation
from end to end, increasing the system’s reliability.
2.3.
Lessons from Pix
5 Ubiquity
6 Cost-effectiveness
10
2.
7
PROPERTIES AND Standardized user
PLATFORMS: A HIGH- experience requirements
LEVEL VIEW OF PIX
2.1.
An additional factor that aided Pix’s
Pix’s essential
properties and growth is the existence of a minimum
their systemic user experience standard on all PSPs.
consequences Brazil’s Central Bank mandated it
because they want clients from all PSPs
2.2. to use Pix easily. All participants must offer payment
Fast payment rail services using QR Codes, manual input, and alias keys.
as a platform, not However, they are only required to generate static
a specific product QRCs (and just for instantly natural persons).
implementation
2.3.
Lessons from Pix
8 Flexibility, extensibility,
and evolvability
11
2. BCB set up specific fields as mandatory, but
PROPERTIES AND it also created an “additional fields” schema
PLATFORMS: A HIGH-
where the Payee PSP could make any additional
LEVEL VIEW OF PIX
information appear on the Payer PSP app on the
2.1. payment confirmation screen. That is: BCB did
Pix’s essential not try to specify all the admissible fields but
properties and one admissible schema to add any other field.
their systemic
consequences
2.2.
Fast payment rail
as a platform, not
9
a specific product
implementation Security by design
2.3.
Lessons from Pix Pix was also projected to be secure
by design, managing sources of truth,
allowing confirmation of information
before transfers are initiated, and
reducing the complexity of the rail.
Furthermore, Pix’s design is anchored in the best
practices of distributed systems. The Pix rail is
idempotent, meaning that the same transaction can
be performed multiple times without the risk of the
value being credited multiple times.
12
2.
PROPERTIES AND
PLATFORMS: A HIGH-
b. Systemic consequences
LEVEL VIEW OF PIX that follow
T
2.1.
Pix’s essential
HE CRITICAL PROPERTIES OF PIX have many
properties and
their systemic systemic consequences. No longer is it a
consequences competitive advantage for companies to have
been in the market for a long time and to have
built up large customer bases. Any recently created
2.2.
Fast payment rail payments institution can now enable its users to send
as a platform, not money to as many recipients as the big incumbent
a specific product networks do — without paying for access or being pre-
implementation approved by the gatekeepers.
Pix availability
13
2. Code payments, payment interfaces are controlled
PROPERTIES AND
directly from the Payer PSP's app on the Payer's phone.
PLATFORMS: A HIGH-
LEVEL VIEW OF PIX That allows Payer PSPs to offer POS credit and other
previously impossible features. It can also gather much
2.1. more information about the payment.
Pix’s essential
properties and
their systemic
consequences
10 SECONDS
2.2.
Fast payment rail OR LESS! THAT’S HOW
as a platform, not FAST A PIX TRANSACTION
a specific product CLEARS AND SETTLES
implementation
2.3.
Lessons from Pix
To summarize, Pix is a payment and transfer scheme
that operates and settles transactions in less than 10
seconds. The system operates 24/7/365 and is data-rich,
extensible, and ubiquitous. The Brazilian Central Bank
is the Pix scheme's settlor, managing its operation and
defining the rules governing Pix. The scheme operates
over an infrastructure consisting of a real-time gross
settlement chamber and an alias database, both of
which are under the Central Bank's direct operation. Pix
was created to foster innovation, competition, and the
digitalization of payments and the economy as a whole.
14
PROPERTIES AND
PLATFORMS: A HIGH-
2.
A SPECIFIC PRODUCT
consequences
2.2.
Fast payment rail
as a platform, not
IMPLEMENTATION
a specific product
implementation
O
NE OF THE MOST IMPORTANT traits that
2.3. make Pix unique is the nature of its design
Lessons from Pix
core. Typically, when a company or a
government sets out to build a payment
rail, the focus is to solve a handful of use cases. And in
doing so, communications protocols fall prey to over-
specification and over-standardization, resulting in
unnecessary complexity and inefficiency. And whenever
a new use case emerges, those responsible for the rail
need to either make workarounds in the already existing
fields and messages or build an entirely new rail to
accommodate the additional needs.
15
2. communications protocols, created their criteria for
PROPERTIES AND entry, and – as a general rule – are expensive to join
PLATFORMS: A HIGH-
and operate.
LEVEL VIEW OF PIX
2.
A DATA FLOW: EACH TRANSACTION
IS ASSOCIATED WITH SOME METADATA.
16
2.
PROPERTIES AND a. The protocol issue
PLATFORMS: A HIGH-
LEVEL VIEW OF PIX The system needs a communication method that
f fi s fo r ob e t es
2.1.
Pix’s essential
properties and
their systemic
consequences
1
17
2.
PROPERTIES AND 2
PLATFORMS: A HIGH-
LEVEL VIEW OF PIX
Secondly, the protocol must be accessible to all
2.1.
potential participants in the ecosystem. Connecting
Pix’s essential
properties and every account in a given country through one payment
their systemic system entails connecting all account service providers
consequences in the area. In that group, all kinds of institutions, big and
small, newcomers and incumbents, must be able to
communicate using the same protocol.
2.2.
Fast payment rail
as a platform, not For that reason, the newest buzzword piece of tech or
a specific product a patented technology only a selected few are licensed
implementation to use might get in the way of accessibility. Another
issue is the cost. A protocol that requires expensive
2.3. certifications may exclude smaller players. The same
Lessons from Pix goes to a protocol that is so complex to operate, it
requires huge teams of specialists to navigate.
18
2.
PROPERTIES AND 4
PLATFORMS: A HIGH-
LEVEL VIEW OF PIX
Finally, the protocol must be efficient. This is where
2.1.
great opportunities lie for building something truly
Pix’s essential
properties and transformative for the lives of every citizen. The protocol
their systemic bears a great share of the cost of infrastructure
consequences operation as a whole. The decisions made at the
protocol level impact the cost of processing, memory,
disk, bandwidth, and maintenance in general.
2.2.
Fast payment rail
as a platform, not The size, frequency, and flows of messages
a specific product exchanged between participants profoundly impact
implementation the overall price of each transaction. A protocol that
demands unnecessary data to travel, uses a data-
2.3. heavy format, or requires hiring proprietary services or
Lessons from Pix a big team to run it is likely unable to serve a system
that is supposed to cost micro cents per event and
enable its use for any possible need to transfer funds.
If it costs more than a loaf of bread to complete a
transaction, the system would not be suited to accept
payments in a bakery – and the goal is to create a
solution for all needs.
19
2. The second aspect of trust in this context is
PROPERTIES AND that connecting the financial system takes an
PLATFORMS: A HIGH-
arrangement between any two account service
LEVEL VIEW OF PIX
providers in the land. This requirement unfolds into
2.1. several issues, from the complexity of business
Pix’s essential arrangements to the technical arrangements and
properties and issues, such as determining the source of truth.
their systemic
consequences
2.2.
Fast payment rail
as a platform, not
a specific product c. The issue of reach
implementation
20
2.
PROPERTIES AND 4 PSPS IN THE ECOSYSTEM
PLATFORMS: A HIGH-
LEVEL VIEW OF PIX
>>> 3 integrations are
2.1.
Pix’s essential required for each PSP
properties and
their systemic
consequences
Payee PSP
2.2.
Fast payment rail
as a platform, not
a specific product
implementation
Payer PSP Payee PSP
2.3.
Lessons from Pix
Payee PSP
>>> 1 integrations is
required for each PSP
Payee PSP
Payee PSP
21
PROPERTIES AND
PLATFORMS: A HIGH-
2.
T
Pix’s essential
properties and O ORCHESTRATE THE THREE ISSUES raised above,
their systemic
the Brazilian Central Bank took an approach
consequences
that can be summarized in four main
propositions:
2.2.
Fast payment rail
as a platform, not 1st
a specific product
implementation
To create a centralized infrastructure built and
run by the BCB itself that is in charge of the
2.3. clearing and settlement service. This ensures
Lessons from Pix that new members connect to all current and
future participants in the ecosystem with a single
integration into the centralized infrastructure. That
enables reducing the integration cost, allowing
greater reach, centralizing the issue of trust, and
reducing the need for intermediaries.
2st
To favor open source protocols, such as HTTP and
RESTful APIs over proprietary solutions that were
traditional in the industry until then, such as the
messaging software IBM MQ. This reduces the
overall operating cost, as well as the integration
cost, which also favors a greater reach.
3st
To create a messaging abstraction that was tailor-
made for payments, in a way that enables the
ecosystem to evolve at a much faster rate, thus
ensuring the evolvability of the ecosystem while
also reducing the computational and upfront
investment from the infrastructure operator.
22
2.
PROPERTIES AND
PLATFORMS: A HIGH-
4st
LEVEL VIEW OF PIX
To embed in the system design and protocol some
2.1. of the best practices of distributed systems, such
Pix’s essential as eventual consistency, idempotency, a unified
properties and source of truth, and replication logs, thus creating a
their systemic symbiosis between security and trust features and
consequences the inner works of the system.
2.2.
Fast payment rail
as a platform, not These are the main characteristics that make Pix
a specific product a successful case. In line with that assumption, the
implementation few critiques we have about BCB's choices in building
Pix are in the areas where BCB deviated from these
2.3. four north stars or missed the chance to take full
Lessons from Pix advantage of them.
23
2.1.
3.1.
Pix’s essential
Architecture and
3.
2.
HOW PIX
PROPERTIES
properties and
participants
AND PLATFORMS:
WORKS:
their systemic
consequences 3.2.
Deep-dive into
A HIGH-LEVEL
ARCHITECTURE
the key features
2.2.
Fast
of Pixpayment rail
architecture
as a andplatform, not
protocol
VIEW
AND OF PIX
PARTICIPANTS
a specific product
implementation 3.3.
Lessons from Pix
2.3.
Lessons from Pix
24
3.
HOW PIX
WORKS:
ARCHITECTURE
3.1.
ARCHITECTURE
AND PARTICIPANTS
AND PARTICIPANTS
3.1.
Architecture and
participants
3.2.
Deep-dive into
the key features
of Pix architecture a. Pix infrastructure
and protocol
3.3.
T
Lessons from Pix
HE PIX INFRASTRUCTURE WAS BUILT and is
operated by the Brazilian Central Bank, the
country’s financial markets regulator.
To support the new instant payments system,
BCB created two entities:
25
3.
DIRECT PARTICIPANTS =
HOW PIX
WORKS: INSTITUTIONS WITH IP ACCOUNTS
ARCHITECTURE
AND PARTICIPANTS INDIRECT PARTICIPANTS =
3.1. WHO CHOOSE NOT TO HAVE THESE ACCOUNTS
Architecture and OR WHO ARE EXCLUDED FROM HAVING THEM
participants
3.2.
Deep-dive into
The IP Account is managed through the older RTGS
the key features
of Pix architecture system BCB built called Reserves Transfer System (STR),
and protocol which runs only on working days and hours. The direct
participants must manage the cash flow from their IP
3.3. Accounts to make sure they don't run into a liquidity
Lessons from Pix problem, especially at night and on weekends. The
Brazilian Central Bank provides a limited liquidity credit
line for direct participants and allows other players
to offer similar services to the participants. The lines
of credit, however, are tied to the SELIC infrastructure,
which is also limited to working hours of working days.
To reduce the cost and the risk of managing the IP
Account, BCB later introduced modifications to the
regulation to instate a yield to be paid on top of the
overnight deposits on the IP Accounts.
26
3.
HOW PIX
WORKS: The limit of alias keys
ARCHITECTURE tied to each account is:
AND PARTICIPANTS
3.1. 5 FOR
Architecture and INDIVIDUALS
participants
3.2.
Deep-dive into 20 FOR
the key features COMPANIES
of Pix architecture
and protocol
3.3.
Lessons from Pix
Because Payees can have only one account
linked to each of their keys, there's a process that
institutions must follow when they want to change
which account is linked with a user's email or phone
number. Payees can also remove the alias on their
original institution's interface and link to a new
account on a different PSP.
27
3.
HOW PIX
WORKS:
b. Pix participants
ARCHITECTURE
AND PARTICIPANTS The Pix rail allows five different types of participants.
3.1.
Architecture and
participants
3.2.
Deep-dive into 1 Direct participants
the key features
of Pix architecture
and protocol Their role is to provide account services
to end-users. They are connected directly
3.3.
to SPI. That means it holds a “PI Account”
Lessons from Pix
with the Central Bank, used to settle Pix
transactions. It is important to remember
that direct participants may use IT service providers to
integrate SPI. However, what matters most in being a
direct participant is that the entity holds a PI Account
and engages in BCB’s settlement of transactions.
2 Indirect participants
28
3.
HOW PIX
WORKS:
ARCHITECTURE
3 Settlement service provider
AND PARTICIPANTS
It is a special type of participant on
3.1.
Architecture and the Pix system that doesn’t provide
participants account services to end users. It enables
participants who are not direct members
3.2. themselves to settle transactions through
Deep-dive into it.
the key features
of Pix architecture
and protocol
3.3.
Payment initiation
4
Lessons from Pix
service provider
(PISP OR ITP, IN PORTUGUESE)
29
3.
HOW PIX
WORKS:
ARCHITECTURE
3.2.
A DEEP-DIVE INTO
AND PARTICIPANTS
3.2.
Deep-dive into
OF PIX ARCHITECTURE
the key features
of Pix architecture
and protocol
AND PROTOCOL
3.3.
Lessons from Pix
a. Payment state
and error handling
P
IX’S CLEARING HOUSE HAS MODELED a payment in
an eventually consistent way. This means that,
after a period of time (in this case, 10 seconds
for payment timeout, plus time for PSPs to
query the information), all participants will agree on
the final state of the payment.
30
3. One important enabler of this property in Pix is a
HOW PIX
Universally Unique Identifier (UUID), an alphanumeric
WORKS:
key that identifies the transaction in the rail and serves
ARCHITECTURE
AND PARTICIPANTS to query state or retry operations in case of errors.
3.3.
Lessons from Pix
31
3.
HOW PIX FLOW OF THE HTTP MESSAGING
WORKS:
ARCHITECTURE
AND PARTICIPANTS
Payment Order xyz
3.1.
HTTP status: 200 (ok)
Architecture and PSP Clearing
participants House
3.2.
Deep-dive into >>> Scenario 1
the key features network partition
(ex: internet down)
of Pix architecture
and protocol Payment Order xyz
?
3.3. PSP ? Clearing
House
Lessons from Pix ?
>>> Scenario 2
network partition
(ex: internet down)
network partition
(ex: internet down)
Statusr xyz?
Payment xyz successfu
32
3. In the image above, the normal flow of the HTTP
HOW PIX
messaging shows a payment order being sent from
WORKS:
ARCHITECTURE a PSP to the clearing house followed by a successful
AND PARTICIPANTS response — 200 response code. There are two different
network partition error scenarios where the PSP does not
3.1. receive the 200 status code after sending the payment
Architecture and order, explained bellow:
participants
• 1st scenario: the payment order never reached the
3.2.
clearing house;
Deep-dive into
the key features
of Pix architecture • 2nd scenario: the first message arrived at the
and protocol destination, but the response was cut off.
33
3. transaction will fail after the timeout period runs out
HOW PIX
and the payer will be instructed to initiate it again. Thus,
WORKS:
ARCHITECTURE even if the communication between the Payer PSP or the
AND PARTICIPANTS Payee PSP and the settlement chamber fails, they can
query the settlement chamber as to the status of the
3.1. transaction after the 10 seconds run out.
Architecture and
participants
3.2.
Deep-dive into
the key features
of Pix architecture
b. Payment description
and protocol
3.3.
and metadata
Lessons from Pix
O
NE KEY DISTINCTION BETWEEN PIX and other
payment rails is its strict separation of
the money movement and the metadata
definition. Money movement messaging is
completely controlled by the clearing house, but the
metadata messaging is flexible and can be defined by
the Payee PSP.
34
3. money’s destination, not the specifics of their use cases.
HOW PIX
Most frauds, money laundering, and other payment
WORKS:
ARCHITECTURE restrictions are related to the money movement. Since
AND PARTICIPANTS this is handled in the same way in Pix, a new payment
product will always have those capabilities enabled.
3.1.
Architecture and
participants
3.2.
Deep-dive into
the key features c. Account definition
of Pix architecture
S
and protocol
IMILARLY TO STR, PIX ALSO identifies accounts
3.3.
Lessons from Pix through information such as bank routing
number, bank account number, and account
owner tax ID, which allows participants to easily
migrate customer transfers from STR to Pix without having
the end user take active action for that to happen.
• A phone number;
• An email address;
• A tax ID (CPF or CNPJ);
• A social security number;
• Or a random UUID.
35
3.
HOW PIX 1st
WORKS: issue Key scarcity
ARCHITECTURE
AND PARTICIPANTS
Having only the possibility of having three
3.1.
Architecture and aliases and those needing to be unique
participants on the system, could eliminate possible
use cases for Pix. The UUID alias was a
3.2. good solution for this issue.
Deep-dive into
the key features
of Pix architecture
and protocol
36
3.
HOW PIX 4th DICT needs to be working
WORKS: issue correctly at all times
ARCHITECTURE
AND PARTICIPANTS
d. Extensibility and
sub-standardization
A
S A PLATFORM, PIX WAS intentionally designed
to be extended. Its main extension point is
the metadata field on the dynamic QRCode
payload. This field specifies what that
payment is about and is meta-modeled, meaning that
only the way of presenting information is defined and
not which information can be added there.
37
3. Many Brazilian government organizations
HOW PIX
have already started to use this metadata field
WORKS:
ARCHITECTURE to encode the information they need for their
AND PARTICIPANTS payment processes, starting to substitute other
rails such as DARFs (a federal tax-specific payment
3.1. rail named "Documento de Arrecadação de
Architecture and Receitas Federais" in Brazilian Portuguese). Utility
participants companies are starting to use this field to create
utility bill payments, replacing the barcode rail they
3.2.
Deep-dive into use today. Many companies are replacing their
the key features barcodes for the Boleto (electronic bill payment
of Pix architecture method used extensively across Brazil) rail by
and protocol adding the required information to the metadata
field. Merchants are starting to include the items
3.3. bought in this field, so their customers can later
Lessons from Pix
check what that payment was about directly from
their banking app.
38
3.
HOW PIX e. Protocols, standards,
WORKS:
ARCHITECTURE
AND PARTICIPANTS and interoperability
I
3.1.
Architecture and
T IS NOT FEASIBLE TO build a platform without relying
participants
on several protocols or standards. The strategy of
3.2. reuse is fundamental for the speed and price of
Deep-dive into creating something new, so it is not a surprise that
the key features some of the hardest decisions in designing Pix were
of Pix architecture choosing a protocol or standard for a specific part of it.
and protocol
These decisions may seem innocuous, but they
3.3.
have a direct impact on the final price of the platform,
Lessons from Pix
cost of integration for the PSPs, possible functionality
for the platform, and implementation time. Depending
on the choices made, you are choosing who can
participate in the ecosystem.
39
3.
easier to extend for specific use cases. Instead of
HOW PIX
choosing IBM MQ, licensed by IBM, the BCB opted for
WORKS:
ARCHITECTURE using the HTTP protocol, which is free.
AND PARTICIPANTS
Some other choices favored proprietary standards,
3.1. such as the use of ISO 20022 data formats and
Architecture and the EMVco QRCode format. Even though that is not
participants necessarily the case, both standards introduced
additional complexity and limitations to the
3.2.
ecosystem.
Deep-dive into
the key features
of Pix architecture The choice of ISO 20022 data format was mainly
and protocol motivated by the possibility of interoperability with
rails that also use the message format. Interoperability
3.3. is an interesting goal to have but in the case of a
Lessons from Pix payment platform that is far from solved by the data
format. Authentication, authorization, connectivity,
data requirements, and many other aspects need to
be established before the data format can have an
impact on interoperability.
OPERATIONAL COST:
THEY ARE CHEAPER THAN THE
ALTERNATIVES AVAILABLE
ADOPTION COST:
THEY ARE WIDELY USED AND FAMILIAR BY
MOST SOFTWARE ENGINEERS
EXTENSIBILITY:
THEY ARE GENERALLY EASIER TO EXTEND
FOR SPECIFIC USE CASES
40
3. adapted for Pix and is now maintained independently
HOW PIX from the ISO format.
WORKS:
ARCHITECTURE
It was possible to define a much simpler standard
AND PARTICIPANTS
than ISO 20022 that is strictly tailored for Pix, which could
3.1. have reduced costs and implementation time even
Architecture and further.
participants
The choice of EMVco QRCode standard also
3.2. introduced unnecessary limitations for no
Deep-dive into apparent gain. Once more, the goal was to achieve
the key features
interoperability but it failed. Apart from the unclear
of Pix architecture
and protocol mapping of some IDs (26 through 51 that are
inconsistently and incompatibly used in many different
3.3. rails across the world) a choice of data format will not
Lessons from Pix enable interoperability.
41
3.
HOW PIX f. Joining Pix: certification
WORKS:
ARCHITECTURE
AND PARTICIPANTS and compatibility
F
3.1.
Architecture and
OR AN INSTITUTION TO BE part of Pix, it must
participants
undergo a process filled with certifications
3.2. and technical validations. The Brazilian Central
Deep-dive into Bank created a sandbox environment where
the key features aspiring Pix participants can implement their internal
of Pix architecture systems against a test environment, facilitating
and protocol the implementation process. Once finished, new
participants must take an extra step: pass a series
3.3.
Lessons from Pix of technical tests to make sure the implementation
works with the BCB’s systems and that payments
can be successfully made, received, or initiated. This
reduces the risk of having compatibility issues going
into production, which could damage the Pix brand.
42
3.
HOW PIX
WORKS:
ARCHITECTURE
3.3.
LESSONS FROM PIX
AND PARTICIPANTS
3.1.
Architecture and
participants
A
3.2.
Deep-dive into S MENTIONED PREVIOUSLY, ONE OF the most
the key features important lessons from Pix’s architecture is
of Pix architecture the pivotal role of a centralized settlement
and protocol chamber operated by a centralized Payment
System Operator — the SPI and the Brazilian Central
3.3. Bank, respectively. The possibility of having institutions
Lessons from Pix
joining the rail as either direct or indirect participants
was also critical to reduce the cost of entry for smaller
players who can enjoy the advantages of Pix without
the need for a full-blown infrastructure. Yet, the value
of the payment initiation service provider role in Brazil
is still very questionable, given the restrictions imposed
by the regulation and the strength of alternative
solutions on top of Pix. The role of PISPs and the
impacts of the Open Finance agenda on Pix is not,
however, the main focus of this paper and should be
discussed at a future opportunity.
• Consistency
• Availability
• Partition Tolerance.
43
3. For Pix, the possible 10s delay in payment
HOW PIX
consistency is a small price to pay to have the highest
WORKS:
ARCHITECTURE possible levels of Availability and tolerance to network
AND PARTICIPANTS failures (Partition Tolerance).
3.1.
Architecture and
participants 1st LESSON
2st LESSON
44
4.1.
Payment flow:
4.
2.
HOW PIX
PROPERTIES
communication
etween P Ps and
t Pix’s
2.1.
essential
e settlement
properties and
chamber
AND PLATFORMS:
WORKS:
their systemic
consequences 4.2.
Payment flow:
A HIGH-LEVEL
PAYMENT FLOW
communication
VIEW OF PIX
2.2.
Fast payment
etween rail
end-users
as a platform, not
devices/interfaces
a specific
and tproduct
e P Ps
implementation
4.3.
essons from2.3.Pi
Lessons from Pix
Before getting into how Pix works,
it is worth making a few general
remarks about Pix's properties
and the fundamental decisions.
These will help contextualize the
payment system as a whole.
45
T
4. HE DATA FLOW CONSISTS OF sending the
HOW PIX
Payer PSP all necessary information to start
WORKS: PAYMENT
the money transfer along with other details
FLOW
required by a particular payment method.
4.1. For a financial transaction to happen, it is mandatory
Payment flow: to have the following information:
communication
between PSPs and • Origin
the settlement
chamber • Amount
*one-time set up
Alias Base before first
transaction*
13
6 7
B B
11
10
A 12
A
Payer PSP Clearing Payee PSP
House
14
14
15
15 8 9 5 3 1
2
Payer Payee
46
4. require additional metadata to fulfill the users'
HOW PIX
needs. For example, food vouchers need to verify
WORKS: PAYMENT
FLOW if the payee is registered as a restaurant; credit
cards have to defer the settlement of transactions.
4.1. The proper protocol abstraction accounts for both of
Payment flow: these kinds of use cases.
communication
between PSPs and The flow of information can vary greatly, but
the settlement at the end of the day, all payments use cases
chamber
require mandatory and additional information
4.2. to reach the Payer PSP. And that information
Payment flow: flows through two kinds of channels: (A) the one
communication between the PSPs and the settlement chamber
between end-users’ (steps 10 through 14 in the diagram below), and (B)
devices/interfaces the communication channel between the end-
and the PSPs users and the PSPs (steps 1, 5, 8, 9, and 15).
4.3.
Lessons from Pix
*one-time set up
Alias Base before first
transaction*
13
6 7
11
10
12
15 8 9 5 3 1
2
Payer Payee
47
4.
HOW PIX COMPLETE PIX COMMUNICATION FLOW:
WORKS: PAYMENT
FLOW DYNAMIC QR CODE
48
4.
HOW PIX
WORKS: PAYMENT
FLOW
4.1.
4.1.
Payment flow:
PAYMENT FLOW:
communication
between PSPs and COMMUNICATION
BETWEEN PSPS AND
the settlement
chamber
4.2.
Payment flow: THE SETTLEMENT
CHAMBER
communication
between end-users’
devices/interfaces
and the PSPs
4.3.
A
Lessons from Pix
TYPICAL PAYMENT MONEY FLOW STARTS
when the Payer PSP receives the payment
request from the Payer. As mentioned
previously, all types of payment solutions
have that in common. The method through which this
communication happens, on the other hand, can vary
depending on the use case and will be discussed in
length in the next section. For now, the focus should be
on the moment the Payer PSP receives the payment
request and starts the money flow.
49
4. standpoint, this is not the most efficient choice
HOW PIX
but it avoids the inconvenience of having all PSPs
WORKS: PAYMENT
FLOW implement and certify APIs on their end. After two
years, this approach seems to have paid off since the
4.1. integration of new members to Pix is relatively agile
Payment flow: and the payment flow works seamlessly.
communication
between PSPs and The reason why the Settlement Chamber can
the settlement function as the single source of truth of payment
chamber
status is a simple but powerful concept. All PSPs
4.2. members of the Pix rail must be connected to the SPI,
Payment flow: directly or via a partner who, in turn, is connected
communication directly to the SPI. That direct connection means two
between end-users’ things:
devices/interfaces
and the PSPs 1. The PSP is integrated to SPI's APIs;
$ 100,00
Payer
= Payee
$ 100,00
50
4. As a result, and since every transaction is identified
HOW PIX
through a UUID, if for any reason either of the PSP does
WORKS: PAYMENT
FLOW not receive a payment success confirmation, they can
send a request at any time to the settlement chamber
4.1. and query whether the transfer between the PSPs was
Payment flow: successful or not. Since the whole flow has a timeout
communication of 10 seconds, the PSPs know that they can query the
between PSPs and status of the payment and get a definitive answer if they
the settlement
have not heard back from the Settlement chamber in 10
chamber
seconds. According to the rail regulations, the Payer PSP
4.2. and the Payee PSP have to communicate the success or
Payment flow: failure of every transaction to their clients, which closes
communication the loop of information regarding the payment status.
between end-users’
devices/interfaces
and the PSPs
a. Full account AT ALL TIMES, BOTH PSPS CAN KNOW WHERE THE
information input
MONEY IS, WHICH IS NOT TRUE FOR MANY OTHER
b. Account alias TRANSFER OR PAYMENT RAILS
c. QR Codes
d. Static QR Codes vs.
Dynamic QR Codes
That is a crucial feature for the system as it provides
e. The problem with a more secure and trustworthy rail. When someone
the EMVCo standard
uses Pix to pay for their groceries, the store knows the
f. The limits to QR payment will either undoubtedly work, and they will
Code application
instantly see the money in their account, or it will just as
g. Beyond QR Codes surely fail, and the person will need to retry the payment.
4.3.
Lessons from Pix The image below shows the communications
between the PSPs and the settlement chamber. It is a
subset of the complete payment flow depicted above.
51
4.
HOW PIX COMMUNICATIONS BETWEEN THE
WORKS: PAYMENT
FLOW PSPS AND THE SETTLEMENT CHAMBER
4.1.
Payment flow: 13
communication 11
between PSPs and 10
the settlement
chamber
12
4.2.
Clearing
Payment flow: Payer PSP House Payee PSP
14
communication 14
between end-users’
devices/interfaces
and the PSPs 10 Comes after all payment metadata has been
collected and the Payer PSP is ready to send the
4.3. payment order to the settlement chamber with
Lessons from Pix the amount, destination, and any additional
information that might be relevant to the
transaction (e.g., reconciliation ID). At this point,
the Payer PSP generates an end-to-end ID to
guarantee the idempotency of the money transfer.
52
4. So far, this payment flow has been working
HOW PIX
well. However, we believe that a minor adjustment
WORKS: PAYMENT
FLOW could unlock many opportunities in Pix. Between
Steps 11 and 12 — when the Payee PSP verifies if the
4.1. payment can be accepted, BCB presents a very
Payment flow: limited list of valid reasons to reject a transaction.
communication The reason, among other things, could have been
between PSPs and a concern that incumbents could use it to degrade
the settlement
the Pix experience, thus damaging its brand.
chamber
Notwithstanding this is a reasonable concern, we
4.2. believe that if Payee PSPs could block the transfer for
Payment flow: other reasons, new use cases could arise.
communication
between end-users’ There are cases where a Dynamic QR Code can
devices/interfaces have an expiration date or accept payment only
and the PSPs once and therefore prevent a double payment by
mistake. That feature, however, could also be built
4.3.
Lessons from Pix into the money flow if Payee PSPs could refuse
payment when detecting a duplicate payment,
avoiding errors. Another use case could be the
possibility of refusing a payment before the payer
digitally signs a contract or accepts the terms of
Service (ToS).
53
4.
HOW PIX
WORKS: PAYMENT
FLOW
4.2.
4.1. PAYMENT FLOW:
COMMUNICATION
Payment flow:
communication
between PSPs and
the settlement
chamber BETWEEN END-USERS’
4.2.
Payment flow:
DEVICES/INTERFACES
communication
between end-users’
devices/interfaces
AND THE PSPS
I
and the PSPs
N THE PIX ECOSYSTEM, THE different kinds of flow of
4.3. mandatory and additional information toward the
Lessons from Pix Payer PSP are called “payment initiation methods”.
They are data flows that ensure all required
information is delivered to the Payer PSP. The BCB
created several types of payment initiation methods
and structured a roadmap for future implementations,
which are detailed in the following image:
CUSTOMER- PAYEE
PRESENTED DYNAMIC PSP API
QR CODES
54
4. It is important to observe that most payment initiation
HOW PIX
methods listed above are payer-initiated — a significant
WORKS: PAYMENT
FLOW difference between real-time payment rails and card rails.
In the later system, the payment initiates in the merchant’s
4.1. device (the POS machine). That leads to several security
Payment flow: issues since all sensitive payment information will be
communication input into a single device. The risk of credit card cloning, of
between PSPs and replay attacks on the POS machine, and other frauds are
the settlement
a constant concern regarding card rails. This issue is even
chamber
more critical in locations where crime and fraud rates are
4.2. elevated. Moreover, many people are wary of using credit
Payment flow: and debit cards for security reasons, curbing the adoption
communication rate of those payment methods in several countries, such
between end-users’ as Germany or Argentina.
devices/interfaces
and the PSPs Apart from the direct debit, the customer-presented QR
Code standard, and an eventual API-enabled payment
4.3.
Lessons from Pix initiation, all other bank-to-bank payment mentioned
above begins on the payer's phone. That is a gigantic shift
in the payment dynamics and may have implications for
reducing skepticism and building trust in the system.
I
N PIX’S CONTEXT, THE FULL
account information input
has been called “manual
Payer PSP
input”. It consists of the
Payer opening the Payer
Full name: .......................
PSP’s app and inputting
Routing number: .........
all mandatory transaction
Bank: .................................
information directly into
Amount: ..........................
the app. In essence, the
Date: .................................
user experience is very
similar to the traditional rails TRANSFER
used all over the world to
make account-to-account
transfers.
55
4.
It may seem innocuous to account for a payment
HOW PIX
initiation method filled with so much friction while more
WORKS: PAYMENT
FLOW sophisticated alternatives are available. However, to
expressly recognize this as a valid form to initiate real-
4.1. time payments has its virtues. Since the end-user step-
Payment flow: by-step is strictly the same, the adoption cost for those
communication customers is reduced to zero. The advantage of such an
between PSPs and
approach is, therefore, very clear. No matter the age of
the settlement
the user or where they are in the technology adoption
chamber
lifecycle, everyone can start using the new rail as soon
4.2. as it’s live. That was, in fact, the case with Pix. Payment
Payment flow: Service Providers started pushing for the adoption of
communication Pix in a scenario where the cost of a Pix transaction
between end-users’ was much lower than what existed before, and the
devices/interfaces
user experience was, at worst, strictly the same as the
and the PSPs
previous, more costly solutions. Another advantage is
4.3. that there is always a baseline fallback in case of issues
Lessons from Pix with any other payment initiation method.
6
5
Clearing
Payer PSP House Payee PSP
9
9
10
10
3 4 2
Payee
Payer
56
4.
HOW PIX PAYMENT FLOW: FULL INFORMATION INPUT
WORKS: PAYMENT
FLOW
1 The merchant sends the full banking routing details
4.1. to the payer
Payment flow: The payer inputs all the information in their PSP
2
communication interface, along with the transfer amount and, if
between PSPs and
needed, a small message.
the settlement
chamber The Payer PSP sends all the information to the and
3
presented it for the Payer to scan ( 2 ). When the
4.2. Payer selects their Payer PSP app on their device and
Payment flow: scans the QR Code, the Payer PSP app decrypts the
communication
QR Code image into text. Then, the Payer PSP app
between end-users’
accesses the link embedded in the QR Code and
devices/interfaces
and the PSPs uses it to access the Payee PSP‘s servers ( 3 ). The
Payee PSP replies to the call with the Pix Key and any
4.3. other kind of information needed for the payment
Lessons from Pix ( 4 ). The Payee PSP app forwards all the information
to the Payer PSP‘s servers ( 5 ). The Payer PSP then
accesses the Pix Key Database (DICT) to look up the
routing number associated with the Pix Key ( 6 and
7 ).
57
4.
HOW PIX b. Account alias
WORKS: PAYMENT
FLOW
T
4.1. HE ACCOUNT
Payment flow: ALIAS IS REFERRED
communication to in Brazil as
between PSPs and Pix Keys. These Payer PSP
the settlement are stored in an alias
chamber
database called DICT –
Alias key: .........................
4.2. Transactional Account
Information Database. Amount: ...........................
Payment flow:
communication DICT, as mentioned Date: ..................................
58
4. the alias base, making
HOW PIX
sure the money is going
WORKS: PAYMENT
FLOW to the correct account.
As noted previously, the Payer PSP
4.1. mechanism of ensuring
Payment flow: all relevant information
communication Full name: Mom &
comes from a trusted Pop‘s
between PSPs and and verified source is Routing number:
the settlement 123456
present in all Pix payment
chamber Bank: Bank Corp
initiation methods. It is
Amount: USD 2.70
4.2. one of the main features Date: Today
Payment flow: responsible for building
communication trust in the system. CONFIRM
between end-users’
devices/interfaces When debating on
and the PSPs account aliases, the
Brazilian Central Bank
4.3.
Lessons from Pix had a clear outcome in mind. It was important to the
institution that any payer could make a transaction
just by knowing the payee’s telephone number. To
accomplish this goal, creating the alias database
was the only solution available.
59
4.
HOW PIX PAYMENT FLOW: PIX KEY
WORKS: PAYMENT
FLOW
4.3. 6 The Payer PSP sends all the information back to the
Lessons from Pix payer for confirmation
11
4 5
9
8
10
6 7 3 1 13
Payer Payee
60
4.
HOW PIX c. QR Codes
WORKS: PAYMENT
FLOW
Q
4.1. R CODE IS, PERHAPS, PIX’S most noticeable
Payment flow: feature. In fact, many of the Brazilian Central
communication Bank’s decisions regarding QR Codes made it
between PSPs and possible to create secure and powerful tools
the settlement that enable Pix to work well for P2M use cases instead
chamber
of just the P2P transfers the first two mechanisms are
4.2. more suited for. However, through a detailed assessment,
Payment flow: we found this decision has been proven suboptimal
communication for BCB’s own goals in building Pix. Firstly, it is necessary
between end-users’ to explain how QR Codes work in general and how they
devices/interfaces apply to the Pix scheme.
and the PSPs
4.3.
Lessons from Pix QR CODES ARE TEXT STRINGS ENCODED AS IMAGES.
61
4. The limit of data that is possible to encode as a QR
HOW PIX Code is an issue that deserves attention. Since they
WORKS: PAYMENT
are a special way of encoding text, the more text it is
FLOW
encoded, the bigger the code will be.
4.1.
Payment flow: Take both QR Codes as an example. The one on the
communication left, is a title of a beloved poem written by John Donne. On
between PSPs and the right side, the entire poem is encoded as an image.
the settlement It is possible to observe that the additional characters
chamber make the code much bigger and harder to read with a
medium-quality camera than the QR Code on the left.
4.2.
Payment flow:
communication
between end-users’
devices/interfaces
and the PSPs
4.3.
Lessons from Pix
62
4.
HOW PIX DYNAMIC QR CODE IN THE PIX RAIL
WORKS: PAYMENT
FLOW
4.1.
Payment flow:
communication
between PSPs and 3
the settlement Payer PSP Payee PSP
chamber
4.2. 1
Payment flow: 5
4
communication
between end-users’
devices/interfaces
and the PSPs
4.3. 2
Lessons from Pix Payer Payee
1 The Payee PSP generates a URI containing a domain they own and a UUID. The
presence of a UUID adds a security layer by making it virtually impossible for
anyone to guess the URI, shielding it from attacks. This type of URI is commonly
known as “capability URIs”. After generating the URI, the Payee PSP creates a Pix
QR Code and sends it to the payee.
2 The payee presents the QR Code to the payer, who scans it with their phone
using their Payer PSP app.
3 The Payer PSP app accesses the Payee PSP URI. This communication is secured
by HTTPS and requires a signed response from the Payee PSP to be completed.
It is worth mentioning that the signature must use a previously registered
certificate on a database controlled by the Payment System Operator (BCB, in
the Pix rail).
4 Then, the API call returns all data pertaining to the transaction: account
number, payee identification, and other information that the payee may
find helpful to present to the payer or to help the process of payment
reconciliation.
5 The Payer PSP’s app on the payer’s device sends the routing and additional
information to the Payee PSP’s servers to initiate the money flow.
63
4. This mechanism
HOW PIX
defines a Dynamic QR
WORKS: PAYMENT
FLOW Code in the Pix rail. It is
dynamic because even
Payer PSP
4.1. if the QR Code itself does
Payment flow: not change (it has the
communication same URL), the data the Full name: Mom & Pop‘s
between PSPs and Payee PSP returns to the Routing number: 123456
the settlement
Payer PSP — as shown in Account number:
chamber 789012
step 4 — can be renewed
Bank: Bank Corp
4.2. several times. That Amount: USD 2.70
Payment flow: enables a merchant to Date: Today
communication print and display one QR
between end-users’ Code in front of a cashier CONFIRM
devices/interfaces and update the payment
and the PSPs
information to show the
4.3. amount due by each
Lessons from Pix customer.
S
TATIC QR CODES ARE THE counterpart of
Dynamic Codes. They are called static
because they do not contain a link but rather
the information directly; that means the
amount of data inserted into the image is far more
limited. However, similarly to the Dynamic type, Static
64
4. QR Codes also have a mechanism to ensure the
HOW PIX
integrity of the information about the payee and the
WORKS: PAYMENT
FLOW routing information with a slight difference. Instead
of adding the routing information in plain text, the
4.1. protocol determines that the Static QR Codes must
Payment flow: have a Pix Key so the Payer PSP can obtain the routing
communication information in a trusted source, the Alias Base (DICT).
between PSPs and
the settlement
chamber
4.2.
Payment flow: {
communication “pix_key_type”: “tax_id”,
between end-users’
“pix_key”: “99999999999”,
devices/interfaces
and the PSPs “amount”: 2.7,
“identifier”: “mp-10-06-2022-00050”
4.3. }
Lessons from Pix
65
4.
HOW PIX PAYMENT FLOW: STATIC QR CODE
WORKS: PAYMENT
FLOW
1 The Payee PSP registers the Payee’s Pix Key. Either the
4.1.
Payee PSP, a third party, or the Payee themselves
Payment flow:
generates a Static QR Code, containing optional
communication
between PSPs and fields for an identifyer and a message to the Payer.
the settlement 2 The Payer scans the QR Code using the Payer PSP
chamber app. If the QR Code did not contain a payment
amount, the Payer inputs it.
4.2.
Payment flow: 3 The Payer PSP app sends the Pix key, the optional
communication fields, and the amount to the Payer PSP server.
between end-users’ 4 The Payer PSP accesses the alias database and asks
devices/interfaces for the full routing information associated to the Pix
and the PSPs
Key.
4.3. 5 The alias database provides the full routing
Lessons from Pix information.
6 The Payer PSP sends all the information back to the
payer for confirmation.
7 The payer confirms the transaction.
8 The Payer PSP starts the money flow.
11
4 5
9
8
10
7 3 1 13
6
Payer Payee
66
4. Another benefit of
HOW PIX
Static QR Codes is the
WORKS: PAYMENT
FLOW level of autonomy it gives
payees regarding their
Payer PSP
4.1. PSPs. To implement card
Payment flow: payments, merchants
communication must contact a bank and Full name: Mom & Pop‘s
between PSPs and firm a deal, which can be Routing number: 123456
the settlement Account number: 789012
rather expensive. Then,
chamber Bank: Bank Corp
they have to buy or rent
Amount: USD 2.70
4.2. a specific hardware and Date: Today
Payment flow: follow the operation rules Shopping list:
communication established by the bank. • Bagel – $1.50
between end-users’ Static QR Codes empower • Coffee – $1.00
devices/interfaces • To go – $0.20
merchants and other
and the PSPs
payees to start receiving CONFIRM
67
4. Another pivotal
HOW PIX property of Dynamic QR
WORKS: PAYMENT
Codes is that they can
FLOW
potentially transmit any
Payer PSP
4.1. kind or amount of data
Payment flow: since the QR Code image
communication itself contains nothing Full name: Cool Trip Co.
between PSPs and but an address where Routing number: 123456
the settlement to get the information Account number: 789012
chamber Bank: Bank Corp
the Payer is after. So the
Amount: USD 149.99
4.2. Pix documentation can
Date: Today
Payment flow: easily add features to
Terms ^ Conditions:
communication the Dynamic QR Codes. https: / /cooltrip.co /
between end-users’ One of such features was legal /tos
devices/interfaces the creation of specific
and the PSPs rules to generate and CONFIRM
68
4. Another path to be explored with the flexibility of
HOW PIX
Dynamic QR Codes is the development of over-the-
WORKS: PAYMENT
FLOW top products such as point-of-sale credit, loyalty
programs, as well as other partnerships between Payer
4.1. PSPs and Payee PSPs, without the need to create a new
Payment flow: communication channel, with another integration to
communication develop and maintain.
between PSPs and
the settlement • The possibilities are truly endless. All because of
chamber
two key features:
4.2.
Payment flow: • A URI that contains an address where all the
communication information can be found;
between end-users’
devices/interfaces And a protocol describing how to create additional
and the PSPs fields in a way that any Payee PSP can return arbitrary
information that any Payer PSP can parse and render
4.3. to the payer, no additional integration needed.
Lessons from Pix
It is important knowing that QR Codes should be
understood as mere means of communication along
the payment flow. What is truly important is that the
URI gets to the Payer PSP. If that happens by the payer’s
device scanning a QR Code or any other way should
not be relevant. The same result could be reached with
a connection via Bluetooth, NFC, API, or even through a
Payee PSP-initiated flow with the Settlement Chamber.
They should all work in the exactly same way.
T
HE BRAZILIAN CENTRAL BANK DECIDED to
implement the EMVCo Merchant-Presented
QR Code standard as mandatory for all QR
Codes payments-related, including those in the
context of Pix. The reasoning behind this decision was
the ease of implementing a standard that was already
69
4. in effect across several countries, the concern about
HOW PIX
the emergence of several QR Code standards for each
WORKS: PAYMENT
FLOW payment solution and the international interoperability.
Although the reasons might be understandable, we
4.1. believe they do not justify the use of EMV Co.
Payment flow:
communication Firstly, EMVCo is a form-like QR Code standard with
between PSPs and mandatory and optional fields that then have to be
the settlement mapped out to match the needs of each particular
chamber
payment system. Thus, although the standard exists,
4.2. the effort to unravel the meaning of each field still
Payment flow: burdens the regulators and the institutions that need
communication to implement the extended standard.
between end-users’
devices/interfaces Secondly, the EMVCo standard was created to
and the PSPs encompass a multitude of specific payment use cases,
overspecifying some fields, including the mandatory
4.3.
ones. That means the regulator in charge of setting
Lessons from Pix
the standard must make workarounds to avoid pieces
of the original standard that do not fit perfectly with
the payments system that is being developed. At the
same time, the prolific standard limits the size of other
relevant fields to accommodate unnecessary ones. The
result is an inefficient standard that has too much and
too little data at the same time.
70
4. generating the multi-rail QR Codes. Furthermore, it
HOW PIX
would be possible to do that even in the lack of an
WORKS: PAYMENT
FLOW overarching standard, provided there was a clear
need in the market to do so.
4.1.
Payment flow: On the other hand, a standard tailor-made for
communication Pix would have taken less time to craft and could
between PSPs and have been much more efficient and flexible. Below
the settlement is the table with the Pix Static QR Code fields and the
chamber
corresponding EMVCo fields.
4.2.
Payment flow:
communication
between end-users’ ID Nome BR Code Tam Valor
devices/interfaces Payload Format
00 02 01
and the PSPs Indicator
ID Nome Tam Valor
4.3.
Lessons from Pix Merchant 00 GUI 14 br.gov.bcb.pix
26 Account 58
Informations22 123e4567-e12b-
01 chave 36 12d1-a456-
426655440000
Merchant
52 04 0000 (não unformado)
Category Code
Transaction
53 03 986 (R$)
Currency
58 Country Code 02 BR
59 Merchant Name 13 Fulano de Tal
60 Merchant City 08 BRASILIA
00020126580014br.gov.bcb.pix0136123e4567-e12b-12d1-
a456-4266554400005204000053039865802BR5913Fulano
deTal6008BRASILIA62070503***63041D3D
71
4. Note that the fields merchant category code,
HOW PIX
merchant name, and merchant city are useless for
WORKS: PAYMENT
FLOW the Pix use case since all information comes from
a trusted source, and not the QR Code itself (e.g.,
4.1. the Alias Base or the Payee PSP). In Pix Static QR
Payment flow: Code’s documentation, there are only four pieces of
communication information relevant to the payment:
between PSPs and
the settlement • The Pix Key;
chamber
• The BRL amount;
4.2.
Payment flow: • An additional information field;
communication
• A transaction ID for reconciliation purposes.
between end-users’
devices/interfaces
and the PSPs The superfluous mandatory fields and the
restrictions from the EMVCo standard also limit the
4.3. amount of data that can be stored for those fields that
Lessons from Pix are functionality-defining for Pix. If BCB were to create
a standard based on URIs instead of the EMVCo, the Pix
Static QR Code could look like this:
“https://pay-pix/pix-key/BRL/amount/
“additional-information-field/transaction-id
72
4. or after the amount or if the protocol should be HTTPs
HOW PIX or anything else — are far less relevant to the outcome
WORKS: PAYMENT
we expect with the use of URIs in this context and can
FLOW
be adapted to the proper context of each payment
4.1. system.
Payment flow:
communication Here is an example of the application of such
between PSPs and standard:
the settlement
chamber
4.2.
Payment flow:
communication
between end-users’
devices/interfaces
and the PSPs
mhttps://pay-pix/0136123e4567-e12b-12d1-a456-42665544000/
4.3. mBRL/100/mom-and-pops-cookie/99999999999
Lessons from Pix
As to the Dynamic QR Codes, their content should
be a URI that can be used to access all payment
information directly from the Payee PSP servers. That
means these QR Codes can communicate more
relevant information from a trusted source, which
significantly amplifies the possibilities of applications.
Besides, Dynamic QR Codes allow Payee PSPs to update
the information as convenient for each use case.
hhttps://payee-psp-domain/
“ sub-domain/uuid
73
4. Payee PSPs should register their domains with the
HOW PIX
Payment System Operator so Payer PSPs can validate
WORKS: PAYMENT
FLOW if the URI is related to a participant PSP. Also, the
Dynamic QR Code becomes a capability URL by using
4.1. a UUID as the identification key of the URI. That feature
Payment flow: protects the information the Payee PSP returns to the
communication Payer PSP from enumeration attacks since it is virtually
between PSPs and impossible to guess any valid URI.
the settlement
chamber
4.2.
Payment flow:
communication
between end-users’
devices/interfaces
and the PSPs
bhttps://the-bank/pay-pix/418a34b8-4e5a-11ed-bdc3-
b0242ac120002
4.3.
Lessons from Pix
Because Dynamic QR Codes contain no information
about the payment itself, an additional standardization
is required: a return message from the Payee PSP with
all payment information.
• Amount
• Date
74
4. should be sent on the
HOW PIX
related QR Codes. When
WORKS: PAYMENT
FLOW paying for taxes and
other state fees, the Payer
Payer PSP
4.1. might need to fill out
Payment flow: a form with additional
communication information to guarantee Full name: Mom & Pop‘s
between PSPs and the money will be routed Routing number: 123456
the settlement Account number: 789012
to the correct agency.
chamber Bank: Bank Corp
Amount: USD 2.70
4.2. Even if it were possible
Date: Today
Payment flow: to list all existing payment
Shopping list:
communication use cases and the extra • Bagel – $1.50
between end-users’ fields they may require • Coffee – $1.00
devices/interfaces from the Payments • To go – $0.20
and the PSPs System, the result CONFIRM
would be a convoluted,
4.3.
Lessons from Pix over-specified, over-
engineered, and dated
protocol. It would not take
long until a new use case
is created, and the Payment System protocol would
have to be changed to support it.
75
4. To live up to its full potential, our recommend that
HOW PIX
the additional information field of Dynamic QR Codes
WORKS: PAYMENT
FLOW should follow this schema:
4.1.
Payment flow:
communication {
between PSPs and ‘field’: type,
the settlement
chamber ‘name’: string,
‘value’: string,
4.2. ‘visible’: boolean
Payment flow:
}
communication
between end-users’
devices/interfaces
and the PSPs
It is important that the fields created can accept
4.3. multiple types, as the use cases may have different
Lessons from Pix needs. Apart from that, there are two critical nuances
in this proposal. Although the additional field exists as
an array Pix’s documentation, and they can receive
multiple value types, they do not support the following
functionality.
76
4. Thus, the first nuance
HOW PIX
is to allow for hidden
WORKS: PAYMENT
FLOW fields traveling with the
payment information.
Payer PSP
4.1. That wouldn’t be the only
Payment flow: way for Payee PSPs to
communication communicate with Payer Full name: Cool Trip Co.
between PSPs and PSPs without polluting the Routing number: 123456
the settlement Account number: 789012
payment confirmation
chamber Bank: Bank Corp
screen. Since all the
Amount: USD 149.99
4.2. communications
Date: Today
Payment flow: between Payee PSP and Terms & Conditions:
communication Payer PSP are through https://cooltrip.com/
between end-users’ HTTP protocols and legal/tos
devices/interfaces RESTful APIs, Payee PSPs Accept terms? [ ]
and the PSPs
could (as they can in CONFIRM
77
4.
HOW PIX f. The limits to
WORKS: PAYMENT
FLOW
QR Code application
4.1.
A
Payment flow:
communication
LTHOUGH QR CODE PAYMENTS ARE powerful
between PSPs and
the settlement tools, they have a significant limitation: users
chamber cannot scan their own screens, restricting the
use of QR Codes in mobile commerce.
4.2.
Payment flow: Going back to the basic primitives of payment
communication methods, the core of
between end-users’ any payment initiation
devices/interfaces
is communicating the
and the PSPs
payment information to
4.3. the Payer PSP. To address
Payer PSP
Lessons from Pix this, the Brazilian Central
Bank instructed all PSPs
to create a section on
their app where users Paste the Pix Text Code
78
4. them is the use of payment links for bank-to-bank
HOW PIX transfers. However, the Brazilian Central Bank decided
WORKS: PAYMENT
against creating a mandatory standard for payment
FLOW
links, opting for a more straightforward workaround.
4.1. Before diving into the Pix solution and the payment link
Payment flow: alternative, it is worth explaining the reason behind the
communication BCB’s decision. A parallel with the card industry may
between PSPs and help clarify the matter.
the settlement
chamber As mentioned before, in credit card rails the
payment flow starts necessarily with the merchant
4.2.
Payment flow: through the acquirer. Thus, on m-commerce, the
communication acquirer asks the payer for their card information and
between end-users’ sends the payment request to the card issuer through
devices/interfaces the network's communication system. On bank-to-
and the PSPs bank payments, however, the transaction usually
initiates with the payer, which requires the existence of
4.3.
a protocol so the payment information can travel from
Lessons from Pix
the merchant's website to the Payer PSP.
79
4. necessarily be compatible with the Payer user's
HOW PIX
best interest and the fundamental principles of Pix,
WORKS: PAYMENT
FLOW especially related to increased competition.
80
4. In terms of the front-end adaptation to support the
HOW PIX
payment universal link/app link, it would also not be
WORKS: PAYMENT
FLOW very onerous. As mentioned, the payment confirmation
screens would be exactly like the ones of the QR Code
4.1. flow. The only additional effort this solution would
Payment flow: require is processing the universal link itself in order
communication to trigger the payment confirmation screen and then
between PSPs and redirect the payer back to the merchant's interface.
the settlement
See below one example of how the payment link
chamber
standard could be implemented:
4.2.
Payment flow:
communication
between end-users’ www.payer-psp-domain/standardized-path
devices/interfaces
/qr-code-string/return-url
and the PSPs
4.3.
Lessons from Pix
CONFIRM CONFIRM
81
4. to happen, the Payment System Operator – or any
HOW PIX
other interested party – can define a path to every
WORKS: PAYMENT
FLOW payment link. That would be the case of "pix-link" in the
context of Pix. The way universal/app links work is that
4.1. the Payer PSP would register a universal link/app link
Payment flow: such as “www.payer-psp.com.br/pix-link/*” so that all
communication links following that pattern prompt the app to open.
between PSPs and This registration varies depending on the Operating
the settlement
System and is common knowledge among mobile
chamber
front-end specialists. It is what guarantees app-to-
4.2. app communication. Once the app is prompted by
Payment flow: the payment link call, the Payer PSP app would be
communication configured to process the link and navigate through
between end-users’ the appropriate screens.
devices/interfaces
and the PSPs The link also contains the QR Code string, which in
the context of Pix is an EMVCo-compliant data form
4.3.
Lessons from Pix (the copy/paste text code mentioned above). However,
in the alternative proposal detailed above the string
could be a RFC 3986-compliant URI. In any case,
either the link or the URI should contain what the Payer
PSP app would extract from the image if they were
scanning the QR Code. After being prompted to open,
the Payer PSP app would obtain the QR Code string
from the payment link and process it as if it was a QR
Code scanning or a copy/paste operation.
82
4. guarantee should rest on the source of the data –
HOW PIX
either the PSP or a centralized alias base.
WORKS: PAYMENT
FLOW
However, this approach can make sense depending
4.1. on the specific requirements around how payment
Payment flow: orders can be generated. See below two examples of
communication how it could succeed:
between PSPs and
the settlement
chamber
https://payer-psp.com.br/pix-link
/00020126580014br.gov.bcb.
pix0136123e4567-e12b-12d1-a456-
4266554400005204000053039865802BR5913Fula
no deTal6008BRASILIA62070503***63041D3D
/www.payee-psp.com.br/return-url/6a101a34-
82ed-4dbd-b734-0b85e63fbd6c
/fc11bbe5-180a-462d-b33f-56df7d61fb02
83
4.
HOW PIX g. Beyond QR Codes
WORKS: PAYMENT
T
FLOW
84
4. The first solution is how the Brazilian Central Bank
HOW PIX
is implementing direct debit into Pix. The second
WORKS: PAYMENT
FLOW approach is often used in Open Finance ecosystems.
85
4.
HOW PIX
WORKS: PAYMENT
FLOW
4.3.
4.1.
Payment flow:
LESSONS
communication
between PSPs and
the settlement
FROM PIX
chamber
P
4.2.
Payment flow: IX’S PAYMENT FLOW HAS UNDOUBTEDLY
communication
proven its success. There are a few minor
between end-users’
improvements that could be made,
devices/interfaces
and the PSPs such as:
86
REFERENCES
87
AUTHORS
MARIANA
CUN HA E M E LO
88
AUTHORS
JONAS
ABREU
89
ABOUT CTPI
T
HE CENTER FOR TECHNOLOGY AND Public Interest
is a subscription-based research center. We are
here to transform the future of the tech industry
through information, training, and research
toward a systemic and sustainable approach to
technology. Our purpose is to bridge the gap between
technology, business, and regulation to create
systemic and sustainable solutions to the problems
that neither the industry nor the regulation can solve
on their own.
www.ctpi.io
https://www.linkedin.com/company/ctpi-io/
Email addresses:
Address:
90