Instantly share code, notes, and snippets.

Embed
What would you like to do?
Address Paste Improvement

  BIP: ?
  Layer: Applications
  Title: Address Paste Improvement
  Author: nopara73 <adam.ficsor73@gmail.com>
          David Molnar <molnardavid84@gmail.com>
  Comments-Summary: No comments yet.
  Comments-URI: 
  Status: Draft
  Type: Standard Track
  Created: 2018-11-07
  License: CC0-1.0

Table of Contents

Abstract

End-users often copy-paste addresses. This BIP aims to facilitate the user experience regarding this process.

Motivation

Some services already implemented autopaste functions, which is done as follows: the user clicks to the address box and a Bitcoin address automatically gets pasted from the clipboard. Depending on the implementation, this could be either annoying or not permissive enough if it completely replaces the possibility of manually entering a Bitcoin address.

Specification

Clipboard Address Validation

1. The software checks the content of the clipboard when the mouse cursor enters the address box area. 2. If the clipboard is not text or its lenght is above 100 characters, then the result of the validation is false. This safety check is needed in order to avoid Bitcoin address validation on huge text blocks for example. 3. Next trim whitespaces from the beginning of the end of the clipboard content. 4. Finally Bitcoin addess validation can proceed on the trimmed text normally with the preferred validation method of the implementor.

If Address Box Is Empty

When the mouse cursor enters the address box area, clipboard address validation is performed. If the check is successful, the appearance of the mouse cursor remains unchanged, unlike the normal text box behavior when it changes to the caret. Optionally a special cursor icon can be used, however, in order to avoid cross platform issues, the implementor may choose to go with the default mouse cursor as suggested.

Finally unfocus the address box. Note that, focused address box is traditionally indicated by blinking caret.

This indicates to the user that, if he clicks on the address box, then the address from the clipboard will be pasted. Additional clues can be also implemented, for example a tooltip saying "click to paste address from clipboard". More advanced UX interactions are also possible.

If Address Box Is Not Empty

The normal text box behavior changes based on the focus. If the focus is not on the address box, then on click select all text from the address box and give the focus to the address box. In this case a tooltip or more advanced UX interactions can indicate the unorthodox behavior of the address box. If the address box holds the focus, then normal text box behavior takes place.

Context Menu

If the address box does not hold the focus and it is not empty, then on right click, all text should be selected and the context menu appears, indicating that, the whole text will be modified by the selected operation. In this case, the context menu should not have a "Select All" entry, since it's redundant.

Smartphones

While this specification is written with Desktop in mind, on mobile platforms the same behavior can be replicated by dismissing the desktop specific notes.

Flow Chart

Reference implementation

Work in progess implementation in Wasabi Wallet: https://github.com/zkSNACKs/WalletWasabi/pull/825

Copyright

This document is licensed under the Creative Commons CC0 1.0 Universal license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment