Skip to content

Commit

Permalink
add summary
Browse files Browse the repository at this point in the history
  • Loading branch information
doc-hex committed Nov 22, 2023
1 parent 95db752 commit e685144
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 2 additions & 0 deletions BBQr.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# The BBQr Protocol - Make a series of QR codes to hold lots of data

Public Domain by [Coinkite](https://coinkite.com)

## Introduction

This protocol is for transmitting binary data over a series of QR codes.
Expand Down
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,43 @@ Project Status: **New & proposed --- looking for feedback**

# Specification

See [BBQr.md](BBQr.md).
See full spec [BBQr.md](BBQr.md).

# Summary

This protocol enables files larger than can fit into a single QR
to be sent as a series of QR codes (an "animated QR"). The target
file types are PSBT (BIP-174) and signed Bitcoin transactions, but
it also supports CBOR, JSON and Text options for general purpose use.

We carefully consider the data inside QR codes, and apply a
deep knowledge of how QR codes work, so that no pixel nor byte
is ever wasted! Internally it supports HEX and Base2 serializations
and a constrained ZLIB option for data compression. This is all
done with an eye to embedded implementations on very contrained
devices (ie. hardware wallets), which may not have enough memory
to keep more than a single QR code around.

Here are some compression numbers, using the ZLIB encoding option.
Even though Bitcoin files have relatively high entropy (with hashes
and UTXO's being non-compressable) we still see 30% typical size
reduction.

File (see testing/data) | Before | After | Compression Ratio
------------------------|--------|-------|------------------
1in1000out.psbt | 35644 | 22095 | 38.0%
1in100out.psbt | 4142 | 2654 | 35.9%
1in10out.psbt | 992 | 670 | 32.5%
1in20out.psbt | 1342 | 897 | 33.2%
1in2out.psbt | 675 | 458 | 32.1%
devils-txn.txn | 666 | 356 | 46.5%
finalized-by-ckcc.txn | 1932 | 807 | 58.2%
signed.txn | 100757 | 77090 | 23.5%

By using Base32 character encoding inside a QR code with the unique
"alphanumeric" encoding (where each character takes 5.5 bits of
space, and encodes 5 bits of binary), we can acheive the smallest
possible QR codes.

# Example Image

Expand Down

0 comments on commit e685144

Please sign in to comment.