Bitcoin Developer Network

Explore Website

  • Play
  • Submit a tutorial
  • Resources
  • Subscribe
  • White Paper
Search Open Sidebar


Introduction to Bitcoin Programming with BitcoinJS and Bitcoin Core

by Stéphane Roche
Welcome to an extensive guide on programming Bitcoin with Javascript! In this guide we will explain how to create various types of Bitcoin transactions using the BitcoinJS library.

Getting Started

We will use the Bitcoin Core command-line interface in Regtest mode for various common tasks, as well as some complimentary libraries like bx aka Libbitcoin Explorer.

Generating and Importing Wallets

In order to follow this Bitcoin programming tutorial with ease, it would be great to always use the same set of addresses, in NodeJS as well as in Bitcoin Core CLI. We currently

Legacy pay to public key hash

P2PKH is the standard and most common output type until now, used before the Segregated Witness soft fork, that Pays To PubKey Hash (P2PKH). A P2PKH contains instructions which allow anyone to spend

Native Segwit P2WPKH

Read more about P2WPKH in BIP141 P2WPKH is the native Segwit version of a Pay to Public Key hash. The scripts and script data are spread out as follows witness: <signature>

Embedding Data with OP_RETURN

To follow along this tutorial and enter the commands step-by-step Type node in a terminal after cd into ./code for a Javascript prompt Open the Bitcoin Core GUI console or use bitcoin-cli for

Bitcoin Script Puzzles

Bitcoin scripts can be puzzles of any sort and they don't actually have to depend on the knowledge of a secret key. Complex scripts are replaced by shorter fingerprints in the transaction output,

Multi-signature Transactions

Multi-signature (multisig) refers to requiring more than one key to authorize a Bitcoin transaction. It is generally used to divide up responsibility for possession of bitcoins.

Timelock Transactions

Absolute TimelocknLockTimePart of the original Bitcoin implementation, nLockTime is a field that specifies the earliest time a transaction may be added to a valid block. A later Bitcoin soft fork allowed nLockTime to

Share Share on Twitter Share on Facebook Share on LinkedIn
Written by
Stéphane Roche's Picture

Stéphane Roche

Donate with Bitcoin | 3CmJsUcx6txveq32kVqG92pczc1suLh6BD

Lisbon, Portugal https://www.bitcoin-studio.com/ Twitter

Comments

Subscribe to Bitcoin Developer Network weekly newsletter

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

NextBitcoin wire protocol 101January 27, 2020
PreviousCalculating the Merkle Root for a blockApril 03, 2019
Bitcoin Developer Network icon Bitcoin Developer Network
—
Introduction to Bitcoin Programming with BitcoinJS and Bitcoin Core
Share this

Explore Website

  • Play
  • Submit a tutorial
  • Resources
  • Subscribe
  • White Paper

About Bitcoin Developer Network

The Bitcoin Developer Network (BDN) is a community-driven project looking at educating the generation of Bitcoin developers. We invite developers, authors, editors, proofreaders, enthusiasts, subject matter experts and technical writers to get in touch so that we may reduce the barrier to entry in developing solutions at various layers of this technology.

Bitcoin Developer Network Newsletter

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Contact

Have any questions? Feel free to get in touch!

  • editor [at] bitcoindev.network
  • BitcoinDevNet
  • BitcoinDevNet
  • BitcoinDevNet
Close Sidebar

Latest Posts

  • Getting started with Nigiri
    Getting started with Nigiri
    September 10, 2020
  • A browser extension for Bitcoin developers
    A browser extension for Bitcoin developers
    August 28, 2020
  • Bitcoin script 101
    Bitcoin script 101
    July 01, 2020

Tags

analyticsbitcoinbitcoinjs-libblockchainbrowserclicommunitycryptographydatadnsenvironmentexploitextensionhash functionsjavascriptjulialeveldblibrarylightningliquidmempoolmerkle rootmerkle treesmusignasnetworkingnewsletternodepgpphpprotocolregtestrpcsandboxschnorrscriptsecp256k1securityseriesshellstandardsstatisticssynologytransactionswallet

Bitcoin Developer Network on @instagram

Twitter Facebook GitHub RSS
Back to the top

Bitcoin Developer Network © 2021 | Privacy Policy

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 4.0 International license.
Source Code

Search Bitcoin Developer Network

Posts found: 0
Close