When Bitcoin Cash began as a fork of $BTC on Aug 1st 2017 it kept the legacy address format. This ended up causing quite a bit of confusion and resulted in lost funds as users accidentally sent $BCH to $BTC addresses and vice versa.To fix this cashaddr was introduced. It’s a base32 encoding based on Bech32.Conversion ToolBITBOX recently added its own conversion tool so you can quickly and easily convert legacy base58Check encoded Bitcoin Cash addresses in to the cashaddr format.Simply paste in a legacy or cashaddr address and BITBOX will convert it to both formats and generate QR codes.You can also paste in a private key in Wallet Import Format (WIF) to generate cashaddr/legacy addresses and QR codes.ConverterWe’re using bchaddr.js along w/ qrcode.react.Sending actual fundsAll the addresses in BITBOX are 100% legit on the $BCH network. However BITBOX doesn’t actually connect to the Bitcoin Cash network so if you were to send actual $BCH to one of these generated addresses you wouldn’t see it. You would be able to see it in a live block explorer.You can safely sweep any funds sent to a BITBOX generated address into a wallet via the private key WIF. But we strongly advice against sending any actual funds to a BITBOX address. This is a development tool and not meant to handle actual funds.If you want to send real coins to a BITBOX address and then sweep them back into a live wallet we suggest using the $BCH testnet.
Bitcoin Cash is all about sending and receiving payments. BIP21 describes a way to encode payment request information such as address, amount, message etc as a URI. These URIs are a very popular way to share payment requests and you’ll often see them as links in a website or as QR codes. Today we’re releasing encodeBIP21 and decodeBIP21 to make it easy for your app to encode/decode BIP21 $BCH URIs.encodeBIP21To encode a BIP21 URI pass in the address as the first argument and an object of options as the 2nd argument. encodeBIP21 will encode the options object as query string parameters. This works for addresses encoded in cashAddr w/ and w/out prefix and legacy base58Check.Error handlingencodeBIP21 won’t accept strings or negative values as an amount.decodeBIP21To decode a BIP21 URI pass in a valid URI.Error handlingdecodeBIP21 won’t accept incorrectly encoded BIP21 URIsSummaryBIP21 URIs are an extremely popular way to share payment requests. Now w/ encodeBIP21 and decodeBIP21 your app can create and process them.More infoFind out more info about encodeBIP21Find out more info about decodeBIP21
Bitcoin Cash wallets are really just collections of key pairs. Hierarchical Deterministic wallets are the state of the art for reliably creating and backing up collections of related keypairs. For more detail read Andreas’s in depth explanation about how they work in Mastering Bitcoin Cash.BITBOX is an HD wallet which aims to be compliant w/ BIPS 32, 39, 43, 44. When you first fire up BITBOX we create a random mnemonic from 16 bytes of entropy which we then use to create a root seed, master key and 10 default accounts.Generate mnemonicYou can configure how much entropy BITBOX uses to create your mnemonic in the config section. More entropy means more words in your mnemonic. By default BITBOX will use 16 bytes and create a 12 word mnemonic.Entropy SliderEntropyMnemonic length (words)128/1612160/2015129/2418224/2821256/3224To do this we’re using NodeJS’s crypto.randomBytes and the wonderful BIP39.js.MnemonicRoot seedNext we take an optional password and combined w/ the mnemonic create a root seed. The number of potential seeds is 2^512.Optional Password`Master keyFinally we’re using bitcoinlib-js to create a masterkey from the rootSeed.This masterkey can be used to create 4 billion child keys. Each of those child keys can produce 4 billion child keys recursively in a derivation path.When you combine the number of potential mnemonics, seeds and nested child keys the potential Bitcoin Cash address space is unfathomably large.Derivation PathDue to the huge number of potential derivation paths BIPs 43 and 44 introduced conventions for adding meaning to the path. Specificallypurpose' is always set to 44 to signify that the wallet is BIP 44 compliant. coin_type' is set to 145 for $BCH. Then we create 10 accounts which are siblings and get the first private key in Wallet Import Format.You can optionally set your own custom derivation path.Derivation PathDisplay to userWe don’t want to display the private key WIF by default to the user because it’s unsafe. Instead we get the publicKey and display that by default allowing the user to toggle visibility of the privateKeyWIF w/ a button click.Private WIFBase58CheckCashAddrpublicKey from the previous step is Base58Check encoded. You can toggle displaying the address in CashAddr via bchaddr.js.CashAddrTestnetYou can also toggle generating keys on the $BCH testnet.Testnet privateTestnet publicSummaryBITBOX aims to be an HD wallet which is compliant w/ BIPs 32, 39, 43 and 44. You can change the strength of the mnemonic, how many accounts are created, the derivation path, whether the addresses are displayed as Base58Check or CashAddr encoded and main or testnet.More infoBIP 32BIP 39BIP 43BIP 44
BITBOX aims to be the go-to toolset for $BCH developers. We want you to be able to run your code and tests against your BITBOX before deploying to live environments and aim for 100% Bitcoin Cash JSON RPC API coverage.Today we’re happy to announce that bitbox-sdk has 100% of the Bitcoin ABC JSON RPC. You can now use bitbox-sdk to have your code interface directly w/ your live running Bitcoin ABC node. Here’s how that would look.InstallationFirst install bitbox-sdk via npmThis gives you access to the bitbox command line utility.Command lineYou can now have bitbox stub out an app scaffold and configuration. Here we’ll have it create a new app and give it the user, password and host of our running Bitcoin ABC node and set the environment to production.This will create a scaffold directory structure for a new $BCH app along w/ a configuration file which looks like:ConsoleNow you can fire up bitbox’s console to send some commands to your running $BCH node.This will load the console and create a BITBOX object w/ the entire $BCH JSON RPC available. That BITBOX object can send commands to the running Bitcoin ABC node that you configured in the previous step.BrowserYou can also use BITBOX from the browser. First install bitbox-sdk locally w/ npm.Next you need to require or import BITBOXSDK into your app depending on if you are transpiling ES6 or not. Once you require BITBOXSDK into your app you then create an instance of BITBOX and pass in a config object w/ the same values you used at the command line in the previous steps.Again the entire Bitcoin Cash JSON RPC is available on the BITBOX object.SummaryBITBOX can now be used from the command line or the browser to send commands to the BCH network.
The goal of BITBOX is to accelerate how quickly $BCH devs can create their apps. With that in mind today we’re launching Scaffolds. This is a way to bootstrap a Bitcoin Cash application in under a minute.When creating a new application on any platform too much time is spent setting everything up and configuring it. BITBOX scaffolds do the heavy lifting for you and let you focus on building your app.SetupInstall bitbox-sdk globally npm install bitbox-sdk --globalReactTo quickly create a React app w/ BITBOX web bindings follow these steps.SetupScaffold a React app w/ BITBOX web bindings bitbox new myApp --scaffold reactcd into new app cd myApp/Install dependencies npm installStart the app npm startOpen a browser to http://localhost:3000/ and confirm you are seeing a basic BIP44 walletWinAngularTo quickly create an Angular app w/ BITBOX web bindings follow these steps.SetupScaffold an Angular app w/ BITBOX web bindings bitbox new myApp --scaffold angularcd into new app cd myApp/Install dependencies npm installStart the app npm startOpen a browser to http://localhost:4200/ and confirm you are seeing a basic BIP44 walletWinNodeTo quickly create a Node JS app w/ BITBOX bindings follow these steps.SetupScaffold a NodeJS app w/ BITBOX bindings bitbox new myApp --scaffold nodecd into new app cd myApp/Install dependencies npm installStart the app npm startConfirm you are seeing a basic BIP44 walletWinConfigBy default your new app will connect to BITBOX Cloud over REST. If you want to connect to your own REST services pass in a config object when instantiating bitbox-sdk.SummaryW/ BITBOX Scaffolds you can now create a $BCH app in under a minute. This should accelerate how quickly developers can create Bitcoin Cash apps. Go developers go!
Bitcoin Cash offers an unimaginably large number of addresses. This allows you to use a new address for every transaction which greatly increases your privacy. However most people keep their private keys offline in a hardware or paper wallet so it’s not convenient to generate new addresses for each transaction. Extended public keys (xpub) let you share or deploy only your xpub and applications can produce an infinite number of public keys and $BCH addresses, but can’t spend any of the $BCH sent to those addresses.fromXPubbitbox-sdk now has an Address.fromXPub method which takes an xpub as a first argument and an index as an optional 2nd argument which defaults to “0/0”.UsageThis can be useful if you’re accepting donations on your website and want to generate a new address for each donation. Or if you’re a merchant and you want to create a new address for each transaction.Write a script to generate the addresses 1 at a time and check the blockchain to see if each address has any inputs/outputs. If so then someone has already sent that address a donation so generate the next address and try again until you find an address with no transactions.PrivacyBe aware that if you use bitbox.Address.fromXPub in the browser or share your xpub w/ anyone else they will be able to generate all your public keys and know exactly how much money has in total been sent to that xpub. They cannot spend any funds unless they also have the private keys.As a matter of good practice you should keep your private keys in a hardware wallet or as a mnemonic on a paper wallet. You should be aware that using xpub comes w/ lessened privacy if you make your xpub known to anyone.SummaryExtended public keys make generating a new address for every transaction possible. bitbox.Address.fromXPub makes it quick and easy for devs to have their apps create an infinite number of addresses for their users w/out needing to expose their users to loss via holding their private keys.
The Bitcoin Cash ecosystem is growing quickly. People all over the world are being drawn to the compelling original vision of frictionless and borderless money facilitated by on-chain scaling. The goal of BITBOX is to build a suite of tools which help accelerate the quality and quantity of applications built on top of the $BCH platform.Why?Writing a $BCH app is challenging. There is a ton of stuff to be on top of. Wallets, addresses, accounts, inputs/outputs, transactions, blocks and more. Add to that web bindings, JSON RPCs, tests, versioning and deployment and it becomes clear that a suite of tools is needed to abstract away all the common and repetitive tasks so that developers can focus on what they do best which is creating amazing applications.Introducing BITBOXWe’re very happy to bring you BITBOX! Inspired by the great Truffle Framework and Ganache, BITBOX consists of both a GUI and command line utility.The GUI lets you quickly spin up your own $BCH blockchain that you can use to run tests, execute commands, and inspect state while controlling how the chain operates. The command line utility lets you quickly stub out an application w/ web bindings and tests as well as a console w/ the entire $BCH RPC available.More coming soonIt’s our intention to help SUPERCHARGE the Bitcoin Cash developer ecosystem and there is more being added to BITBOX daily.BITBOX is on GitHub under the MIT Open Source License. We welcome any and all contributions, and feature suggestions.GUIBITBOX SDKDeveloper.bitcoin.com
Bitcoin Cash is meant for people all over EARTH. Most of those people don’t speak english. That’s why today we’re releasing wordLists so you can generate mnemonics in 8 different languages to help spread $BCH to people all over the planet.wordListsbitbox.Mnemonic now has a wordLists method which returns an object w/ the following keys:Each of these keys contains an array w/ 2048 words in that language. 4 bitbox.Mnemonic methods now accept that wordlist as their 2nd argument and will create and validate mnemonics in those languages.The methods which now accepts a wordslist argument aregeneratefromEntropytoEntropyvalidateExamplesChinese simplifiedChinese traditionalFrenchItalianJapaneseKoreanSpanishBITBOX GUIBITBOX GUI has also been updated to generate mnemonics in all of the above languages. There is now a language selector on the configuration screen. Select the language that you’d like to use and restart your bitbox.Chinese simplifiedChinese traditionalFrenchItalianJapaneseKoreanSpanishSummaryWith wordLists it’s now easier than ever to generate mnemonics in languages other than english to help spread $BCH all over the EARTH.
Imagine you have a $BCH app which you’d like to deploy. However before doing that it seems like you should test it. BITBOX console lets you quickly switch between sending commands to your local instance or your full node running on the cloud. That way you can test your code locally before deploying to a remote server w/ production running $BCH node.Create new appLet’s say our newly created $BCH app is just a simple call to getnetworkinfo but of course it could be much more complex as BITBOX supports the entire $BCH RPC.To test our code first stub out an app w/ production credentialsNext open up the newly created bitbox.js file and add config for your local bitbox.ConsoleNow when you fire up your BITBOX console you can tell it which environment to connect to by passing bitbox console an --environment flag.SummaryThis is just a small example to show how BITBOX can accelerate your $BCH workflow. You can stub out an app scaffold w/ configuration for development and production environments. You have the full $BCH RPC available on the BITBOX object and you can quickly switch between sending commands to different environments.
bitbox-sdk recently added 3 new Objects full of utility methods to help you accelerate your $BCH workflow. The BitcoinCash methods convert between satoshis and whole units.The Address methods let you convert legacy addresses to cashaddr and reverse as well as detecting address formats, types and networks.The Crypto methods let you create sha256 and ripemd160 hashes as well as generate random bytes. Together the BitcoinCash and Crypto utilities let you quickly build out a great $BCH application.BitcoinCashMore InfoAddressMore InfoCryptoMore InfoCreditsbitbox-sdk leverages several really great libraries. Please show these people support.https://nodejs.org/api/crypto.htmlhttps://github.com/bitcoinjs/bitcoinjs-libhttps://github.com/bitcoinjs/bip39https://github.com/bitcoincashjs/bchaddrjshttps://github.com/dawsbot/satoshi-bitcoin
BITBOX enables you to cryptographically prove ownership of an address via signing messages. You can also verify that ownership of an address from another person.If, for example, you lost access to an account you could prove you were the owner that had been sending payments to that account by signing a specific message from that address.Or someone could potentially give you a loan or credit using a signature from a wallet holding a certain amount of funds as proof that you could repay them.Sign a messageYou can sign a message w/ any address in your bitbox. It doesn’t matter if it’s in cashaddr or legacy encoding. Just paste the address into the address field and type the message that you want to sign. Then click the ‘Sign’ button and if you have entered a valid address that has keys in your BITBOX you’ll see a signature appear.ConverterYou can share this message, address and signature with anyone and they can verify that you are the owner of that address.Verify a messageYou can verify a message from any address on the Bitcoin Cash network. Just paste in the message, address and signature provided and click the ‘Verify’ button. If the address and signature are both valid format and the signature matches the message and the address you’ll get a green ‘Valid message’ response.ConverterIf the address or signature are incorrectly formatted or the signature doesn’t match the message and address you’ll get an error message.ConverterUsing the command lineBITBOX supports the entire Bitcoin Cash RPC. bitbox-sdk now supports, signmessagewithprivkey and verifymessage in cashaddr (w/ or w/out the prefix) and legacy.SignVerify
HD Wallets are at the heart of most Bitcoin Cash apps. Being able to quickly create them can let developers create more exciting $BCH apps quicker than ever. Today we’re releasing 7 new utility methods to let you quickly generate mnemonics, root seeds, master private keys, HD wallets and then to sign and verify messages w/ keys from that wallet.MnemonicMore InfoHDNodeMore InfoHDNodeMore InfoBitcoinCashMore Info
IntroWebsockets make possible an entirely new generation of apps which depend on real-time data. BITBOX SDK has websockets built in. Our new scaffold enables you to bootstrap a Bitcoin Cash React app with BITBOX and websockets integration in under a minute. Accelerate your workflow with BITBOX Scaffolds.Donate BCH@porlybe created Donate BCH, which shows the power of websockets and let's you bootstrap your next great app. It's powered by BITBOX and lets you display logos and QR codes for donations.When a donation is made a modal appears showing the amount.ScaffoldWe created a scaffold from Donate BCH to quickly let you bootstrap a React app w/ BITBOX and websockets with no further setup. First run the new command and pass in the --scaffold websockets flag.Next cd into donateBCH, install the deps and start the app.Edit src/donation.js to add donation addresses, locations and logos. Both legacy and cash addresses are valid. You can add new logos to src/assets/.Leveraging BITBOXDonate BCH shows very practical ways to leverage BITBOX when creating an app. It demonstrates unit and address conversion, calling REST and listening on a websocket.Unit ConversionBITBOX can convert whole BCH units to satoshis as well as converting satoshis to bits and back to whole units. The scaffold converts satoshis to whole BCH.Address ConversionBITBOX has methods for converting cash address to legacy and legacy to cash. The scaffold converts cash address to legacy address.RESTBITBOX SDK has REST integration bundled. The scaffold calls Address.details to get back utxo for an address.SocketThe Socket class lets you quickly get real-time blockchain data. First create an instance and then call listen. Here's how the scaffold updates the UI after new tx data comes in.SummaryBITBOX SDK has websockets built in which enables real-time data in Bitcoin Cash apps. Our websocket scaffold lets you bootstrap a Bitcoin Cash React app with BITBOX and websockets integration in under a minute.
Sending transactions is at the heart of BCH. BITBOX has been able to send transactions for a while but w/ BITBOX Cloud and REST taking shape we wanted to revisit the steps for sending transactions to show how to best leverage the new functionality.SetupBefore we get started let’s create an HDNode and send it some satohis.MnemonicFirst we generate a random 256 bit mnemonic.Root seedFrom that mnemonic we create a root seed buffer.Master HD NodeWith our root seed we can create a BIP32 master hd node. The 2nd argument is the network. pass in 'bitcoincash' for mainnet and 'testnet' for testnet.AccountNext create a BIP44 account. The 2nd argument is the BIP44 HD path.ChangeCreate the first external change address per BIP44.Cash AddressSend some satoshisNow we send a few satoshis to bitcoincash:qqn2yf5jzrhwr3magjps5muz30akqqgsm5q7wcgkga. You can see that at aeaadaa9e952bf9fe02db6f261f31db2ab42224c9c8da73d78e2978eca372594With that all set up lets now look at leveraging BITBOX Cloud.BITBOX CloudBITBOX Cloud is your Blockchain as a Service.’ We recently started integrating w/ bitbox-sdk so you can leverage BITBOX Cloud w/out any additional setup.You can use Address.utxo to get back a list of utxo for an addressNow lets spend the utxo.TransactionBuilder instanceFirst create an instance of TransactionBuilder. Note the 'bitcoincash' argument is optional and it will default to mainnet if you pass nothing in. Pass in 'testnet' to create testnet transactions. For this example we’ll use the mainnet.Original amountNow get the original amount of satoshis from the utxo. This is returned from the call to bitbox.Address.utxo.And the indexGet the index of the vout which you want to spend.Get the txidNext get the txid of the uxto you want to spendAdd the inputsNow we’re ready to add the input to our transactionBuilder instance. First pass in the txid and next the vout index.Calculate the feeNext use BitcoinCash.getByteCount to calculate the fee. Here we pass in 2 objects describing the type and number of inputs/outputs. For this example we have 1 P2PKH input and 1 P2PKH output.Calculate the feeA transaction w/ 1 P2PKH input and 1 P2PKH output is 192 bytes. We subtract that from the original amount of satoshis to get a fee of 1 satoshi per byte.Add the outputAdd the address where you want to send the satoshis and the send amount which is the original amount minus the 1 satoshi per byte.Get the node’s keypairNow get the change node’s keypair to sign the transaction.Sign inputSign the input. Pass in the index of the input you’re signing. In this case we only have 1 input so the index is 0. Next pass in the node’s keypair to sign the tx, a placeholder redeemScript var which isn’t needed here, the hash type which is SIGHASH_ALL and lastly the original amount of satoshis in the utxo which we’re spending.Build and get raw hexNow build the transaction and get the raw hex.POST the transactionFinally we’re ready to send our transaction to the BCH network.All together nowSuccessIf we did that correct we should get back a txid 1549abf70bf1f59618d650d72bb71711ef62e53e30138e326aab996ab6e54bb3.SummaryThis was to show step by step how to create a mnemonic, root seed, master node, bip44 account and bip44 change node. It showed how to create a cash address.Once you have utxo which are spendable it showed how to call BITBOX Cloud via bitbox.Address.utxo to get back a list of spendable utxo.It next showed how to build a transaction, sign it and POST it to the BCH network.If your app needs to send BCH transactions BITBOX is the tool and this tutorial shows you how to make it happen.
Memo and BlockPress are two very popular on-chain social networks. They use a clever OP_RETURN prefixed protocol to write your actions to the blockchain. Later clients can read that data from the chain and recreate your account’s actions. This represents a truly decentralized and censorship resistant social network and it’s only possible on Bitcoin Cash.Today we’re excited to release memopress—helper methods for reading/writing to the Bitcoin Cash blockchain per the Memo and BlockPress protocols.UsageMemopress supports encoding and decoding payloads for 100% of each the Memo and BlockPress protocols.InstallRequireEncodeMemoBlockPressDecodeMemoBlockSummaryMemo/BlockPress are innovative ideas that demonstrate features which exist on the Bitcoin Cash blockchain and nowhere else. As the Bitcoin Cash ecosystem continues to mature BITBOX will release open source tools which accelerate how quickly devs can adopt them.More InfoBITBOXmemopress