diff --git a/assets/images/transactions/introduction.png b/assets/images/transactions/introduction.png new file mode 100644 index 000000000..aeb4536e0 Binary files /dev/null and b/assets/images/transactions/introduction.png differ diff --git a/assets/images/transactions/introduction@2x.png b/assets/images/transactions/introduction@2x.png new file mode 100644 index 000000000..faf6103cc Binary files /dev/null and b/assets/images/transactions/introduction@2x.png differ diff --git a/assets/images/transactions/placeholder.png b/assets/images/transactions/placeholder.png new file mode 100644 index 000000000..f754f2ed5 Binary files /dev/null and b/assets/images/transactions/placeholder.png differ diff --git a/assets/images/transactions/placeholder@2x.png b/assets/images/transactions/placeholder@2x.png new file mode 100644 index 000000000..e78ebc455 Binary files /dev/null and b/assets/images/transactions/placeholder@2x.png differ diff --git a/assets/images/transactions/tx-add-payment-mobile.svg b/assets/images/transactions/tx-add-payment-mobile.svg new file mode 100644 index 000000000..35b9d15df --- /dev/null +++ b/assets/images/transactions/tx-add-payment-mobile.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-add-payment.svg b/assets/images/transactions/tx-add-payment.svg new file mode 100644 index 000000000..ed9ac1595 --- /dev/null +++ b/assets/images/transactions/tx-add-payment.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-broadcast-mobile.svg b/assets/images/transactions/tx-broadcast-mobile.svg new file mode 100644 index 000000000..fc56ee8ad --- /dev/null +++ b/assets/images/transactions/tx-broadcast-mobile.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-broadcast.svg b/assets/images/transactions/tx-broadcast.svg new file mode 100644 index 000000000..6921acb91 --- /dev/null +++ b/assets/images/transactions/tx-broadcast.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-change.svg b/assets/images/transactions/tx-change.svg new file mode 100644 index 000000000..6e2c3dabe --- /dev/null +++ b/assets/images/transactions/tx-change.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/transactions/tx-file-mobile.svg b/assets/images/transactions/tx-file-mobile.svg new file mode 100644 index 000000000..53d936e19 --- /dev/null +++ b/assets/images/transactions/tx-file-mobile.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-file.svg b/assets/images/transactions/tx-file.svg new file mode 100644 index 000000000..c11afe2a4 --- /dev/null +++ b/assets/images/transactions/tx-file.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-fund-alt.svg b/assets/images/transactions/tx-fund-alt.svg new file mode 100644 index 000000000..e6ba462c8 --- /dev/null +++ b/assets/images/transactions/tx-fund-alt.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-fund-mobile.svg b/assets/images/transactions/tx-fund-mobile.svg new file mode 100644 index 000000000..44f66669f --- /dev/null +++ b/assets/images/transactions/tx-fund-mobile.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-fund.svg b/assets/images/transactions/tx-fund.svg new file mode 100644 index 000000000..45cc06cb7 --- /dev/null +++ b/assets/images/transactions/tx-fund.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-replace.svg b/assets/images/transactions/tx-replace.svg new file mode 100644 index 000000000..2331cb77f --- /dev/null +++ b/assets/images/transactions/tx-replace.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-sign-mobile.svg b/assets/images/transactions/tx-sign-mobile.svg new file mode 100644 index 000000000..3819357bb --- /dev/null +++ b/assets/images/transactions/tx-sign-mobile.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-sign.svg b/assets/images/transactions/tx-sign.svg new file mode 100644 index 000000000..bfb852879 --- /dev/null +++ b/assets/images/transactions/tx-sign.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-signed.svg b/assets/images/transactions/tx-signed.svg new file mode 100644 index 000000000..b5f725469 --- /dev/null +++ b/assets/images/transactions/tx-signed.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/images/transactions/tx-speed.svg b/assets/images/transactions/tx-speed.svg new file mode 100644 index 000000000..23d82b8cd --- /dev/null +++ b/assets/images/transactions/tx-speed.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/guide/transactions/batching.md b/guide/transactions/batching.md new file mode 100644 index 000000000..2010ea38a --- /dev/null +++ b/guide/transactions/batching.md @@ -0,0 +1,67 @@ +--- +layout: guide +title: Batching Payments +nav_order: 4 +parent: Transactions +permalink: /guide/transactions/batching/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Batching Payments + +A transaction is able to take multiple inputs (coins used to fund the transaction) and outputs (payments and the remaining change). So you can allow users to build a transaction that contains multiple payment operations. Enter, batched payments. + +A batched transaction is a collection of payments that will all be sent out at the same time, effectivly in the same transaction. This has a potential for fee saving benefits, but is terrible for privacy as it makes it possible to link one identity with several on-chain payments. + +Privacy issues aside, there are still use cases where batched transaction come into play, and the cost saving benefits are worth it being understood. + +--- + + — this is known as batching. There are fee saving benefits of batched transactions, but it can also be terrible for privacy as it makes it possible to link one identity with several payments on-chain. + +Still we use batched transactions in this chapter as it makes it easier to communicate the capabilities of an on-chain transaction. + +--- + +### How it works + +A company may want to pay all of its employees salaries at a specific day of the month. It would create a single transaction enter the payments (addresses and amounts) for each employee then fund the transaction with sufficient enough UTXOs. Once finalised, the transaction would be broadcasted and all employees would be paid once the transaction has gotten a confirmation. + +#### Pros + +- Save on fees as there is a fixed overhead for each transaction you create. + +#### Cons + +- Anyone recieving a payment in a batched transaction is able to know how much the payer + +### Best Practices + +#### When to use + +- Exchange +- Coinjoins +- UTXO Consolidation + +#### When not to use + +- If you are worried about a payee knowing how much you have paid others in the batch +- If you are worried about an observer + +#### Products that support this kind of payment + +- Bitcoin Core +- Any wallet which supports Coin Control + diff --git a/guide/transactions/case-studies.md b/guide/transactions/case-studies.md new file mode 100644 index 000000000..52f418d43 --- /dev/null +++ b/guide/transactions/case-studies.md @@ -0,0 +1,26 @@ +--- +layout: guide +title: Case Studies +nav_order: 7 +parent: Transactions +permalink: /guide/transactions/case-studies/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Case Studies + +... + +... \ No newline at end of file diff --git a/guide/transactions/introduction.md b/guide/transactions/introduction.md new file mode 100644 index 000000000..113950a53 --- /dev/null +++ b/guide/transactions/introduction.md @@ -0,0 +1,48 @@ +--- +layout: guide +title: Transactions +nav_order: 3 +has_children: true +permalink: /guide/transactions/introduction/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Transactions + +The bitcoin blockchain (on-chain) does not have a concept of accounts built-in. Since all on-chain transactions are public, bitcoin uses Unspent Transaction Outputs instead. Accounts would make it easy for anyone you transact with to find your entire balance and transaction history. + +To make a payment on-chain, you need to create a transaction, fund it by selecting some previously received bitcoin then select the payment destination address and amount. If there is any remainder, you need to set a change destination address; otherwise, the miner will take anything remaining as the fee to confirm the transaction into a block. + +On the receiving end, the person you are paying can see the UTXOs that you funded the transaction with if they choose to look it up in a [blockchain explorer](). They won't be able to see any of the other UTXOs in your wallet that you previously received. + +Taking this scenario further — if the recipient needs to make a payment to someone else, they would create a transaction of their own and fund it with the UTXO you sent. + +--- + +#### [Structure & Lifecycle]({{ '/guide/transactions/structure-and-lifecycle/' | relative_url }}) + +We dive into the structure of bitcoin transactions to understand its capabilities and relationship to the software we create to allow users to interact and manipulate it. + +#### [Signing]({{ '/guide/transactions/signing/' | relative_url }}) + +Authorisation to spend some bitcoin in a transaction is done in a process called signing — we look at the self spending and joint spending user flows for signing transactions. + +#### [Labeling]({{ '/guide/transactions/labels/' | relative_url }}) + +Since you never have to reveal your identity when transacting with bitcoin, you may find yourself in a situation where the person on thev other side of the payment also does not. It becomes a manual process to give context to your payments and the funds you control. We look at labels, a critical component of adding content to payments you send or receive. + +#### [Principles]({{ '/guide/transactions/principles/' | relative_url }}) + +Every use case and product is different but there are things that all wallet applications should strive for, and only diverge from with very good reasons. \ No newline at end of file diff --git a/guide/transactions/labels.md b/guide/transactions/labels.md new file mode 100644 index 000000000..09e94fde5 --- /dev/null +++ b/guide/transactions/labels.md @@ -0,0 +1,70 @@ +--- +layout: guide +title: Labeling Payments +nav_order: 5 +parent: Transactions +permalink: /guide/transactions/labels/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Labeling Payments + +In order to have … management of your funds… Types of data. Where are labels stored? + +#### Observer + +- Labels in coinjoin wallets can also be inherited, so a coin which was received from Bob, that was partially sent to Malroy would have 2 observers as both parties now know of the coin histories. + +#### Memo + +- Labels are also used to record other details about a payment like a reference to an invoice. + +## On-chain + +Labels are essential for coin management and selection — as they allow the user to keep track of who has observed a coin in their wallet but also when they need to grok the purpose of the payment for accounting or expense tracking purposes. + +- As with any payment some meta data should be stored to give context for accounting purposes + - Who it was paid to / received from + - What was paid for + +For coin control and management the most important piece of data is the who — having your coins separated by the individaul observers. + +Labels are not stored on on-chain, they are usually stored on the device running the wallet. So this means if a user imports their seed into another wallet it would only be able to fetch transactions and not any of the off-chain meta data— **see address discovery**. + +### Labeling Transactions + +#### Pros + +- ... + +#### Cons + +- ... + +### Labeling Payments + +#### Pros + +- ... + +#### Cons + +- ... + +## Lightning + +When creating a payment request, the memo on lightning is set in the description field of a BOLT11 invoice. It can also be extended with a “description_hash” to store things like an itemised list of whats being paid for typical purchase receipt. + +*NOTE: BIP21 has a message parameter, but most applications do not recognise this and only read the label.* \ No newline at end of file diff --git a/guide/transactions/principals.md b/guide/transactions/principals.md new file mode 100644 index 000000000..7be80eb43 --- /dev/null +++ b/guide/transactions/principals.md @@ -0,0 +1,48 @@ +--- +layout: guide +title: Principals +nav_order: 6 +parent: Transactions +permalink: /guide/transactions/principals/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Principals + +## Familiarity + +Using familiar patterns and analogies we can allow new users to begin interacting faster, and gradually grow their bitcoin knowledge — not having to learn too many things upfront and risk being overwhelmed and eventually give up before they even start. + +## Empathy + +- User is educated through the software, so they can slowly develop confidence by gaining experience. +- Be against dumbing things down, instead aim to make bitcoin understandable. +- Grow with the user. Not everyone is an expert, and even experts at one point in time are beginners. + +## Truthfulness + +Be truthful to bitcoin. + +You are not given privacy when interacting onchain — the perception of this could lead to bad consequences for users who are unaware and require such. + +Be true to the principals of bitcoin and display that honestly. Be truthful to the user. They should know they are using bitcoin, but not distracted by it when they need to complete a task. + +- *e.g. of not being truthful. Most wallets have a total balance and you spend out of the balance, but thats not how bitcoin works.* +- Help users learn what a UTXO is, not imediatly but over time. +- Give them choice. + +## Consistency + +Create a consistent visual language for similar objects, especially in the case when new concepts are being introduced to the user (*e.g. UTXOs*). diff --git a/guide/transactions/send-multi-signer.md b/guide/transactions/send-multi-signer.md new file mode 100644 index 000000000..ba127ae24 --- /dev/null +++ b/guide/transactions/send-multi-signer.md @@ -0,0 +1,54 @@ +--- +layout: guide +title: Joint Spending +nav_order: 3 +parent: Transactions +permalink: /guide/transactions/multi-signer/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Multi Signer Payments + +[INSERT INTRODUCTION] + +### How it works + +... + +#### Pros + +- ... + +#### Cons + +- ... + +### Best Practices + +#### When to use + +- ... + +#### When not to use + +- ... + +#### Variations + +- ... + +#### Products that support this kind of payment + +- ... \ No newline at end of file diff --git a/guide/transactions/send-single-signer.md b/guide/transactions/send-single-signer.md new file mode 100644 index 000000000..17aed9bd3 --- /dev/null +++ b/guide/transactions/send-single-signer.md @@ -0,0 +1,54 @@ +--- +layout: guide +title: Self Spending +nav_order: 2 +parent: Transactions +permalink: /guide/transactions/single-signer/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Self Spending + +Spending condition is only you. + +### How it works + +... + +#### Pros + +- ... + +#### Cons + +- ... + +### Best Practices + +#### When to use + +- ... + +#### When not to use + +- ... + +#### Variations + +- ... + +#### Products that support this kind of payment + +- The most basic payment is one which the user signs transactions themselves. \ No newline at end of file diff --git a/guide/transactions/structure-and-lifecycle.md b/guide/transactions/structure-and-lifecycle.md new file mode 100644 index 000000000..1ee68d55c --- /dev/null +++ b/guide/transactions/structure-and-lifecycle.md @@ -0,0 +1,263 @@ +--- +layout: guide +title: Structure & Lifecycle +nav_order: 1 +parent: Transactions +permalink: /guide/transactions/structure-and-lifecycle/ +main_classes: -no-top-padding +image: /assets/images/guide/transaction/introduction.png +--- + + + +{% include picture.html + image = "/assets/images/transactions/introduction.png" + retina = "/assets/images/transactions/introduction@2x.png" + mobile = "/assets/images/transactions/introduction.png" + mobileRetina = "/assets/images/transactions/introduction@2x.png" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +# Transaction Structure & Lifecycle + +Think of the application you're making as an editor for a transaction. Whether its a mobile wallet for personal spending or a desktop application for joint owners in a company to do shared spending. Both are taking in your users input to construct a transaction that would ultimatly allow them to move bitcoin. + +A lot of what is explained about here can be abstracted away in clever ways if you are designing for a first time bitcoin user. There are times though, when the use case demands more flexibility or transparency. The goal of this section is to equip you with the fundamentals to be able to make those design decisions. + +## Overview + +A transaction is able to take multiple inputs ([UTXOs](../glossary.md#) used to fund the transaction) and outputs (payments and the remaining change). You can also allow users to build a transaction that contains multiple payment operations. Once you're ready, you may publish the transaction so that it can be verified by the Bitcoin miners. + +--- + +## Creating a Transaction + +A transaction can be exported as a `.psbt` file. This is a standard format which can be shared in a similar way to a document. The file contains the authorisation to spend some bitcoin, and the payment amounts and destinations. + +A scenario to demonstrate how a transaction is can be collaboratively built is joint accounts / multi-sig. A user may want to share a transaction with another party or device for signing or to update. + +{% include picture.html + image = "/assets/images/transactions/tx-file.svg" + mobile = "/assets/images/transactions/tx-file-mobile.svg" + alt-text = "..." + width = 1600 + height = 900 +%} + +So you can think of a bitcoin wallet or application as both an edtior and viewer for transaction files — some applications may also allow you to publish or broadcast the transaction when preparation is done. + +Here are a few things you can set configure for a transaction: + +- **Locktime** — You can use locktime to make sure that the transaction is not mined until a specific block number, or a point in time[^3]. +- **Replace by Fee** — see [speeding up / canceling](#speeding-up--canceling) + +### Adding Payments + +There can be multiple payments within a transaction — at minimum all that is required by the user is to enter the destination address and the amount. These payments become UTXOs for whomever controls the private key of the addresses once the transaction gets confirmed. + +{% include picture.html + image = "/assets/images/transactions/tx-add-payment.svg" + mobile = "/assets/images/transactions/tx-add-payment-mobile.svg" + alt-text = "Adding Payments/Outputs" + width = 1600 + height = 900 + layout = "full-width" +%} + +###### How do payments get added to a transaction? + +- Scanning [payment request](/guide/foundations/wallet-interoperability/#qr-codes) in the form of a QR Code +- Detect [payment link](/guide/foundations/wallet-interoperability/#payment-links) in clip board +- Selecting an unpaid payment request +- Selecting contact that stores addresses and entering the amount +- Manually typing an address, amount and optionally a [label](/guide/transactions/labels) +- Subscription Manager automatically adds a scheduled payment to a transaction + +###### Reader Notes + +- The smallest total payment a transaction can have is 5460 satoshis. + +--- + +### Funding a transaction + +When transacting on the bitcoin blockchain (on-chain), you fund a transaction by selecting some previously received UTXOs. + +{% include picture.html + image = "/assets/images/transactions/tx-fund-alt.svg" + mobile = "/assets/images/transactions/tx-fund-mobile.svg" + alt-text = "Adding Inputs / Funding a Transaction" + width = 1600 + height = 900 + layout = "full-width" +%} + +--- + +### Change + +If the amount of bitcoin you funded the transaction with exceeds the amount you need for the payment there will be some change remaining. Your wallet would generate a new change address in the background where the remaining bitcoin would be sent. + +{% include picture.html + image = "/assets/images/transactions/tx-change.svg" + mobile = "/assets/images/transactions/tx-change-mobile.svg" + alt-text = "" + width = 1600 + height = 900 + layout = "full-width" +%} + +Change is handled the same way as any other payment described earlier, the only difference is you are in control of the private keys for that address. + +--- + +### Fee + +Each transaction needs to pay a fee to miners as they must do work to validate it. The fee is calculated based on the complexity of the transaction, and the fee rate fluctuates depending on the demand for the next block. + +{% include picture.html + image = "/assets/images/transactions/placeholder.png" + retina = "/assets/images/transactions/placeholder@2x.png" + mobile = "/assets/images/transactions/placeholder.png" + mobileRetina = "/assets/images/transactions/placeholder@2x.png" + alt-text = "..." + width = 1600 + height = 900 + layout = "full-width" +%} + +For example — a transaction with 1 payment being funded by 20 UTXOs would be more work for a miner to verify than one with 1 payment and 1 UTXO. Just as it would be more work for a market vendor to check 20 coins instead of a single note. + +The fee is included in transaction and subtracted from the change and is calculated based on the complexity of the transaction. + +Since there is a limited amount of space in each block, you are also competing with others who also want to have their transactions verified. + +The lowest fee rate you can pay is 1 satoshi per byte. + +There are times when the + +A transaction with many inputs would be larger in size and in turn be more difficult for a miner to validate. So the size of the transaction increases based on how many coins it was funded with, and amount of individual payments that it contains — there is also a fixed overhead cost for every transaction. + +The smallest transaction is about 226 virtual bytes, and the lowest fee is 1 satoshi. This means the transaction would be 226 satoshis. + +##### Reader Notes + +- There is no fixed fee, or percentage based fee with bitcoin on-chain transactions. +- The smallest fee you can pay is 226 satoshis + +Minimum relay fee — need the output amounts + +##### Fee & Mempool + +- How demand drives the fee up + +--- + +### Signing + +In order for a transaction to be valid and finalised — it needs to be signed. What is being signed is the bitcoin you funded the transaction with, and the payments you've added to that transaction (including the change). + +During this phase you import the transaction (file, or text) into the application that has your private key to perform the signing. Once signed any changes to the transactions would require signing to be performed again. + +##### In the wallet software + +Signing a transaction on your own is pretty straight forward, the user does not need to be prompted each time the transaction gets funded or a payment added. Instead signing is usually done all at once when the user approves the transaction to be broadcasted. + +##### External signing device + +There are devices special made for storing private keys and signing a `.psbt` file. + +{% include picture.html + image = "/assets/images/transactions/tx-sign.svg" + mobile = "/assets/images/transactions/tx-sign-mobile.svg" + alt-text = "..." + width = 1600 + height = 900 + layout = "full-width" +%} + +##### With another person + +There may be occasions where you are need to sign a transaction with another party — for example in a private key management scheme like [Shared multi-key](/guide/private-key-management/multi-user-schemes/). + +{% include picture.html + image = "/assets/images/transactions/tx-sign.svg" + mobile = "/assets/images/transactions/tx-sign-mobile.svg" + alt-text = "..." + width = 1600 + height = 900 + layout = "full-width" +%} + +--- + +### Broadcasting + +Once the transaction has been funded, payments selected, fee set, and signing is complete — its time to broadcast the transaction. The device that broadcasts the transaction needs to be online and have a connection to a [bitcoin node](/guide/getting-started/technology-primer/#what-is-a-node). The node which is constnatly communicating to other nodes and miners in the network for the latest transactions they have received from others around the world. + +{% include picture.html + image = "/assets/images/transactions/tx-broadcast.svg" + mobile = "/assets/images/transactions/tx-broadcast-mobile.svg" + alt-text = "..." + width = 1600 + height = 900 + layout = "full-width" +%} + +At this point the transaction is not yet confirmed — we say the transaction is in the [memory pool](/getting-started/technology-primer/#how-are-transactions-confirmed). + +--- + +### Pending / Confirmations + +There is a new block being creating on average every 10 mins. A payment is not guaranteed unless it’s in a transaction that has 1 or more confirmations. + +{% include picture.html + image = "/assets/images/transactions/placeholder.png" + retina = "/assets/images/transactions/placeholder@2x.png" + mobile = "/assets/images/transactions/placeholder.png" + mobileRetina = "/assets/images/transactions/placeholder@2x.png" + alt-text = "..." + width = 1600 + height = 900 + layout = "full-width" +%} + +--- + +### Speeding Up / Canceling + +##### Speeding up + +While you cannot remove a transaction from the mempool after it's been broadcasted, there are two recomended ways to speed up a transaction before it has been confirmed. Both methods require a new replacement transaction with a higher fee which would be prioritised before the origional. + +{% include picture.html + image = "/assets/images/transactions/tx-replace.svg" + mobile = "/assets/images/transactions/tx-replace-mobile.svg" + alt-text = "Bump Transaction" + width = 1600 + height = 900 + layout = "full-width" +%} + +###### Replace with a higher fee + +Not all transactions can do this — an option called "Replace by Fee" needs to be turned on before the transaction is broadcasted. + +###### Child pays for parent (tag along) + +In the event you need to spend some unconfirmed bitcoin, you can make a transaction with a high fee that includes a payment of those unconfirmed coins which would incentivise miners to prioritise both of them. + +##### Canceling Transactions + +Replace by Fee can be used to "cancel" a transaction — you would need to pay a higher fee so that this replacement transaction would be prioritised by miners. + +[^1]: https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki: "BIP125 —Replace by Fee" +[^2]: https://bitcoinops.org/en/topics/psbt/ + +[^3]: https://learnmeabitcoin.com/technical/locktime \ No newline at end of file