diff --git a/docs/next/core/addresses.html b/docs/next/core/addresses.html index 2d865501f0..e0307f9fc4 100644 --- a/docs/next/core/addresses.html +++ b/docs/next/core/addresses.html @@ -80,7 +80,7 @@ reason to keep using legacy transaction formats.

val privkey = ECPrivateKey() // privkey: ECPrivateKey = Masked(ECPrivateKeyImpl) val pubkey = privkey.publicKey -// pubkey: org.bitcoins.crypto.ECPublicKey = ECPublicKey(0366560ad09cd479627c33e1c7d2fd829836209b79a4b0e7ebdf7a6b402f3d2a9c) +// pubkey: org.bitcoins.crypto.ECPublicKey = ECPublicKey(0389929cdfaff81f26096125a240c72bd375a440294f9dfa53e7b60ca148b1ce74) val segwitAddress = { // see https://bitcoin.org/en/glossary/pubkey-script @@ -89,10 +89,10 @@ reason to keep using legacy transaction formats.

val scriptPubKey = P2WPKHWitnessSPKV0(pubkey) Bech32Address(scriptPubKey, TestNet3) } -// segwitAddress: Bech32Address = tb1qj6c6f83am2h62hf0t4f7drky44gpuwx8x963zj +// segwitAddress: Bech32Address = tb1q5k9z4dgnvfg7pa7knkknqauz3dmm82ytwgk6vv println(segwitAddress.toString) -// tb1qj6c6f83am2h62hf0t4f7drky44gpuwx8x963zj +// tb1q5k9z4dgnvfg7pa7knkknqauz3dmm82ytwgk6vv

Generating legacy (base58) addresses

If you need to generate legacy addresses for backwards @@ -101,10 +101,10 @@ Take a look:

// 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 = muFkTgb56X9kfXiXNmjgjorobzXbuTDNVa
+// legacyAddress: P2PKHAddress = mvcFJhs8o4y6C5FAW2KydKNbJRjotesJdK
 
 println(legacyAddress.toString)
-// muFkTgb56X9kfXiXNmjgjorobzXbuTDNVa
+// mvcFJhs8o4y6C5FAW2KydKNbJRjotesJdK
 
Core ModuleHD Key Generation
Edit

TxBuilder Example

Bitcoin-S features a transaction building API that allows you to construct and sign Bitcoin transactions. Here's an example of how to use it

implicit val ec: ExecutionContext = ExecutionContext.Implicits.global
-// ec: ExecutionContext = scala.concurrent.impl.ExecutionContextImpl$$anon$3@1e0e090c[Running, parallelism = 2, size = 2, active = 0, running = 0, steals = 33, tasks = 0, submissions = 0]
+// ec: ExecutionContext = scala.concurrent.impl.ExecutionContextImpl$$anon$3@44f09d5f[Running, parallelism = 2, size = 2, active = 0, running = 0, steals = 33, tasks = 0, submissions = 0]
 
 // Initialize a transaction builder
 val builder = RawTxBuilder()
@@ -74,19 +74,19 @@
 val privKey = ECPrivateKey.freshPrivateKey
 // privKey: ECPrivateKey = Masked(ECPrivateKeyImpl)
 val pubKey = privKey.publicKey
-// pubKey: ECPublicKey = ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b)
+// pubKey: ECPublicKey = ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571)
 
 // this is the script that the TxBuilder is going to create a
 // script signature that validly spends this scriptPubKey
 val creditingSpk = P2PKHScriptPubKey(pubKey = privKey.publicKey)
-// creditingSpk: P2PKHScriptPubKey = pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471)
+// creditingSpk: P2PKHScriptPubKey = pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c)
 val amount = 10000.satoshis
 // amount: Satoshis = 10000 sats
 
 // this is the UTXO we are going to be spending
 val utxo =
   TransactionOutput(value = amount, scriptPubKey = creditingSpk)
-// utxo: TransactionOutput = TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))
+// utxo: TransactionOutput = TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))
 
 // the private key that locks the funds for the script we are spending too
 val destinationPrivKey = ECPrivateKey.freshPrivateKey
@@ -99,7 +99,7 @@
 // the script that corresponds to destination private key, this is what is receiving the money
 val destinationSPK =
   P2PKHScriptPubKey(pubKey = destinationPrivKey.publicKey)
-// destinationSPK: P2PKHScriptPubKey = pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)
+// destinationSPK: P2PKHScriptPubKey = pkh(040b93618e620d9894f8533d02cae96f77a8473a)
 
 // this is where we are sending money too
 // we could add more destinations here if we
@@ -110,7 +110,7 @@
 
     Vector(destination0)
 }
-// destinations: Vector[TransactionOutput] = Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)))
+// destinations: Vector[TransactionOutput] = Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a)))
 
 // Add the destinations to the tx builder
 builder ++= destinations
@@ -123,17 +123,17 @@ builder ++= destinations
                                   inputs = Vector.empty,
                                   outputs = Vector(utxo),
                                   lockTime = UInt32.zero)
-// creditingTx: BaseTransaction = BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))),UInt32Impl(0))
+// creditingTx: BaseTransaction = BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))),UInt32Impl(0))
 
 // this is the information we need from the crediting TX
 // to properly "link" it in the transaction we are creating
 val outPoint = TransactionOutPoint(creditingTx.txId, UInt32.zero)
-// outPoint: TransactionOutPoint = TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0)
+// outPoint: TransactionOutPoint = TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0)
 val input = TransactionInput(
     outPoint,
     EmptyScriptSignature,
     sequenceNumber = UInt32.zero)
-// input: TransactionInput = TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),EmptyScriptSignature,UInt32Impl(0))
+// input: TransactionInput = TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),EmptyScriptSignature,UInt32Impl(0))
 
 // Add a new input to our builder
 builder += input
@@ -141,11 +141,11 @@ builder += input
 
 // We can now generate a RawTxBuilderResult ready to be finalized
 val builderResult = builder.result()
-// builderResult: RawTxBuilderResult = RawTxBuilderResult(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621))),UInt32Impl(0))
+// builderResult: RawTxBuilderResult = RawTxBuilderResult(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a))),UInt32Impl(0))
 
 // this contains the information needed to analyze our input during finalization
 val inputInfo = P2PKHInputInfo(outPoint, amount, privKey.publicKey)
-// inputInfo: P2PKHInputInfo = P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b))
+// inputInfo: P2PKHInputInfo = P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571))
 
 // this is how much we are going to pay as a fee to the network
 // for this example, we are going to pay 1 satoshi per byte
@@ -155,18 +155,18 @@ builder += input
 val changePrivKey = ECPrivateKey.freshPrivateKey
 // changePrivKey: ECPrivateKey = Masked(ECPrivateKeyImpl)
 val changeSPK = P2PKHScriptPubKey(pubKey = changePrivKey.publicKey)
-// changeSPK: P2PKHScriptPubKey = pkh(5aa29f3253e73663094be6571a03985df20fe756)
+// changeSPK: P2PKHScriptPubKey = pkh(4fe3c730d47a698e80d97645cdbd161343b6f423)
 
 // We chose a finalizer that adds a change output to our tx based on a fee rate
 val finalizer = StandardNonInteractiveFinalizer(
     Vector(inputInfo),
     feeRate,
     changeSPK)
-// finalizer: StandardNonInteractiveFinalizer = StandardNonInteractiveFinalizer(Vector(P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b))),1 sats/byte,pkh(5aa29f3253e73663094be6571a03985df20fe756))
+// finalizer: StandardNonInteractiveFinalizer = StandardNonInteractiveFinalizer(Vector(P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571))),1 sats/byte,pkh(4fe3c730d47a698e80d97645cdbd161343b6f423))
 
 // We can now finalize the tx builder result from earlier with this finalizer
 val unsignedTxF: Future[Transaction] = finalizer.buildTx(builderResult)
-// unsignedTxF: Future[Transaction] = Future(Success(BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)), TransactionOutput(4775 sats,pkh(5aa29f3253e73663094be6571a03985df20fe756))),UInt32Impl(0))))
+// unsignedTxF: Future[Transaction] = Future(Success(BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a)), TransactionOutput(4775 sats,pkh(4fe3c730d47a698e80d97645cdbd161343b6f423))),UInt32Impl(0))))
 
 // We now turn to signing the unsigned transaction
 // this contains all the information we need to
@@ -176,12 +176,12 @@ builder += input
                                      signers = Vector(privKey),
                                      hashType =
                                          HashType.sigHashAll)
-// utxoInfo: ScriptSignatureParams[P2PKHInputInfo] = ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1)))
+// utxoInfo: ScriptSignatureParams[P2PKHInputInfo] = ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1)))
 
 // all of the UTXO spending information, since we only have
 // one input, this is just one element
 val utxoInfos: Vector[ScriptSignatureParams[InputInfo]] = Vector(utxoInfo)
-// utxoInfos: Vector[ScriptSignatureParams[InputInfo]] = Vector(ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1))))
+// utxoInfos: Vector[ScriptSignatureParams[InputInfo]] = Vector(ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1))))
 
 // Yay! Now we use the RawTxSigner object to sign the tx.
 // The 'sign' method is going produce a validly signed transaction
@@ -201,7 +201,7 @@ builder += input
   }
   Await.result(signedTxF, 30.seconds)
 }
-// signedTx: Transaction = BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),P2PKHScriptSignature(ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b), ECDigitalSignature(30440220649bba89a2d28a79201bb4b0e42e6bb158551cba6232515b5f1442fcc3593ba50220334a7225a1b97a73ceea0801652980c42d55a924d34d6a39b99a806767bf3ee801)),UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)), TransactionOutput(4775 sats,pkh(5aa29f3253e73663094be6571a03985df20fe756))),UInt32Impl(0))
+// signedTx: Transaction = BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),P2PKHScriptSignature(ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571), ECDigitalSignature(304402204944a1d2175ff45849f968bd1d56dec7f5f6de9b532251cfefc26fd29fc0aa2c02202ce372c92e35d7bef68acbf5e8d1c597796dd83738117ad9730a26e2eda98c0d01)),UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a)), TransactionOutput(4775 sats,pkh(4fe3c730d47a698e80d97645cdbd161343b6f423))),UInt32Impl(0))
 
signedTx.inputs.length
 // res2: Int = 1
@@ -211,7 +211,7 @@ signedTx.outputs.length
 
 //remember, you can call .hex on any bitcoin-s data structure to get the hex representation!
 signedTx.hex
-// res4: String = 0200000001f37d0d1c1dbe6b3f231b215a5e778be6fe6d23b1eae21ba8996ac243fb2e9a63000000006a4730440220649bba89a2d28a79201bb4b0e42e6bb158551cba6232515b5f1442fcc3593ba50220334a7225a1b97a73ceea0801652980c42d55a924d34d6a39b99a806767bf3ee80121030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b000000000288130000000000001976a9149c00f4e454c2aff50fe956b59e9f399c6606f62188aca7120000000000001976a9145aa29f3253e73663094be6571a03985df20fe75688ac00000000
+// res4: String = 02000000016e51828df550e6164ba0ba247f94e5f15fa3e6bdc28e276c41dfbdd992956036000000006a47304402204944a1d2175ff45849f968bd1d56dec7f5f6de9b532251cfefc26fd29fc0aa2c02202ce372c92e35d7bef68acbf5e8d1c597796dd83738117ad9730a26e2eda98c0d01210206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571000000000288130000000000001976a914040b93618e620d9894f8533d02cae96f77a8473a88aca7120000000000001976a9144fe3c730d47a698e80d97645cdbd161343b6f42388ac00000000
 
Edit

TxBuilder Example

Bitcoin-S features a transaction building API that allows you to construct and sign Bitcoin transactions. Here's an example of how to use it

implicit val ec: ExecutionContext = ExecutionContext.Implicits.global
-// ec: ExecutionContext = scala.concurrent.impl.ExecutionContextImpl$$anon$3@1e0e090c[Running, parallelism = 2, size = 2, active = 0, running = 0, steals = 33, tasks = 0, submissions = 0]
+// ec: ExecutionContext = scala.concurrent.impl.ExecutionContextImpl$$anon$3@44f09d5f[Running, parallelism = 2, size = 2, active = 0, running = 0, steals = 33, tasks = 0, submissions = 0]
 
 // Initialize a transaction builder
 val builder = RawTxBuilder()
@@ -74,19 +74,19 @@
 val privKey = ECPrivateKey.freshPrivateKey
 // privKey: ECPrivateKey = Masked(ECPrivateKeyImpl)
 val pubKey = privKey.publicKey
-// pubKey: ECPublicKey = ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b)
+// pubKey: ECPublicKey = ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571)
 
 // this is the script that the TxBuilder is going to create a
 // script signature that validly spends this scriptPubKey
 val creditingSpk = P2PKHScriptPubKey(pubKey = privKey.publicKey)
-// creditingSpk: P2PKHScriptPubKey = pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471)
+// creditingSpk: P2PKHScriptPubKey = pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c)
 val amount = 10000.satoshis
 // amount: Satoshis = 10000 sats
 
 // this is the UTXO we are going to be spending
 val utxo =
   TransactionOutput(value = amount, scriptPubKey = creditingSpk)
-// utxo: TransactionOutput = TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))
+// utxo: TransactionOutput = TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))
 
 // the private key that locks the funds for the script we are spending too
 val destinationPrivKey = ECPrivateKey.freshPrivateKey
@@ -99,7 +99,7 @@
 // the script that corresponds to destination private key, this is what is receiving the money
 val destinationSPK =
   P2PKHScriptPubKey(pubKey = destinationPrivKey.publicKey)
-// destinationSPK: P2PKHScriptPubKey = pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)
+// destinationSPK: P2PKHScriptPubKey = pkh(040b93618e620d9894f8533d02cae96f77a8473a)
 
 // this is where we are sending money too
 // we could add more destinations here if we
@@ -110,7 +110,7 @@
 
     Vector(destination0)
 }
-// destinations: Vector[TransactionOutput] = Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)))
+// destinations: Vector[TransactionOutput] = Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a)))
 
 // Add the destinations to the tx builder
 builder ++= destinations
@@ -123,17 +123,17 @@ builder ++= destinations
                                   inputs = Vector.empty,
                                   outputs = Vector(utxo),
                                   lockTime = UInt32.zero)
-// creditingTx: BaseTransaction = BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))),UInt32Impl(0))
+// creditingTx: BaseTransaction = BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))),UInt32Impl(0))
 
 // this is the information we need from the crediting TX
 // to properly "link" it in the transaction we are creating
 val outPoint = TransactionOutPoint(creditingTx.txId, UInt32.zero)
-// outPoint: TransactionOutPoint = TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0)
+// outPoint: TransactionOutPoint = TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0)
 val input = TransactionInput(
     outPoint,
     EmptyScriptSignature,
     sequenceNumber = UInt32.zero)
-// input: TransactionInput = TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),EmptyScriptSignature,UInt32Impl(0))
+// input: TransactionInput = TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),EmptyScriptSignature,UInt32Impl(0))
 
 // Add a new input to our builder
 builder += input
@@ -141,11 +141,11 @@ builder += input
 
 // We can now generate a RawTxBuilderResult ready to be finalized
 val builderResult = builder.result()
-// builderResult: RawTxBuilderResult = RawTxBuilderResult(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621))),UInt32Impl(0))
+// builderResult: RawTxBuilderResult = RawTxBuilderResult(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a))),UInt32Impl(0))
 
 // this contains the information needed to analyze our input during finalization
 val inputInfo = P2PKHInputInfo(outPoint, amount, privKey.publicKey)
-// inputInfo: P2PKHInputInfo = P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b))
+// inputInfo: P2PKHInputInfo = P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571))
 
 // this is how much we are going to pay as a fee to the network
 // for this example, we are going to pay 1 satoshi per byte
@@ -155,18 +155,18 @@ builder += input
 val changePrivKey = ECPrivateKey.freshPrivateKey
 // changePrivKey: ECPrivateKey = Masked(ECPrivateKeyImpl)
 val changeSPK = P2PKHScriptPubKey(pubKey = changePrivKey.publicKey)
-// changeSPK: P2PKHScriptPubKey = pkh(5aa29f3253e73663094be6571a03985df20fe756)
+// changeSPK: P2PKHScriptPubKey = pkh(4fe3c730d47a698e80d97645cdbd161343b6f423)
 
 // We chose a finalizer that adds a change output to our tx based on a fee rate
 val finalizer = StandardNonInteractiveFinalizer(
     Vector(inputInfo),
     feeRate,
     changeSPK)
-// finalizer: StandardNonInteractiveFinalizer = StandardNonInteractiveFinalizer(Vector(P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b))),1 sats/byte,pkh(5aa29f3253e73663094be6571a03985df20fe756))
+// finalizer: StandardNonInteractiveFinalizer = StandardNonInteractiveFinalizer(Vector(P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571))),1 sats/byte,pkh(4fe3c730d47a698e80d97645cdbd161343b6f423))
 
 // We can now finalize the tx builder result from earlier with this finalizer
 val unsignedTxF: Future[Transaction] = finalizer.buildTx(builderResult)
-// unsignedTxF: Future[Transaction] = Future(Success(BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)), TransactionOutput(4775 sats,pkh(5aa29f3253e73663094be6571a03985df20fe756))),UInt32Impl(0))))
+// unsignedTxF: Future[Transaction] = Future(Success(BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),EmptyScriptSignature,UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a)), TransactionOutput(4775 sats,pkh(4fe3c730d47a698e80d97645cdbd161343b6f423))),UInt32Impl(0))))
 
 // We now turn to signing the unsigned transaction
 // this contains all the information we need to
@@ -176,12 +176,12 @@ builder += input
                                      signers = Vector(privKey),
                                      hashType =
                                          HashType.sigHashAll)
-// utxoInfo: ScriptSignatureParams[P2PKHInputInfo] = ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1)))
+// utxoInfo: ScriptSignatureParams[P2PKHInputInfo] = ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1)))
 
 // all of the UTXO spending information, since we only have
 // one input, this is just one element
 val utxoInfos: Vector[ScriptSignatureParams[InputInfo]] = Vector(utxoInfo)
-// utxoInfos: Vector[ScriptSignatureParams[InputInfo]] = Vector(ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),10000 sats,ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(cba826a95bc8aba0e28eb4c78da62e66f755f471))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1))))
+// utxoInfos: Vector[ScriptSignatureParams[InputInfo]] = Vector(ScriptSignatureParams(P2PKHInputInfo(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),10000 sats,ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571)),BaseTransaction(Int32Impl(1),Vector(),Vector(TransactionOutput(10000 sats,pkh(f15083bd648b3bdb6793a57e2d9ff4a6f4db132c))),UInt32Impl(0)),Vector(Masked(ECPrivateKeyImpl)),SIGHASH_ALL(Int32Impl(1))))
 
 // Yay! Now we use the RawTxSigner object to sign the tx.
 // The 'sign' method is going produce a validly signed transaction
@@ -201,7 +201,7 @@ builder += input
   }
   Await.result(signedTxF, 30.seconds)
 }
-// signedTx: Transaction = BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(639a2efb43c26a99a81be2eab1236dfee68b775e5a211b233f6bbe1d1c0d7df3:0),P2PKHScriptSignature(ECPublicKey(030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b), ECDigitalSignature(30440220649bba89a2d28a79201bb4b0e42e6bb158551cba6232515b5f1442fcc3593ba50220334a7225a1b97a73ceea0801652980c42d55a924d34d6a39b99a806767bf3ee801)),UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(9c00f4e454c2aff50fe956b59e9f399c6606f621)), TransactionOutput(4775 sats,pkh(5aa29f3253e73663094be6571a03985df20fe756))),UInt32Impl(0))
+// signedTx: Transaction = BaseTransaction(Int32Impl(2),Vector(TransactionInputImpl(TransactionOutPoint(36609592d9bddf416c278ec2bde6a35ff1e5947f24baa04b16e650f58d82516e:0),P2PKHScriptSignature(ECPublicKey(0206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571), ECDigitalSignature(304402204944a1d2175ff45849f968bd1d56dec7f5f6de9b532251cfefc26fd29fc0aa2c02202ce372c92e35d7bef68acbf5e8d1c597796dd83738117ad9730a26e2eda98c0d01)),UInt32Impl(0))),Vector(TransactionOutput(5000 sats,pkh(040b93618e620d9894f8533d02cae96f77a8473a)), TransactionOutput(4775 sats,pkh(4fe3c730d47a698e80d97645cdbd161343b6f423))),UInt32Impl(0))
 
signedTx.inputs.length
 // res2: Int = 1
@@ -211,7 +211,7 @@ signedTx.outputs.length
 
 //remember, you can call .hex on any bitcoin-s data structure to get the hex representation!
 signedTx.hex
-// res4: String = 0200000001f37d0d1c1dbe6b3f231b215a5e778be6fe6d23b1eae21ba8996ac243fb2e9a63000000006a4730440220649bba89a2d28a79201bb4b0e42e6bb158551cba6232515b5f1442fcc3593ba50220334a7225a1b97a73ceea0801652980c42d55a924d34d6a39b99a806767bf3ee80121030ef6dce622cef7261e0dcffe189fda669db24a61f6116eb7f9ea0135e3cab48b000000000288130000000000001976a9149c00f4e454c2aff50fe956b59e9f399c6606f62188aca7120000000000001976a9145aa29f3253e73663094be6571a03985df20fe75688ac00000000
+// res4: String = 02000000016e51828df550e6164ba0ba247f94e5f15fa3e6bdc28e276c41dfbdd992956036000000006a47304402204944a1d2175ff45849f968bd1d56dec7f5f6de9b532251cfefc26fd29fc0aa2c02202ce372c92e35d7bef68acbf5e8d1c597796dd83738117ad9730a26e2eda98c0d01210206270087bf07c11d13e25b38fb9a7e63090b302802b39359d56e669d35883571000000000288130000000000001976a914040b93618e620d9894f8533d02cae96f77a8473a88aca7120000000000001976a9144fe3c730d47a698e80d97645cdbd161343b6f42388ac00000000