Skip to content

Instantly share code, notes, and snippets.

Torkel Rogstad torkelrogstad

Block or report user

Report or block torkelrogstad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bitcoind.scala
import scala.concurrent._
import org.bitcoins.{rpc, core}
import core.currency.Bitcoins
import rpc.client.common._
implicit val system = ActorSystem.create()
implicit val ec: ExecutionContext = system.dispatcher
View txbuilder.scala
import scala.concurrent._
import scala.concurrent.duration._
import org.bitcoins.core._
import number._
import config._
import currency._
import crypto._
import script.crypto._
import protocol.transaction._
View watch-only.scala
import scala.util.Success
import org.bitcoins.core.protocol.script._
import org.bitcoins.core.protocol.Bech32Address
import org.bitcoins.core.config.TestNet3
// first account -------┐
// bitcoin ----------┐ |
// segwit --------┐ | |
val accountPath = BIP32Path.fromString("m/84'/0'/0'")
// accountPath: BIP32Path = m/84'/0'/0'
View hd-keys.scala
import scodec.bits._
import org.bitcoins.core.crypto._
import org.bitcoins.core.hd._
// the length of the entropy bit vector determine
// how long our phrase ends up being
// 256 bits of entropy results in 24 words
val entropy: BitVector = MnemonicCode.getEntropy256Bits
// entropy: BitVector = BitVector(256 bits, 0xdf78bf273bc6fa221e1d807e389818b9e9a5f19d20328bef2bf35db8714cffe6)
View legacy-addr.scala
// pay-to-pubkey-hash address
import org.bitcoins.core.protocol.P2PKHAddress
// we're reusing the same private/public key pair
// from before. don't do this in an actual application!
val legacyAddress = P2PKHAddress(pubkey, TestNet3)
// legacyAddress: P2PKHAddress = mhc1Sh6HKsLkybe5TVG3mJKw6FEpjC4LT2
View bitcoin-s-bech32.scala
import org.bitcoins.core.{crypto, protocol, config}
// if you want to get addresses for mainnet, just import
// config.MainNet here instead
import config.TestNet3
import crypto.ECPrivateKey
// this gets all addresses into scope
import protocol._
// this gets all scriptPubKeys into scope
View lnav-dockerfile
FROM alpine
RUN apk add bash \
bsd-compat-headers \
build-base \
linux-headers \
ncurses-dev \
readline-dev \
sqlite-dev \
zlib-dev \

Keybase proof

I hereby claim:

  • I am torkelrogstad on github.
  • I am torkelrogstad ( on keybase.
  • I have a public key ASBN5JJBUwdewFDttuK2x4paDy45SyECqEhwDD-urK0A-Qo

To claim this, I am signing this object:

You can’t perform that action at this time.