home/
BitGo Developer Portal/
Quick Start/
BitGo Express

BitGo Developer Portal

Getting Started with BitGo Express

BitGo Express makes it easy to get started developing with the Bitcoin protocol using multi-sig wallets in any language. BitGo Express is a proxy server designed to run within your own network and ensures that all cryptographically secure operations, such as address creation and transaction signing, occur in a trusted environment. Users interact with BitGo Express using BitGo’s SDK through a RESTful interface, and so any language capable of issuing HTTP requests can easily and securely use the Bitcoin protocol.

The built-in security suite, trusted by top-tier exchanges like Bitstamp provide developers with the peace-of-mind in knowing that they no longer have to rely on a homebrew security stack. This blog post will take you through the process of using BitGo Express to send and receive Bitcoin from scratch.

REQUIREMENTS

This tutorial assumes comfort with javascript, and git. Please ensure that you have the following:

This tutorial will provide setup instructions for the Bitcoin testnet network which is recommended starting point for developers new to Bitcoin.

  • A BitGo testnet account on test.bitgo.com
  • An access token from your BitGo testnet account (see Authentication Guide)
  • The latest version of npm.
  • Mac OS X or Linux-based OS

LET’S GET STARTED!

First you need to install and run the bitgo-express executable. Bitgo-Express is a Nodejs program contained within the BitGo SDK repository, so you need to install the SDK's source code. You can do this two ways, depending on whether you want to use npm or git to install it. Both ways are equally straightforward and give you access to the SDK source code, so choose whichever you like:


Quick Start BitGo Express Image 1


Quick Start BitGo Express Image 2


You’ve just installed and started BitGo Express, we’ll get started by authenticating our BitGo access token.

### AUTHENTICATION We’ll be using cURL to test out our local BitGo Express instance, we recommend following along and then implementing a request wrapper in any language that you would like.

First let’s open up a new tab and set our developer’s token as an environment variable so we can easily access it.


Quick Start BitGo Express Image 3


Next we can check the status of our token by calling the session endpoint.


Quick Start BitGo Express Image 4

Your response should resemble the following:


Quick Start BitGo Express Image 5


Let’s take a moment to double check our token parameters to ensure that we can follow through with the tutorial, make sure that you have the following:

  • A scope that includes walletcreate and walletspend_all.
  • The origin is test.bitgo.com.
  • The timestamp under expires is greater than the time you expect it to take you to complete this tutorial.
  • The txValueLimit is greater than 5 BTC or 500,000,000 Satoshis or any value higher than what we would expect to receive from a reasonable testnet faucet.

CREATING A WALLET

BitGo users have the benefit of creating Bitcoin wallets that are both protected by a unique password as well as two-factor authentication in the web-client. BitGo wallets have the additional benefit of advanced treasury controls that can allow multiple users to share a wallet with a specific set of policies as well as spending limits and address whitelisting. To create a wallet run the following:

Your response should resemble the following:


Quick Start BitGo Express Image 6


Continued:


Quick Start BitGo Express Image 7


Continued:


Quick Start BitGo Express Image 8


You’ve officially created your first BitGo wallet through the API!

If you log in to your BitGo account you will see a new wallet appear on the main dashboard. This wallet is fully accessible and configurable through both the website as well as the API. The next step will be to fund the wallet so that we can attempt to create a Bitcoin transaction using the wallet. You can grab your wallet address from the id: field. The one that I had created was 2N7GXBJPZQDJKbx53CwXYkrYVRLuqHJoYmA. You have two options for funding the address:

  • Tweet me at @lopp with your Testnet wallet id / Bitcoin address to receive some Testnet Bitcoin. Warning: This will take longer than the Testnet Faucet.
  • For those seeking instant gratification, enter your address in a Testnet Faucet to receive Testnet Bitcoin.

CHECK BALANCE

Let’s check our balance before proceeding to ensure that we have received some Bitcoin in the wallet. To check your balance run the following request.


Quick Start BitGo Express Image 9


The response will resemble the following:


Quick Start BitGo Express Image 10


Down at the bottom we can see that there is a balance of 100,000,000 Satoshis or 1 BTC. Please ensure that you have a balance greater than 50,000 Satoshis before proceeding.

SEND BITCOIN

Sending Bitcoin is made easy with the BitGo Express. All you need is some identifying information for the originating wallet. As well as the destination wallet address and the amount that is to be sent.

First I need an address to send to, I just generated a new address from our root walletId. BitGo enables BIP32 HD Keys on all wallets so you can generate up to 2^32–1 children addresses per wallet Id.

Quick Start BitGo Express Image 11

Your address should resemble the following:


Quick Start BitGo Express Image 12


The generated address was 2MszopwgnnoV7WLouQyQz9U9DkaEVpcTByF, we’ll be using this as the receive address in our transaction.

If we send the full balance out, we will need to handle the fee calculation, so let’s send half of my balance or 0.5 BTC to this generated address.


Quick Start BitGo Express Image 13

Your response should resemble the following:


Quick Start BitGo Express Image 14


We can see that the transaction hash can be located on a Testnet Bitcoin blockchain here.

Congratulations, you made it through the entire lifecycle of a Bitcoin transaction using BitGo Express!

WE’RE EXCITED TO SEE WHAT YOU’LL BUILD NEXT

BitGo Express helps power and protect some of the largest Bitcoin exchanges and hedge funds around the world. We’re excited to see how Express will help power the next generation of Bitcoin apps. Let us know what you think of BitGo Express on Twitter!

Prev
May 14th, 2017
BitGo’s Blockchain Team: Q1 2019 Retrospective
Next
Sep 11th, 2019
Multi-Sig vs MPC: Which is more secure?
Be One with the Code

Get started on the same great wallet used by over 40 Bitcoin Exchanges around the world & Integrate multiple digital currencies into your application with a single unified API.