fastpay - cl.cam.ac.uk

74
FastPay High-Performance Byzantine Fault Tolerant Settlement

Upload: others

Post on 03-Dec-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: fastpay - cl.cam.ac.uk

FastPayHigh-Performance Byzantine Fault Tolerant Settlement

Page 2: fastpay - cl.cam.ac.uk

RTGSA simplified view

Page 3: fastpay - cl.cam.ac.uk

RTGSA simplified view

Very centralized

Low capacity (expensive)

Page 4: fastpay - cl.cam.ac.uk

RTGSA simplified view

TPS: 500 tx/s

Latency: minutes

Page 5: fastpay - cl.cam.ac.uk

RTGSA simplified view

TPS: 80,000 tx/s

Latency: seconds

TPS: 500 tx/s

Latency: minutes

Page 6: fastpay - cl.cam.ac.uk

RTGSA simplified view

Promises of payment Settlement

Page 7: fastpay - cl.cam.ac.uk

RTGSA simplified view

Fast settlement

Page 8: fastpay - cl.cam.ac.uk

RTGSA simplified view

BFT resilience

High capacity (cheap)

Page 9: fastpay - cl.cam.ac.uk

Byzantine Fault Tolerance

> 2/3

Page 10: fastpay - cl.cam.ac.uk

In summary

• Low latency

• BFT reliance

• Fast finality

• Hight capacity

Current industryWhat we want

• Low latency (not settled)

• Centralized

• Slow finality

• Hight capacity (not settled)

Page 11: fastpay - cl.cam.ac.uk

This requires extremely low latency

Make it practical for retail payment at physical points of sale

Page 12: fastpay - cl.cam.ac.uk

FastPayAcknowledgments

Mathieu Baudet George Danezis Alberto Sonnino

Facebook Novi

Page 13: fastpay - cl.cam.ac.uk

Primary

FastPayOverview

Page 14: fastpay - cl.cam.ac.uk

Primary

FastPayOverview

Page 15: fastpay - cl.cam.ac.uk

FastPay 1

FastPay 2

FastPay 3

Primary

Overview

Page 16: fastpay - cl.cam.ac.uk

Difference with blockchains

Blockchains FastPay

Byzantine Consensus Byzantine Consistent Broadcast

Page 17: fastpay - cl.cam.ac.uk

FastPayHow does it work?

sender

recipient

Page 18: fastpay - cl.cam.ac.uk

FastPayHow does it work?

sender

recipient

1. transfer order

Page 19: fastpay - cl.cam.ac.uk

FastPayHow does it work?

sender

recipient

1. transfer order

2. verify

& lock

Page 20: fastpay - cl.cam.ac.uk

FastPayHow does it work?

sender

recipient

3. signed transfer order

1. transfer order

2. verify

& lock

Page 21: fastpay - cl.cam.ac.uk

FastPayHow does it work?

sender

recipient

3. signed transfer order

4. confirmation order

5. confirmation order 6. confirmation order

1. transfer order

2. verify

& lock

Page 22: fastpay - cl.cam.ac.uk

FastPayHow does it work?

sender

recipient

1. transfer order

3. signed transfer order

4. confirmation order

5. confirmation order 6. confirmation order

2. verify

& lock

7. update

& unlock

Page 23: fastpay - cl.cam.ac.uk

FastPayIncreasing capacity

s

r

1.

3.

4.

5. 6.

2.

7.

7.7.s

r

s

r

s

r

Page 24: fastpay - cl.cam.ac.uk

FastPayUsing proxies

s r

1. transfer order

3.

4.

2.

1. transfer order

7. signature with

smart card

Page 25: fastpay - cl.cam.ac.uk

FastPayUsing proxies

s r

1. transfer order

3.

4.

2.

1. transfer order

7.

Physical point of sale

Page 26: fastpay - cl.cam.ac.uk

FastPayUsing proxies

s r

1.

3.

4. confirmation order

2.

1.

7.

Anyone can aggregate and broadcast confirmation

orders by reading the authorities' state

Page 27: fastpay - cl.cam.ac.uk

Validity

No duplication

Integrity

Consistency

Byzantine Consistent Broadcast

Page 28: fastpay - cl.cam.ac.uk

• Last primary tx index

FastPayAuthorities' state

• Verification key

• Balance

• Sequence number

• Last transfer order

• List of certificates and synchronization orders

Each accountAuthorities

• Authority name and keys

• Committee information

• Accounts information

Page 29: fastpay - cl.cam.ac.uk

FastPayClients' state

• Their account's address

• Their secret key

• Committee information

• Last sequence number

• Last signed transfer order

Page 30: fastpay - cl.cam.ac.uk

FastPayInterface it with a primary infrastructure

ssc

Smart Contract's state

• "Redeem log"

• The committee information

• Total funds in the contract

• Last primary tx index

Page 31: fastpay - cl.cam.ac.uk

FastPayFrom primary infrastructure to FastPay

sender smart contract

1. funding transaction

Page 32: fastpay - cl.cam.ac.uk

FastPayFrom primary infrastructure to FastPay

sender smart contract

1. funding transaction

2. synchronization order

Page 33: fastpay - cl.cam.ac.uk

FastPayFrom primary infrastructure to FastPay

sender smart contract

1. funding transaction

2. synchronization order

3. verify & update

Page 34: fastpay - cl.cam.ac.uk

FastPayInterface it with a primary infrastructure

Smart Contract's state

• "Redeem log"

• The committee information

• Total funds in the contract

• Last primary tx index

ssc

Page 35: fastpay - cl.cam.ac.uk

FastPayFrom the primary infrastructure to FastPay

sender

1. transfer order

smart contract

Page 36: fastpay - cl.cam.ac.uk

FastPayFrom the primary infrastructure to FastPay

sender

1. transfer order2. verify

smart contract

Page 37: fastpay - cl.cam.ac.uk

FastPayFrom the primary infrastructure to FastPay

sender

1. transfer order

3. signed transfer order

2. verify

smart contract

Page 38: fastpay - cl.cam.ac.uk

FastPayFrom the primary infrastructure to FastPay

sender

1. transfer order

3. signed transfer order

4. confirmation order

2. verify

smart contract

Page 39: fastpay - cl.cam.ac.uk

FastPayFrom the primary infrastructure to FastPay

sender

1. transfer order

3. signed transfer order

4. confirmation order

2. verify

5. update

smart contract

Page 40: fastpay - cl.cam.ac.uk

FastPayFrom the primary infrastructure to FastPay

sender

1. transfer order

3. signed transfer order

4. confirmation order

6. redeem transaction

2. verify

5. update

smart contract7. verify & update

Page 41: fastpay - cl.cam.ac.uk

FastPay

• Written in Rust

• Networking: Tokio & UDP

• Cryptography: ed25519-dalek

https://github.com/novifinancial/fastpay

Implementation

Page 42: fastpay - cl.cam.ac.uk

FastPayThroughput Evaluation

Page 43: fastpay - cl.cam.ac.uk

FastPayHigh concurrency

Figure 5: Variation of the throughput of transfer orders with the number ofshards, for various levels of concurrency (in-flight parameter). The measure-ments are run under a total load of 1M transactions.

less than 4,000 USD/month per authority5.

Robustness and performance under total system load.Figures 11 and 12 (see Appendix C) show the variation ofthe throughput of transfer and confirmation orders with thenumber of shards, for various total system loads—namelythe total number of transactions in the test; they show thatthe throughput is not affected by the system load. The testswere performed with 4 authorities, and the client concurrencyin-flight parameter set to 1,000. These figures illustrate thatFastPay can process about 160,000 transactions per secondeven under a total load of 1.5M transactions, and that the totalload does not significantly affect performance. These supple-ment figures 5 and 6 that illustrate the concurrent transactionrate (in-flight parameter) also does not influence performancesignificantly (except when it is too low by under-utilizing thesystem).

Readers may be surprised those measurements are key.The key measurement work by Han et al. [23] compares anumber of permissioned systems under a high load, and showsthat for all of Hyperledger Fabric (v0.6 with PBFT) [26],Hyperledger Fabric (v1.0 with BFT-Smart) [27], Ripple [15]and R3 Corda v3.2 [39] the successful requests per seconddrops to zero as the transaction rate increases to more than afew thousands transactions per second (notably for Corda onlya few hundred). An important exception is Tendermint [10],that maintains a processed transaction rate of about 4,000to 6,000 transactions per second at a high concurrency rate.Those findings were confirmed for Hyperledger Fabric thatreportedly starts saturating at a rate of 10,000 transactions persecond [34]. Our results demonstrate that FastPay continuesto be very performant even under the influence of extremely

5AWS reports a price of 5.424 USD/hour for their m5d.metal instances.https://aws.amazon.com/ec2/pricing/on-demand (January 2020)

Figure 6: Variation of the throughput of confirmation orders with the numberof shards, for various levels of concurrency (in-flight parameter). The certifi-cates are issued by 4 authorities, and the measurements are run under a totalload of 1M transactions.

high rates of concurrent transactions (in-flight parameter) andoverall work load (total number of transactions processed), asexpected. This is apparently not the norm.

Influence of the number of authorities. As discussed inSection 4, we expect that increasing the number of authoritiesonly impacts the throughput of confirmation orders (that needto transfer and check transfer certificates signed by 2 f + 1authorities), and not the throughput of transfer orders. Fig-ure 7 confirms that the the throughput of confirmation ordersdecreases as the number of authorities increases. FastPaycan still process about 80,000 transactions per second with20 authorities (for 75 shards). The measurements are takenwith an in-flight concurrency parameter set to 1,000, and un-der a load of 1M total transactions. We note that for highernumber of authorities, using an aggregate signature scheme(e.g. BLS [8]) would be preferable since it would result inconstant time verification and near-constant size certificates.However, due to the use of batch verification of signatures,the break even point may be after 100 authorities in terms ofverification time.

7.3 LatencyWe measure the variation of the client-perceived latency withthe number of authorities. We deploy several FastPay multi-shard authorities on Amazon Web Services (all in Stockholm,eu-north-1 zone), each on a m5d.8xlarge instance. This classof instance guarantees 10Gbit network capacity, on a 3.1 GHz,Intel Xeon Platinum 8175 with 32 cores, and 128 GB memory.The operating system is Linux Ubuntu server 16.04. Eachinstance is configured to run 15 shards. The client is run on anApple laptop (MacBook Pro) with a 2.9 GHz Intel Core i9 (6physical and 12 logical cores), and 32 GB 2400 MHz DDR4

10

1. transfer order

tran

sact

ions

per

sec

ond

number of processes

Page 44: fastpay - cl.cam.ac.uk

Figure 5: Variation of the throughput of transfer orders with the number ofshards, for various levels of concurrency (in-flight parameter). The measure-ments are run under a total load of 1M transactions.

less than 4,000 USD/month per authority5.

Robustness and performance under total system load.Figures 11 and 12 (see Appendix C) show the variation ofthe throughput of transfer and confirmation orders with thenumber of shards, for various total system loads—namelythe total number of transactions in the test; they show thatthe throughput is not affected by the system load. The testswere performed with 4 authorities, and the client concurrencyin-flight parameter set to 1,000. These figures illustrate thatFastPay can process about 160,000 transactions per secondeven under a total load of 1.5M transactions, and that the totalload does not significantly affect performance. These supple-ment figures 5 and 6 that illustrate the concurrent transactionrate (in-flight parameter) also does not influence performancesignificantly (except when it is too low by under-utilizing thesystem).

Readers may be surprised those measurements are key.The key measurement work by Han et al. [23] compares anumber of permissioned systems under a high load, and showsthat for all of Hyperledger Fabric (v0.6 with PBFT) [26],Hyperledger Fabric (v1.0 with BFT-Smart) [27], Ripple [15]and R3 Corda v3.2 [39] the successful requests per seconddrops to zero as the transaction rate increases to more than afew thousands transactions per second (notably for Corda onlya few hundred). An important exception is Tendermint [10],that maintains a processed transaction rate of about 4,000to 6,000 transactions per second at a high concurrency rate.Those findings were confirmed for Hyperledger Fabric thatreportedly starts saturating at a rate of 10,000 transactions persecond [34]. Our results demonstrate that FastPay continuesto be very performant even under the influence of extremely

5AWS reports a price of 5.424 USD/hour for their m5d.metal instances.https://aws.amazon.com/ec2/pricing/on-demand (January 2020)

Figure 6: Variation of the throughput of confirmation orders with the numberof shards, for various levels of concurrency (in-flight parameter). The certifi-cates are issued by 4 authorities, and the measurements are run under a totalload of 1M transactions.

high rates of concurrent transactions (in-flight parameter) andoverall work load (total number of transactions processed), asexpected. This is apparently not the norm.

Influence of the number of authorities. As discussed inSection 4, we expect that increasing the number of authoritiesonly impacts the throughput of confirmation orders (that needto transfer and check transfer certificates signed by 2 f + 1authorities), and not the throughput of transfer orders. Fig-ure 7 confirms that the the throughput of confirmation ordersdecreases as the number of authorities increases. FastPaycan still process about 80,000 transactions per second with20 authorities (for 75 shards). The measurements are takenwith an in-flight concurrency parameter set to 1,000, and un-der a load of 1M total transactions. We note that for highernumber of authorities, using an aggregate signature scheme(e.g. BLS [8]) would be preferable since it would result inconstant time verification and near-constant size certificates.However, due to the use of batch verification of signatures,the break even point may be after 100 authorities in terms ofverification time.

7.3 LatencyWe measure the variation of the client-perceived latency withthe number of authorities. We deploy several FastPay multi-shard authorities on Amazon Web Services (all in Stockholm,eu-north-1 zone), each on a m5d.8xlarge instance. This classof instance guarantees 10Gbit network capacity, on a 3.1 GHz,Intel Xeon Platinum 8175 with 32 cores, and 128 GB memory.The operating system is Linux Ubuntu server 16.04. Eachinstance is configured to run 15 shards. The client is run on anApple laptop (MacBook Pro) with a 2.9 GHz Intel Core i9 (6physical and 12 logical cores), and 32 GB 2400 MHz DDR4

10

FastPayHigh concurrency

4. 5. 6. confirmation order

number of processes

tran

sact

ions

per

sec

ond

Page 45: fastpay - cl.cam.ac.uk

fn handle_cross_shard_commit(a, C) -> Result {

let O = value(C);let recipient = match recipient(O) {

Address::FastPay(recipient) => recipient ,

Address::Primary(_) => { bail!(); }

};

ensure!(a.in_shard(recipient));let recipient_account = accounts(a).get(recipient)

.or_insert(AccountState::new());

recipient_account.balance += amount(O);Ok()

}

fn handle_primary_synchronization_order(a, S) -> Result {

/// Update recipient(S) assuming that S comes from

/// a trusted source (e.g. Primary client).

let recipient = recipient(S);ensure!(a.in_shard(recipient));

if transaction_index(S) <= last_transaction(a) {

/// Ignore old synchronization orders.

return Ok();

}

ensure!(transaction_index(S) == last_transaction(a) + 1);

last_transaction(a) += 1;

let recipient_account = accounts(a).get(recipient).or_insert(AccountState::new());

recipient_account.balance += amount(S);recipient_account.synchronized.push(S);Ok()

}

Figure 10: Authority algorithms for cross-shard updates and (Primary) syn-chronization orders.

Figure 11: Variation of the throughput of transfer orders with the number ofshards, for various loads. The in-flight parameter is set to 1,000.

Figure 12: Variation of the throughput of confirmation orders with the numberof shards, for various loads. The certificates are issued by 4 authorities, andthe in-flight parameter is set to 1,000.

17

FastPayRobustness

1. transfer order

number of processes

tran

sact

ions

per

sec

ond

Page 46: fastpay - cl.cam.ac.uk

fn handle_cross_shard_commit(a, C) -> Result {

let O = value(C);let recipient = match recipient(O) {

Address::FastPay(recipient) => recipient ,

Address::Primary(_) => { bail!(); }

};

ensure!(a.in_shard(recipient));let recipient_account = accounts(a).get(recipient)

.or_insert(AccountState::new());

recipient_account.balance += amount(O);Ok()

}

fn handle_primary_synchronization_order(a, S) -> Result {

/// Update recipient(S) assuming that S comes from

/// a trusted source (e.g. Primary client).

let recipient = recipient(S);ensure!(a.in_shard(recipient));

if transaction_index(S) <= last_transaction(a) {

/// Ignore old synchronization orders.

return Ok();

}

ensure!(transaction_index(S) == last_transaction(a) + 1);

last_transaction(a) += 1;

let recipient_account = accounts(a).get(recipient).or_insert(AccountState::new());

recipient_account.balance += amount(S);recipient_account.synchronized.push(S);Ok()

}

Figure 10: Authority algorithms for cross-shard updates and (Primary) syn-chronization orders.

Figure 11: Variation of the throughput of transfer orders with the number ofshards, for various loads. The in-flight parameter is set to 1,000.

Figure 12: Variation of the throughput of confirmation orders with the numberof shards, for various loads. The certificates are issued by 4 authorities, andthe in-flight parameter is set to 1,000.

17

FastPayRobustness

4. 5. 6. confirmation order

number of processes

tran

sact

ions

per

sec

ond

Page 47: fastpay - cl.cam.ac.uk

Figure 7: Variation of the throughput of confirmation orders with the numberof authorities, for various number of shards. The in-flight parameter is set to1,000 and the system load is of 1M transactions.

RAM; and connected to a reliable WIFI network. We runexperiments with the client in two different locations; (i) in theU.K. (geographically close to the authorities, same continent),and (ii) in the U.S. West Coast (geographically far from theauthorities, different continent). Each measurement is theaverage of 300 runs, and the error bars represent one standarddeviation; all experiments use our UDP implementation.

We observe that the client-authority WAN latency is lowfor both transfer and confirmation orders; the latency is under200ms when the client is in the U.S. West Coast, and about50ms when the client is in the U.K. Figure 8 illustratesthe latency between a client creating and sending a transferorder to all authorities, and receiving sufficient signaturesto form a transfer certificate (in our experiment we wait forall authorities to reply to measure the worse case where fauthorities are Byzantine). The latency is virtually constantas we increase the number of authorities, due to the clientemitting orders asynchronously to all authorities and waitingfor responses in parallel.

Figure 9 illustrates the latency to submit a confirmationorder, and wait for all authorities to respond with a successmessage. It shows latency is virtually constant when increas-ing the number of authorities. This indicates that the latencyis largely dominated by the network (and not by the verifica-tion of certificates). However, since even for 10 authoritiesa FastPay message fits within a network MTU, the variationis very small. Due to our choice of using UDP as a transportthere is no connection initiation delay (as for TCP), but wemay observe packet loss under very high congestion condi-tions. Authority commands are idempotent to allow clients tore-transmit to overcome loss without sacrificing safety.

Performance under failures. Research literature suggestspermissioned blockchains based on (often leader-based) con-sensus suffer an enormous performance drop when some

Figure 8: Variation of the latency of transfer orders with the number ofauthorities, for various locations of the client.

Figure 9: Variation of the latency of confirmation orders with the number ofauthorities, for various locations of the client.

authorities fail [30]. We measure the effect of authority fail-ure in FastPay and show that latency is not affected when for fewer authorities are unavailable.

f Latency(ms ± std)

0 43±21 41±32 44±43 47±2

Table 2: Crash-failureLatency.

We run our baseline experimen-tal setup (10 authorities distributedover 10 different AWS instances),when a different number of author-ities are not available for f = 0 . . .3.We measure the latency experiencedby a client on the same continent (Eu-rope), sending a transfer order until itforms a valid transfer certificate. Ta-ble 2 summarizes the mean latencyand standard deviation for differentf . There is no statistically significant difference in latency, nomatter how many tolerable failures FastPay experiences (up tof 3 for 10 authorities). We also experimented with killing

11

FastPayInfluence of the number of authorities

4. 5. 6. confirmation order

tran

sact

ions

per

sec

ond

committee size

Page 48: fastpay - cl.cam.ac.uk

FastPayLatency setup

Page 49: fastpay - cl.cam.ac.uk

Figure 7: Variation of the throughput of confirmation orders with the numberof authorities, for various number of shards. The in-flight parameter is set to1,000 and the system load is of 1M transactions.

RAM; and connected to a reliable WIFI network. We runexperiments with the client in two different locations; (i) in theU.K. (geographically close to the authorities, same continent),and (ii) in the U.S. West Coast (geographically far from theauthorities, different continent). Each measurement is theaverage of 300 runs, and the error bars represent one standarddeviation; all experiments use our UDP implementation.

We observe that the client-authority WAN latency is lowfor both transfer and confirmation orders; the latency is under200ms when the client is in the U.S. West Coast, and about50ms when the client is in the U.K. Figure 8 illustratesthe latency between a client creating and sending a transferorder to all authorities, and receiving sufficient signaturesto form a transfer certificate (in our experiment we wait forall authorities to reply to measure the worse case where fauthorities are Byzantine). The latency is virtually constantas we increase the number of authorities, due to the clientemitting orders asynchronously to all authorities and waitingfor responses in parallel.

Figure 9 illustrates the latency to submit a confirmationorder, and wait for all authorities to respond with a successmessage. It shows latency is virtually constant when increas-ing the number of authorities. This indicates that the latencyis largely dominated by the network (and not by the verifica-tion of certificates). However, since even for 10 authoritiesa FastPay message fits within a network MTU, the variationis very small. Due to our choice of using UDP as a transportthere is no connection initiation delay (as for TCP), but wemay observe packet loss under very high congestion condi-tions. Authority commands are idempotent to allow clients tore-transmit to overcome loss without sacrificing safety.

Performance under failures. Research literature suggestspermissioned blockchains based on (often leader-based) con-sensus suffer an enormous performance drop when some

Figure 8: Variation of the latency of transfer orders with the number ofauthorities, for various locations of the client.

Figure 9: Variation of the latency of confirmation orders with the number ofauthorities, for various locations of the client.

authorities fail [30]. We measure the effect of authority fail-ure in FastPay and show that latency is not affected when for fewer authorities are unavailable.

f Latency(ms ± std)

0 43±21 41±32 44±43 47±2

Table 2: Crash-failureLatency.

We run our baseline experimen-tal setup (10 authorities distributedover 10 different AWS instances),when a different number of author-ities are not available for f = 0 . . .3.We measure the latency experiencedby a client on the same continent (Eu-rope), sending a transfer order until itforms a valid transfer certificate. Ta-ble 2 summarizes the mean latencyand standard deviation for differentf . There is no statistically significant difference in latency, nomatter how many tolerable failures FastPay experiences (up tof 3 for 10 authorities). We also experimented with killing

11

FastPayLatency

1. transfer order

late

ncy

(ms)

committee size

Page 50: fastpay - cl.cam.ac.uk

Figure 7: Variation of the throughput of confirmation orders with the numberof authorities, for various number of shards. The in-flight parameter is set to1,000 and the system load is of 1M transactions.

RAM; and connected to a reliable WIFI network. We runexperiments with the client in two different locations; (i) in theU.K. (geographically close to the authorities, same continent),and (ii) in the U.S. West Coast (geographically far from theauthorities, different continent). Each measurement is theaverage of 300 runs, and the error bars represent one standarddeviation; all experiments use our UDP implementation.

We observe that the client-authority WAN latency is lowfor both transfer and confirmation orders; the latency is under200ms when the client is in the U.S. West Coast, and about50ms when the client is in the U.K. Figure 8 illustratesthe latency between a client creating and sending a transferorder to all authorities, and receiving sufficient signaturesto form a transfer certificate (in our experiment we wait forall authorities to reply to measure the worse case where fauthorities are Byzantine). The latency is virtually constantas we increase the number of authorities, due to the clientemitting orders asynchronously to all authorities and waitingfor responses in parallel.

Figure 9 illustrates the latency to submit a confirmationorder, and wait for all authorities to respond with a successmessage. It shows latency is virtually constant when increas-ing the number of authorities. This indicates that the latencyis largely dominated by the network (and not by the verifica-tion of certificates). However, since even for 10 authoritiesa FastPay message fits within a network MTU, the variationis very small. Due to our choice of using UDP as a transportthere is no connection initiation delay (as for TCP), but wemay observe packet loss under very high congestion condi-tions. Authority commands are idempotent to allow clients tore-transmit to overcome loss without sacrificing safety.

Performance under failures. Research literature suggestspermissioned blockchains based on (often leader-based) con-sensus suffer an enormous performance drop when some

Figure 8: Variation of the latency of transfer orders with the number ofauthorities, for various locations of the client.

Figure 9: Variation of the latency of confirmation orders with the number ofauthorities, for various locations of the client.

authorities fail [30]. We measure the effect of authority fail-ure in FastPay and show that latency is not affected when for fewer authorities are unavailable.

f Latency(ms ± std)

0 43±21 41±32 44±43 47±2

Table 2: Crash-failureLatency.

We run our baseline experimen-tal setup (10 authorities distributedover 10 different AWS instances),when a different number of author-ities are not available for f = 0 . . .3.We measure the latency experiencedby a client on the same continent (Eu-rope), sending a transfer order until itforms a valid transfer certificate. Ta-ble 2 summarizes the mean latencyand standard deviation for differentf . There is no statistically significant difference in latency, nomatter how many tolerable failures FastPay experiences (up tof 3 for 10 authorities). We also experimented with killing

11

FastPayLatency

4. 5. 6. confirmation order

late

ncy

(ms)

committee size

Page 51: fastpay - cl.cam.ac.uk

Worst-case efficiency

Blockchains FastPay

Bad leader can slow down the protocol

No leader, nothing changes

Page 52: fastpay - cl.cam.ac.uk

FastPayThe cost of simplicity

• Less than 4,000 LOC

• Over 1,500 Git commits

• Took 2.5 months to 3 engineers

Page 53: fastpay - cl.cam.ac.uk

FastPayDeployment costs

• AWS m5d.8xlarge instance

• ~ 5 USD / hour

Page 54: fastpay - cl.cam.ac.uk

FastPayFurther works

• Checkpointing?

• Change the authorities?

• Privacy?

Page 55: fastpay - cl.cam.ac.uk

Conclusion

• Paper: https://arxiv.org/abs/2003.11506

• Code: https://github.com/novifinancial/fastpay

• Based on Byzantine Consistent Broadcast

• Simple design, low latency, high capacity, very robust

FastPay

Page 56: fastpay - cl.cam.ac.uk

[email protected] Sonnino

Page 57: fastpay - cl.cam.ac.uk

EXTRA

Page 58: fastpay - cl.cam.ac.uk

Protocol DetailsFrom FastPay to FastPay

Page 59: fastpay - cl.cam.ac.uk

FastPayProtocol details

s

r

1.

3.

4.

5. 6.

2.

7.

• Sender address

• Recipient address

• Amount

• Sequence number

• Sender's signature

1. transfer order

Page 60: fastpay - cl.cam.ac.uk

FastPayProtocol details

s

r

1.

3.

4.

5. 6.

2.

7.

2. verify

• The sender's signature

• No previous tx is pending

• The amount is positive

• Sequence number is as expected

• Balance is sufficient

Page 61: fastpay - cl.cam.ac.uk

FastPayProtocol details

s

r

1.

3.

4.

5. 6.

2.

7.

3. signed transfer order• Each authority signed the transfer

order received in step 1.

Page 62: fastpay - cl.cam.ac.uk

FastPayProtocol details

s

r

1.

3.

4.

5. 6.

2.

7.

4. 5. 6. confirmation order• Collect enough signed transfer

orders from step 2.

Page 63: fastpay - cl.cam.ac.uk

FastPayProtocol details

s

r

1.

3.

4.

5. 6.

2.

7.

7. update• Check there are enough signatures

• Decrease the senders' balance

• Increase the sequence number

• Set the pending order to None

• Increase the recipient's balance

Page 64: fastpay - cl.cam.ac.uk

Protocol DetailsFrom FastPay to primary infrastructure

Page 65: fastpay - cl.cam.ac.uk

FastPayFrom FastPay to primary infrastructure

s

sc

1.

3.

4.

6.

2.

5.

• Sender address

• Recipient address

• Amount

• Sequence number

• Sender's signature

1. transfer order

7.

Page 66: fastpay - cl.cam.ac.uk

FastPayFrom FastPay to primary infrastructure

s

sc

1.

3.

4.

6.

2.

5.

2. verify

• The sender's signature

• No previous tx is pending

• The amount is positive

• Sequence number is as expected

• Balance is sufficient

7.

Page 67: fastpay - cl.cam.ac.uk

FastPayFrom FastPay to primary infrastructure

s

sc

1.

3.

4.

6.

2.

5.

3. signed transfer order• Each authority signed the transfer

order received in step 1.

7.

Page 68: fastpay - cl.cam.ac.uk

FastPayFrom FastPay to primary infrastructure

s

sc

1.

3.

4.

6.

2.

5.

4. 6. confirmation order• Collect enough signed transfer

orders from step 2.

7.

Page 69: fastpay - cl.cam.ac.uk

FastPayFrom FastPay to primary infrastructure

s

sc

1.

3.

4.

6.

2.

5.

5. update

• Check there are enough signatures

• Decrease the senders' balance

• Increase the sequence number

• Set the pending order to None

7.

Page 70: fastpay - cl.cam.ac.uk

FastPayFrom FastPay to primary infrastructure

s

sc

1.

3.

4.

6.

2.

5.

7. verify & update

• Check sequence number is not on the redeem log

• Update the redeem log

• Transfer the amount to recipient

7.

Page 71: fastpay - cl.cam.ac.uk

Protocol DetailsFrom primary infrastructure to FastPay

Page 72: fastpay - cl.cam.ac.uk

FastPayFrom primary infrastructure to FastPay

ssc

1.

2.3.

• FastPay recipient

• All fields required by the primary infrastructure (and the amount)

1. funding transaction

Page 73: fastpay - cl.cam.ac.uk

FastPayFrom primary infrastructure to FastPay

ssc

1.

2.3.

• Read the transaction on the primary infrastructure (once it is sequenced)

2. synchronization order

Page 74: fastpay - cl.cam.ac.uk

FastPayFrom primary infrastructure to FastPay

ssc

1.

2.3.

• Check last primary tx index

• Increment last primary tx index

• Create a FastPay account for the recipient (if needed)

• Increase recipient's balance

3. update & verify