Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article covers ERC4527, a proposal for securely exchanging data through QR codes between a signing device completely isolated from the network and a connected watch-only wallet.
This article translates, summarizes, and supplements the material below. The original CDDL examples are retained, including their Japanese comments.
I have also covered various other EIPs.
Overview
ERC4527 proposes procedures and a protocol for securely exchanging data through QR codes between offline signing devices, such as hardware wallets or smartphones with network connectivity disabled, and watch-only wallets. It standardizes the process in which the watch-only wallet prepares the data to be signed and the offline signing device reads that data and generates a signature.
Motivation
More users want to keep their private keys completely isolated from networks, and offline signing devices are becoming common. However, several data transfer methods coexist, without uniform procedures or encoding formats.
- QR codes
- USB connections
- Bluetooth
- File transfers
QR codes have the following advantages.
- Transparency and security
QR codes are easy to decode, allowing users to visually inspect what they are signing.
- Broad compatibility
QR codes are less susceptible to changes in browsers or operating systems and work across a wide range of devices.
- A good mobile user experience
No cables or pairing are required, making QR codes easy to use even on smartphones.
- Reduced attack surface
Compared with USB or Bluetooth, QR codes expose a smaller attack surface.
For these reasons, QR codes are well suited to offline signing. Previously, however, there was no modern standard. ERC4527 aims to improve interoperability, security, and the user experience by standardizing offline signing procedures and QR code data formats.
Specification
Terminology
-
Offline signing device A device or application that has no network connectivity and holds the user's private keys.
-
Watch-only wallet A wallet that connects to a network and can interact with the Ethereum blockchain.
Process
- The offline signing device sends public key information to the watch-only wallet via a QR code. The wallet generates addresses and synchronizes balances.
- The watch-only wallet prepares unsigned data, such as a transaction or EIP712 typed data, and sends it to the offline signing device via a QR code.
- The offline signing device signs the data and returns the signature to the watch-only wallet via a QR code.
- The watch-only wallet receives the signature, assembles the transaction, and broadcasts it.
For more information about EIP712, see the following article.
[EIP712] Understanding Typed Structured Data Hashing and Signing
Data Transmission Protocol
Animated QR codes (multiple frames) are used when data exceeds the capacity of a single QR code. The encoding scheme uses UR (Uniform Resources), defined by BlockchainCommons and extended by ERC4527. CBOR (Concise Binary Object Representation) is used for binary representation, while CDDL (Concise Data Definition Language) describes the data structures.
Watch-Only Wallet Setup
The offline signing device supplies an extended public key and its derivation path. In UR, the public key is represented by the crypto-hdkey type and the derivation path by crypto-keypath.
CDDL for the Key Path
crypto-keypath = {
components: [path-component], ; 空の場合は source-fingerprint 必須
? source-fingerprint: uint32 .ne 0 ; 祖先キーまたはマスターキーの指紋
? depth: uint8 ; 派生段数
}
path-component = (
child-index / child-index-range / child-index-wildcard-range,
is-hardened
)
uint32 = uint .size 4
uint31 = uint32 .lt 2147483648 ; 0x80000000
child-index = uint31
child-index-range = [child-index, child-index]
child-index-wildcard-range = []
is-hardened = bool
components = 1
source-fingerprint = 2
depth = 3CDDL for the Extended Public Key
hd-key = {
derived-key
}
derived-key = (
key-data: key-data-bytes,
? chain-code: chain-code-bytes,
? origin: #6.304(crypto-keypath),
? name: text,
? source: text
)
key-data = 3
chain-code = 4
origin = 6
name = 9
source = 10
uint8 = uint .size 1
key-data-bytes = bytes .size 33
chain-code-bytes = bytes .size 32If a chain code is present, child keys can be derived. Without it, the key is treated as a standalone key. To transfer only multiple public keys, use crypto-account.
Sending Unsigned Data
A new UR type, eth-sign-request, is defined for passing unsigned data from the watch-only wallet to the offline signing device.
CDDL for eth-sign-request
sign-data-type = {
type: int .default 1 ; 1: unsigned Tx, 2: EIP-712, 3: raw bytes, 4: typed Tx
}
eth-sign-request = (
sign-data: sign-data-bytes,
data-type: #3.401(sign-data-type),
chain-id: int .default 1,
derivation-path: #5.304(crypto-keypath),
?request-id: uuid,
?address: eth-address-bytes,
?origin: text
)
request-id = 1
sign-data = 2
data-type = 3
chain-id = 4
derivation-path = 5
address = 6
origin = 7
eth-address-bytes = bytes .size 20
sign-data-bytes = bytes ; Tx は RLP、EIP-712 は JSON 文字列の bytesReturning the Signature
The offline signing device returns the signature as eth-signature via a QR code.
CDDL for eth-signature
eth-signature = (
request-id: uuid,
signature: eth-signature-bytes,
?origin: text
)
request-id = 1
signature = 2
origin = 3
eth-signature-bytes = bytes .size 65 ; r, s, v を連結した 65 バイトUsing this signature, the watch-only wallet completes the transaction and submits it to the network.
Additional Considerations
A Robust Foundation for QR Code Transmission
UR uses alphanumeric mode to encode data efficiently. Each part includes the CRC32 checksum of the entire message, allowing integrity to be checked when multiple frames are reconstructed. Fountain codes allow variable-length data to be transmitted using a minimal yet flexible number of parts, making reconstruction easier for the receiver.
Reuse of Existing Types and Extensibility
UR already provides types such as crypto-keypath and crypto-hdkey. Its design also makes it easy to add new types such as eth-sign-request and eth-signature.
An Active Air-Gapped Wallet Community
UR has an active air-gapped wallet community that continuously improves the technology, supporting the continued evolution of the standard.
Backward Compatibility
There are no compatibility issues.
Security
Full Display of Data and User Confirmation
The offline signing device must decode the received eth-sign-request and display its contents to the user before signing. The user reviews the displayed data, confirms that it matches their intent, and then approves the signing operation.
Recommended Address Field and Verification
Including the address field in eth-sign-request is recommended. The offline signing device checks whether this address matches the address associated with its signing key. If it does not match, the device refuses to sign, preventing unintended signatures caused by malicious requests.
Citation
Aaron Chen (@aaronisme), Sora Lee (@soralit), ligi (@ligi), Dan Miller (@danjm), AndreasGassmann (@andreasgassmann), xardass (@xardass), Lixin Liu (@BitcoinLixin), "ERC-4527: QR Code transmission protocol for wallets [DRAFT]," Ethereum Improvement Proposals, no. 4527, December 2021. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-4527.
Closing Remarks
This article covered ERC4527, a proposal for securely exchanging data via QR codes between a completely air-gapped signing device and a connected watch-only wallet. I hope it was helpful.
If you have any questions, feel free to reach out via Twitter DM.
I also publish on other platforms, which you can explore below.



