Nyzo techRelease notesNyzo 638: nickname script

Nyzo 638: nickname script

Nyzo version 638 (commit on GitHub) adds the NicknameScript.

This version affects the client.

If it matters, it's on the blockchain. This is an important idea, but it's not easy to implement. Putting data on the blockchain is trivial. Making that data easily accessible in a consistent manner when it is needed without imposing excessive computational burden on any part of the system, and without requiring excessive development effort, is more complicated. With NyzoScripts, we think we will be able to move a lot more data to the blockchain efficiently. In parallel, we intend for development of NyzoScript functionality to allow us to implement interesting new applications with good user experience, like the card game example.

Nyzo nicknames have been a fun part of the system from its inception. However, they have been mostly ephemeral. To our knowledge, the only comprehensive, easily accessible accounting of nicknames is on the nyzo.co database server. While version 567 added nickname storage on the blockchain, proper indexing of those nicknames was never built into the Nyzo codebase.

This version adds on-chain nickname functionality that builds a nickname index with the NyzoScript mechanism. The API result can be seen on the client, and a human-readable form of the nickname list can be generated on the documentation page for the nickname script. Future releases will modify the verifier to register nicknames with this script, and the Chrome extension will be updated to allow those not running verifiers to register nicknames for accounts, also.

The ensureLength() method was added to ByteUtil. This method was added for a specific use in the nickname script, but it will frequently be useful for ensuring that the effects of malformed input data are minimized.

RN_638 image 0

In NyzoScriptManager.registerScripts(), the nickname script is now registered under the identifier id__8ezA79npaBzn430Y1fset6L5bZHcXhuVsYc0_1mEd8uatj3-NAMe.

RN_638 image 1

The GraffifiScript class was moved to the new scripts package.

RN_638 image 2

The NicknameScript registers nicknames contained in sender data. If you want to register your account's nickname, send a standard transaction of any amount to from your account to id__8ezA79npaBzn430Y1fset6L5bZHcXhuVsYc0_1mEd8uatj3-NAMe. Put your chosen nickname in the sender-data field of the transaction. To change the nickname, send a new transaction with the new nickname.

RN_638 image 3

The NicknameScript.bytesForNicknameMap() method serializes the nickname map. Only one byte is used to store the nickname byte length, which is never more than 32.

RN_638 image 4

The NicknameScript.nicknameMapFromByteBuffer() method performs the inverse of the previous method, deserializing the nickname map.

RN_638 image 5

The NicknameScript.readNickname() method deserializes a nickname from a ByteBuffer. This method is similar to the Message.getString() method, using a single byte instead of two bytes to indicate the string length.

RN_638 image 6