BNS Upgrade: string data structures

This post is part of a larger effort to discuss potential features to be included in an upgraded version of BNS. Please see the megathread for more information.

Proposal: change the underlying storage types for name and namespace to string-ascii, instead of the current buff.

If implemented, all name-related stored data structures and function arguments would be converted from the current buff type to string-ascii.

When the BNS contract was written (before the launch of Stacks 2.0), the string-ascii data type had not been included in the Clarity programming language. As a result, the buff was utilized to store all name and namespace data.

While using buff has no core functional drawbacks in terms of contract logic, the biggest drawback is in regards to user and developer experience. All name and namespace data is converted to and from ascii when using applications that display human-readable information.

One issue with using buff is that it makes it harder for users to verify function arguments when signing a transaction. The types show up as raw bytes (ie 0xaeaeff), which cannot be easily reviewed without external tools.

I’ve run into this problem myself as a developer. I support this change!