Nyzo techRelease notesNyzo Chrome 8: binary sender data

Nyzo Chrome 8: binary sender data

Nyzo Chrome extension version 8 (commit on GitHub) adds support for binary (non-text) sender data.

While plain-text sender data is convenient for readability, the increased data density of binary sender data can be useful, especially for hashes. This version of the extension adds support for normalized sender-data strings to allow use of binary/hex/non-text sender data. Importantly, this version does not change the data type presented to the Javascript interface — plain text is still used — so it is fully backward-compatible with pages written for earlier versions. In both directions, normalized sender-data strings pass binary data between page Javascript and the extension.

In the content script, a function call was changed from stringAsUint8Array() to senderDataAsUint8Array() due to renaming of the target function.

CX_8 image 0

In the extensionUtil script, the maximumSenderDataLength constant was added to improve code readability.

The cleanTag() function was modified to allow longer strings and all characters. This will require extra scrutiny of sender data when it is used, as the strict filtering used previously provided extra protection against attacks of the extension.

CX_8 image 1

In the popup script, protections were added to ensure event listeners for some events were not added multiple times.

CX_8 image 2

In the sendTransaction() function of the popup script, the comment was updated to reflect the fact that the function is used by both the tip and Micropay buttons. A function call was also changed from stringAsUint8Array() to senderDataAsUint8Array() due to renaming of the target function.

CX_8 image 3

The interesting changes of this version are in the util script. The stringAsUint8Array() function was renamed to senderDataAsUint8Array() and largely rewritten. Processing of normalized sender-data strings was implemented based on the Java method bytesFromNormalizedSenderDataString() method of the ClientTransactionUtil class in the verifier code base. A string of the correct length is checked first for proper formatting.

CX_8 image 4

If the input string is a valid normalized sender-data string, the bytes of that string are extracted. Otherwise, the string is interpreted as plain text.

CX_8 image 5