SHUAllet.js logo

SHUAllet.js – A simple web wallet and browser plugin

SHUAllet.js is an open-sourced, simple JavaScript library and non-custodial wallet plugin that supports common Bitcoin SV (BSV) transaction types. The goal of the wallet is to provide developers with streamlined means to execute well-known transactions without having to reimplement those functions from scratch in their own applications.

For example, owning and inscribing ordinals, listing tokens for sale on-chain, and locking coins into the future are all becoming commonly used Bitcoin scripts to the point where they should be as standardized as sending Bitcoin to an address (Pay-To-Public-Key-Hash (P2PKH)). The wallet was written in pure JavaScript, with the only third party library dependency being the bsv-legacy library, a derivative of the decade-old Bitcore library.

Every other script and helper functions are implemented in plain old JavaScript, with a single JS file aptly named SHUAllet_plugin.js that can be included in an HTML page for easy use (no webpack or custom build process necessary). The repository is open-source, so developers can pick and choose which functions they want to include; for example, if they want locking coins, but not Ordinals functions, they can do so. Additionally, the plugin supports bSocial functions (post, like, reply), which can be easily coupled with other transaction output types, such as locking coins, as hodlocker implements.

The last feature added to SHUAllet was a simple browser cache for payment UTXOs so that the wallet does not have to make an external API call each time it transacts. Given the recent stress on the BSV network, caching UTXOs will become extremely important, if not necessary, as services may not provide this feature for free in the future. For example, most BSV applications reach out to a block explorer such as WhatsOnChainBitails, or GorillaPool
to get the up-to-date UTXOs for an address.

However, once the UTXOs are known at some point, this becomes unnecessary in the context of spending in the scope of a single application. Each time the wallet spends BSV, the future state of UTXOs is known based on the raw transaction constructed. This feature is implemented in SHUAllet, improving performance (on initial page load and spends) and giving the user more control and confidence to secure their assets. 

Of course, if funds are sent to or spent outside of the application or domain context, then an external call to fetch the updated UTXOs is necessary, but even this can be streamlined with communication protocols moving forward if needed.

Screenshot post
Source: hodlocker

SHUAllet was built to help other developers build applications that make Bitcoin more valuable, not to capture a moat of users. No dedicated domain exists for SHUAllet; this is an intentional decision as the concept of a wallet transcends the Web 2.0 concept of a domain.

The blockchain exists independently of the Internet; therefore, wallets should be built to align with that concept. SHUAllet does not even have a backend server; it only leverages third-party APIs. As such, other developers have indeed found the library useful, being implemented for LRC-20 minting (hodl, lockmap), LockStream.OG, and treechat.ai (soon). I hope more and more developers find SHUAllet useful and help them express their creativity on-chain.

Watch: Bitcoin wallets for individuals and businesses

YouTube video

New to blockchain? Check out CoinGeek’s Blockchain for Beginners section, the ultimate resource guide to learn more about blockchain technology.