Building Cryptocurrency Agnostic Components in My-Wallet-V3 and My-Wallet-V3-Frontend

At Blockchain, we’re striving to write reusable, extendable, and flexible code. This practice has become even more important with the recent addition of Bitcoin Cash and ether to our wallet application. For our users, adhering to writing agnostic components makes project delivery speeds faster and more consistent. For our developers, it makes the code fun to work with and less buggy.

A few months ago, we added ether to the Blockchain wallet along with a crypto-to-crypto exchange integration. This feature was the first we’ve built that supports multiple cryptocurrencies (instead of just bitcoin to fiat or vice versa). In our efforts to build reusable, extendable, and flexible code we built it to support any digital currency our wallet currently offers or will offer in the future.

The components that make up our exchange integration are completely agnostic to the currencies the user wishes to shift. Any digital currency can be plugged into the integration as long as it’s “API” in the My-Wallet-V3 core supports a few basic functions. Let’s walk through how this works a little bit.

When the wallet initializes the exchange checkout process it passes the destination and origin wallets to the shift-create component from the shapeShiftCheckout controller:

My-Wallet-V3-Frontend/assets/js/controllers/shapeshift/shapeShiftCheckout.controller.js

...
this.wallets = Wallet.accounts().concat(Ethereum.defaultAccount);
...

And in My-Wallet-V3-Frontend/app/partials/shapeshift/checkout.pug

...
shift-create(wallets="vm.wallets")
...

Note: There are more attributes passed to the shift-create component, but for simplicity I’ve removed them.

The line in shapeShiftCheckout.controller.js (`this.wallets = Wallet.accounts().concat(Ethereum.defaultAccount);`) was for shifting between bitcoin and ether when we initially launched the ether integration. What it does is concatenate all the bitcoin wallets in your Blockchain wallet with the ether default wallet. In checkout.pug, we tell shift-create to load these wallets as possible origins and destinations in an exchange.

A few months later, we added full support of Bitcoin Cash to our wallet. We wanted to give users the ability to exchange their Bitcoin Cash to and from bitcoin and ether. Here is the commit that added Bitcoin Cash to our exchange integration: https://github.com/blockchain/My-Wallet-V3-Frontend/commit/0c44b5bca7951a9a298d5599d5fd872b0eff5de5.

-this.wallets = Wallet.accounts().concat(Ethereum.defaultAccount);
+this.wallets = Wallet.accounts().concat(Ethereum.defaultAccount).concat(MyWallet.wallet.bch.accounts);

Adding Bitcoin Cash was as easy as changing one line of code because we built cryptocurrency agnostic components for exchanging bitcoin <-> ether from the beginning.

If you check the shift-create component where the wallets are passed, you won’t find any reference towards a specific cryptocurrency itself: (https://github.com/blockchain/My-Wallet-V3-Frontend/blob/master/assets/js/components/shapeshift/shift-create.component.js). You’ll only see functions called on the wallets that the API in My-Wallet-V3 core requires them to have.

  1. `getAvailableBalance` -> How the component calculates the total amount the outgoing wallet has available to send/exchange. Below are the functions for each cryptocurrency:
    1. bitcoin: https://github.com/blockchain/My-Wallet-V3/blob/master/src/hd-account.js#L311
    2. ether: https://github.com/blockchain/My-Wallet-V3/blob/master/src/eth/eth-account.js#L138
    3. Bitcoin Cash: https://github.com/blockchain/My-Wallet-V3/blob/master/src/bch/bch-account.js#L68
  2. coinCode -> The wallet’s coinCode to be used later in the cryptoCurrencyMap.
    1. bitcoin: ‘btc’
    2. ether: ‘eth’
    3. Bitcoin Cash: ‘bch’
  3. Balance -> Used to check for balance updates in the wallet. If a user’s balance changes, the component calls getAvailableBalance.
  4. cryptoCurrencyMap -> Used to calculate conversions between each digital currency and their fiat values.

When everything comes together, the final result looks like this:

Screenshot of initial Blockchain exchange integration using agnostic components

Despite the ease of adding new currencies, we wanted to continue improving the exchange experience for our users.

In version 1 of our exchange integration, there was no loading state to tell users that the component was working on getting a quote. Under good network conditions requests like these can seem instantaneous and a loading state might even seem a little jarring. However, because of the high traffic on digital currency networks, requests can take up to 5 seconds to resolve. Bitcoin, ether, Bitcoin Cash, and other digital currencies are handling more transactions than they ever have before. Record high transaction volumes are leading to network congestion, in turn leading to slow loading times from services like ShapeShift.

Depending on how long a request took to make, it could look like the component was frozen or that something broke and no error was returned. In reality, a request was being made and we weren’t correctly indicating that to the user. We decided to add a loading state to the component as you can see in version 1 vs version 2 below.

GIF showing Blockchain's initial exchange integration using agnostic components with a loading screen
Version 2
GIF showing Blockchain's initial exchange integration using agnostic components without a loading screen
Version 1

 

 

 

 

 

 

 

Users were relieved to see an indication of the app working to get a quote after the launch of version 2. Our transaction volume increased by 10% the week after we rolled out these changes, ~30% over the 2 weeks after, and 75% over the following month. Seemingly small improvements like this make a big difference to users.

Building components that are resilient to cryptocurrency’s rapid growth and constant change is just one of the many ways we ensure our users are getting a best-in-class experience on our platform. We hope you’ve enjoyed learning a little more about our process and look forward to continuing to deliver new and innovative solutions in our effort to create an open, fair, and accessible financial future.

Sound exciting? Check out our open positions available to join our incredible UX development team.

Product Update: Q4 2017

Amidst holiday festivities and New Year’s preparations, we want to quickly revisit the assortment of great new features that made their way into the Blockchain wallet during Q4. Grab a fresh mug of hot cocoa (and maybe that sugar cookie you’ve been eyeing) and we’ll get into all the exciting Q4 product update details.

Read more “Product Update: Q4 2017”

Cash in on Bitcoin Cash

At Blockchain, we’re always looking for ways to empower our users to interact with the digital economy in new, meaningful ways. In November, we revealed our plan to deliver on the growing demand we’ve seen for Bitcoin Cash. Starting today, we’re supporting Bitcoin Cash with full functionality through the same web wallet users know and love.

With Bitcoin Cash joining our existing lineup of digital currencies, users now have a full suite of options and can easily toggle between digital currencies to send and request funds, safely manage balances, and monitor market prices – all from one central place.

If you had bitcoin in your Blockchain wallet prior to August 1st, get excited because you’ll see an equal amount of Bitcoin Cash in your wallet now! New to Bitcoin Cash? Users can get started by simply trading bitcoin and ether for Bitcoin Cash using our exchange integration.

Just like with bitcoin and ether, users hold their Bitcoin Cash private keys, meaning they always have full, exclusive access to their funds with their backup phrase.

Not on web? Don’t fret. We’ll be rolling out full support for Bitcoin Cash on mobile by the end of Q1 2018. We’ll keep you in the loop here and on Twitter as we continue to build on this new addition to our wallet. Still have questions about how Bitcoin Cash works in your Blockchain wallet? Visit our Support Center.

Don’t have a Blockchain wallet? Sign up to get started with Bitcoin Cash and other digital currencies today!   

Set it & Collect it with Recurring Orders

At Blockchain we’re always looking for ways to make digital currency more accessible. It’s part of our commitment to creating an open, accessible, and fair financial future – and helping you, our users, Be Your Own Bank™.

Today, we’re excited to introduce Recurring Orders, a new feature that gives our European users greater purchasing power by allowing them to automatically buy bitcoin on a regular basis. Whether you’re just getting started or regularly purchase bitcoin, this feature will make it even easier to invest little by little in a better financial future.

Here’s how it works:

  • Log into your Blockchain wallet
  • Select ‘Buy’ powered by Coinify
  • Enter the desired amount you’d like to purchase with your credit card
  • Select ‘Make this a recurring order’
  • Choose your frequency whether on a daily, weekly, or monthly basis
  • Select the duration you’d like the recurring order to last (you can cancel anytime!)
  • Then click ‘Buy Bitcoin’

Taking small, incremental steps can add up to big results over time. With recurring orders, you can find your comfort zone and watch your wallet accrue additional bitcoin – without having to worry about a large upfront cost.

Log-in or sign up at www.blockchain.com to get started with recurring bitcoin orders on web or mobile today!

Beyond Backups: How to Use Your 12-Word Recovery Phrase

Your 12-word recovery phrase is, without a doubt, one of the most important wallet tools at your disposal. Knowing that, it’s no surprise we strongly recommend users write it down and store it safely before adding any funds to a new wallet. If you’ve already completed these backup steps, it’s equally important to have a solid understanding of how to use your 12-word phrase if you ever need to. Here, we’ll explain exactly that!

Read more “Beyond Backups: How to Use Your 12-Word Recovery Phrase”

Ether is Now Available on iOS & Android

A few months ago, we added ether to the Blockchain wallet. Today, we’re excited to announce that we’re extending that functionality to our mobile apps. As of today, users can seamlessly store, send, and receive ether on both iOS and Android.

As part of our mission to make digital assets increasingly user-friendly and accessible, we kept the mobile user experience for both currencies consistent and easy to navigate. With this update, users will notice the following two exciting changes:

  1. With a simple tap users can navigate between ether and bitcoin to monitor transactions, send funds, or request payment; and
  2. We’re rolling out a new dashboard that will allow users to monitor the market price for both currencies.

As always, users can find the latest mobile versions at our App Store and Google Play Store links.

Don’t have a Blockchain wallet? Click here to sign up today!

Product Update: Q3 2017

With summer over, we’ve got Halloween creeping closer and the end-of-year holiday season not too far after. That also means it’s time for our Q3 product update. This quarter brought some exciting integrations and new features both on mobile and web. Keep reading for all the details!

Quarterly product updates banner with Blockchain branded rocket pictured on the right

 

Read more “Product Update: Q3 2017”

We’ve Joined Forces with Unocoin To Make Buying Bitcoin Even Easier

We’re excited to announce that we have partnered with India’s most popular exchange, Unocoin, to give Blockchain users across India the ability to quickly and easily fund their Blockchain wallets.

Beginning today, we’ve integrated Unocoin’s exchange directly within the Blockchain wallet to give you greater purchasing power without having to compromise security or control.

For the first time ever, your Blockchain wallet can be funded in just a few clicks by linking your bank account, which is subject to bank transfer speed.

GIF of the buy bitcoin process through Blockchain's integration with Unocoin

Millions of Indians have embraced digital assets as a reliable way to save and transfer money. Together with Unocoin we are committed to making digital currency simple and more accessible throughout India. Whether it’s high fees, untrustworthy service providers, or confusing identity verification procedures, it’s often been a slow and challenging process to get started with bitcoin. Today’s integration is an important step forward in eliminating the friction that many have experienced in buying bitcoin.

The Unocoin integration is available to web users, but we plan on expanding to our Android and iOS wallet users in the near future. Log-in or sign up at www.blockchain.com to get started today!

Four easy ways to share feedback and help shape our products

It’s no secret that we’re passionate about building products users will love. So, you likely won’t be surprised to learn that we’re big fans of getting feedback from our users. In this post, we’ll outline four easy ways to share feedback and help shape our products.

User interviews

User interviews are one of the most dynamic, insightful ways to share feedback. They typically run 30-60 minutes and can be held over the phone or in person. You’ll get the chance to interact with our product and share your initial reactions directly with a member of our product team. We’ll also ask simple follow up questions to get a better sense for how you’re using our product and how we can create your perfect user experience.

By taking part in a user interview, you’ll have a direct impact on future releases of our products.  Whether you have positive or negative feedback, be honest. We’re just as interested in the bits that frustrate you as the ones you love.

Intrigued by user interviews? Let us know you’d like to be invited for one!

Surveys

Blockchain web wallet prompting user to share feedback by filling out our survey

User feedback is at its freshest during and immediately after you’ve used our wallet. Another great way to help us understand what you liked (and didn’t like) is our in-wallet survey. You’ll be prompted to complete it while logging out. Once you finish the survey, your feedback makes its way straight to our product team.

Feedback and feature requests

As new wallet trends emerge and aspects of the digital currency space change, it’s important for our wallet to adapt. Feedback and feature requests allow you to share feedback or let us know what exciting feature you’re most eager to see integrated next.

Have a feature you’d like to see in the Blockchain wallet? Let us know!

Community Outreach

Don’t hesitate to say hello if we bump heads at hackathons, digital currency gatherings, or you attend a Blockchain-run event. Chances are we’ll have a survey you can take on site, or you can sign up with your email address and we’ll be in touch!

Don’t have a Blockchain wallet? Click here.

Seamlessly store, send, and receive ether with your Blockchain wallet

At Blockchain, we care deeply about building products users love.  We’re constantly collecting user feedback and using it to help determine where we go next.

Today, we’re excited to announce that you can now seamlessly store, send, and receive ether from within the Blockchain wallet. By adding ether as a new currency, we’re providing users with a new diverse way to interact with the digital economy.

What’s different?

An image showing Blockchain's new ether product.

Using the same user-friendly interface, you can now seamlessly toggle between bitcoin and ether. To keep it simple, the ether experience will mirror the bitcoin experience our users have come to love.

For more information about the ins and outs of ether and how it works in your Blockchain wallet, visit our Support Center Learning Portal.

Exchange BTC for ETH powered by ShapeShift

GIF showing the Blockchain ShapeShift process exchanging bitcoin to ether.

For users looking to acquire ether, we’re excited to introduce a built-in BTC to ETH (and vice versa) exchange, powered by ShapeShift. Accessible directly within your Blockchain wallet, this integration makes it easy for users to acquire both digital currencies and monitor exchange progress, from start to finish.

Of course, in keeping with our ethos, this is just the first iteration of this product. In the coming weeks and months (and years!), we’ll continue to gather user feedback and use that to further build out this integration. Let us know what you think and where to go next.

Don’t have a Blockchain wallet? Click here to sign up today!