fuel-v1-contracts icon indicating copy to clipboard operation
fuel-v1-contracts copied to clipboard

Fuel V1.5 | Aggregate Signature and Compressed Transaction Format

Open SilentCicero opened this issue 4 years ago • 0 comments

Changes

  • Integrate BLS Aggregate Signatures
  • Integrate Compressed transaction format

Abstract

This PR outlines Fuel's first steps toward 2400 TPS using BLS aggregate signatures. Here we introduce a new compressed 24 byte transaction format, in addition to BLS aggregate signatures. Combined we were able to achieve 4-5x performance gains over our previous 1.0 model.

We were able to modify our existing Fuel v1.0 model to support a new transaction and signing format.

Benchmarks

For 100k transactions, we only occupied ~3-4 Ethereum blocks total (12.5m - 8m). Which is a significant reduction over our previous 100k benchmark.

Transactions Submitted: 100000
Roots committed: 75
Blocks committed: 1
Cumulative gas used: 32590481
Ethereum blocks used: 3
@100 Gwei: 3.2590481 ETH

Benchmarked Here on Ropsten: https://ropsten.etherscan.io/address/0x9ac1b016f9ab5aa877ea421291d33903625ecaf6

Root Header

Here we introduce our new root header format to support compressed BLS aggregated signatures.

mstruct RootHeader (
      producer: address,
      merkleTreeRoot: bytes32,
      commitmentHash: bytes32,
      length: uint256,
      feeToken: uint256,
      fee: uint256,

      // Added for compressed transaction and BLS signature support
      transactionType: uint256,
      signatureHash: bytes32
)

Packed Transaction Format

mstruct PackedTransfer (
      metadata: bytes8,
      from: uint32,
      to: uint32,
      transferAmount: uint32,
      changeAmount: uint32
    )

Message Format (for BLS Signatures)

Below is the transaction data to be signed over.

abi.encode(bytes32(packedTransfer), uint256(fee), uint256(rootFee));

Transaction Chunks

The roots are divided into chunks of transactions each containing 32 transactions. Each 32 transaction chunk contains the 2 word BLS aggregate signature for that chunk.

Address Registration

BLS public keys are registered using commitAddress by providing the 4 words in addition to their Ethereum address for registration.

This will be scraped in upcoming versions for a merkle proof oriented solution similar to Hubble's.

SilentCicero avatar Aug 26 '20 00:08 SilentCicero