Skip to content

Commit

Permalink
Merge pull request #48 from jrakibi/transaction-module
Browse files Browse the repository at this point in the history
Transaction module
  • Loading branch information
jrakibi authored Jan 3, 2025
2 parents 279be43 + 768f11e commit 505f950
Show file tree
Hide file tree
Showing 66 changed files with 1,541 additions and 35 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/repository-dispatch-to-dependent-repos.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Send dispatch to dependent repos

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# Build job
dispatch:
runs-on: ubuntu-latest
steps:
- name: Dispatch to bitcoin-dev-project
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.DISPATCH_UPDATE_BDP }}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/bitcoin-dev-project/bitcoin-dev-project/dispatches \
-d '{"event_type": "update_submodules"}'
# Build job
dispatch:
runs-on: ubuntu-latest
steps:
- name: Dispatch to bitcoin-dev-project
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.DISPATCH_UPDATE_BDP }}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/bitcoin-dev-project/bitcoin-dev-project/dispatches \
-d '{"event_type": "update_submodules"}'
2 changes: 1 addition & 1 deletion decoding/bitcoin-history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Bitcoin History"
date: 2024-07-05T15:32:14Z
lastmod: "2024-07-06"
draft: false
category: History
category: Introduction
layout: TopicLayout
icon: "FaHistory"
order: 2
Expand Down
14 changes: 14 additions & 0 deletions decoding/fee-calculation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Fee Calculation"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 6
icon: "FaClipboardList"
images: ["/bitcoin-topics/static/images/topics/thumbnails/musig-thumbnail.webp"]
children: ["weight-vsize", "fee-rate", "rbf"]
---

(coming soon)
14 changes: 14 additions & 0 deletions decoding/fee-rate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Fee Rate"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 2
icon: "FaClipboardList"
images: ["/bitcoin-topics/static/images/topics/thumbnails/musig-thumbnail.webp"]
parent: "fee-calculation"
---

(coming soon)
1 change: 0 additions & 1 deletion decoding/implement-OP_ADD-OP_HASH160.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ images:
[
"/bitcoin-topics/static/images/topics/thumbnails/project-stack-thumbnail.webp"
]
topicType: exercise
parent: project
---

Expand Down
1 change: 0 additions & 1 deletion decoding/implement-OP_CHECKSIG.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ images:
[
"/bitcoin-topics/static/images/topics/thumbnails/project-stack-thumbnail.webp"
]
topicType: exercise
parent: project
---

Expand Down
1 change: 0 additions & 1 deletion decoding/implement-basic-stack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ images:
[
"/bitcoin-topics/static/images/topics/thumbnails/project-stack-thumbnail.webp"
]
topicType: exercise
parent: project
---

Expand Down
14 changes: 14 additions & 0 deletions decoding/inputs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Inputs"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 3.3
icon: "FaClipboardList"
images: ["/bitcoin-topics/static/images/topics/thumbnails/musig-thumbnail.webp"]
parent: "transaction-structure"
---

(coming soon)
14 changes: 14 additions & 0 deletions decoding/locktime.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Locktime"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 3.5
icon: "FaClipboardList"
images: ["/bitcoin-topics/static/images/topics/thumbnails/musig-thumbnail.webp"]
parent: "transaction-structure"
---

(coming soon)
54 changes: 54 additions & 0 deletions decoding/marker-flag.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: "Marker and Flag"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 3.2
icon: "FaClipboardList"
images:
[
"/bitcoin-topics/static/images/topics/thumbnails/transaction-module/tx-marker-flag.webp"
]
parent: "transaction-structure"
---

<TransactionCreation enabledFields={["marker", "flag"]} />

The marker and flag are optional fields introduced with **SegWit**.

They indicate that a transaction uses the segregated witness structure defined in **BIP144**.
Witness data is required for inputs locked by **P2WPKH**, **P2WSH**, or **P2TR**.

## Marker

Marker indicates that the transaction uses the extended format.

- Marker is **1 byte**.
- Must always be `0x00` to signal a SegWit transaction.

## Flag

- The flag is **1 byte**.
- It is currently set to `0x01` in all SegWit transactions.
- Future upgrades may use different flags.

<ExpandableAlert
title="Note: Legacy Compatibility"
type="info"
expandable={false}
>
If a transaction doesn’t include witness data, marker and flag are omitted.
</ExpandableAlert>

### Question

How do old nodes treat marker and flag for SegWit transactions?

<a
href="https://chat.bitcoinsearch.xyz/?author=holocat&question=How%2520do%2520old%2520nodes%2520treat%2520marker%2520and%2520flag%2520for%2520SegWit%2520transactions%253F"
target="_blank"
>
Answer here
</a>
6 changes: 5 additions & 1 deletion decoding/musig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,11 @@ Where:
### Final Signature

The final aggregate signature is:
<code>(R<span className="text-xs align-sub">agg</span>, s<span className="text-xs align-sub">agg</span>)</code>

<code>
(R<span className="text-xs align-sub">agg</span>, s
<span className="text-xs align-sub">agg</span>)
</code>

This pair can be verified using <code>P<span className="text-xs align-sub">agg</span></code> and the message `m`.

Expand Down
11 changes: 11 additions & 0 deletions decoding/network-propagation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Network Propagation"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 8
icon: "FaClipboardList"
images: ["/bitcoin-topics/static/images/topics/thumbnails/musig-thumbnail.webp"]
---
1 change: 0 additions & 1 deletion decoding/number-decoding-encoding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ images:
[
"/bitcoin-topics/static/images/topics/thumbnails/project-stack-thumbnail.webp"
]
topicType: exercise
parent: project
---

Expand Down
14 changes: 14 additions & 0 deletions decoding/outputs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Outputs"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 3.4
icon: "FaClipboardList"
images: ["/bitcoin-topics/static/images/topics/thumbnails/musig-thumbnail.webp"]
parent: "transaction-structure"
---

(coming soon)
1 change: 0 additions & 1 deletion decoding/p2ms-exercise-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 1
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2ms-thumbnail.webp"]
topicType: exercise
parent: p2ms
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2ms-exercise-2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 2
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2ms-thumbnail.webp"]
topicType: exercise
parent: p2ms
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2pk-exercise1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 2
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2pk-thumbnail.webp"]
topicType: exercise
parent: p2pk
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2pk-exercise2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 3
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2pk-thumbnail.webp"]
topicType: exercise
parent: p2pk
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2pk-exercise3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 4
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2pk-thumbnail.webp"]
topicType: exercise
parent: p2pk
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2pkh-exercise1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 1
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2pkh-thumbnail.webp"]
topicType: exercise
parent: p2pkh
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2pkh-exercise2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 2
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2pkh-thumbnail.webp"]
topicType: exercise
parent: p2pkh
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2sh-exercise-1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 1
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2sh-thumbnail.webp"]
topicType: exercise
parent: p2sh
---

Expand Down
1 change: 0 additions & 1 deletion decoding/p2sh-exercise-2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 2
images: ["/bitcoin-topics/static/images/topics/thumbnails/p2sh-thumbnail.webp"]
topicType: exercise
parent: p2sh
---

Expand Down
6 changes: 4 additions & 2 deletions decoding/pushdata-opcodes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ In bitcoin's scripting language, several opcodes are used to push data onto the
4. **OP_1NEGATE**: Pushes the number -1 onto the stack.

<ExpandableAlert title="Maximum Data Size" type="warning" expandable={false}>
Due to practical limitations and security considerations, the maximum amount of data that can be pushed in a single operation is **520
bytes**. As such, the **OP_PUSHDATA4** opcode is never used in practice (it allows for pushing 65536-4294967295 bytes).
Due to practical limitations and security considerations, the maximum amount
of data that can be pushed in a single operation is **520 bytes**. As such,
the **OP_PUSHDATA4** opcode is never used in practice (it allows for pushing
65536-4294967295 bytes).
</ExpandableAlert>

<ExpandableAlert
Expand Down
1 change: 0 additions & 1 deletion decoding/quiz.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ category: Scripts
layout: TopicBanner
order: 7
images: ["/bitcoin-topics/static/images/topics/thumbnails/quiz-thumbnail.webp"]
topicType: exercise
parent: overview
---

Expand Down
13 changes: 13 additions & 0 deletions decoding/rbf.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "RBF"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 0
icon: "FaClipboardList"
images: ["/bitcoin-topics/static/images/topics/thumbnails/musig-thumbnail.webp"]
---

(coming soon)
31 changes: 31 additions & 0 deletions decoding/roadmap.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: "Roadmap"
date: 2024-01-25T15:32:14Z
lastmod: "2024-07-26"
draft: false
category: Transactions
layout: TopicBanner
order: 0
icon: "FaClipboardList"
images:
[
"/bitcoin-topics/static/images/topics/thumbnails/transaction-module/tx-roadmap.webp"
]
---

<div className="full-width">
<div className="w-full">
<div className="dark:hidden w-full rounded-lg">
<SvgDisplay
src="/bitcoin-topics/static/images/topics/transactions/roadmap.svg"
height="auto"
/>
</div>
<div className="hidden dark:block w-full rounded-lg">
<SvgDisplay
src="/bitcoin-topics/static/images/topics/transactions/roadmap.svg"
height="auto"
/>
</div>
</div>
</div>
1 change: 0 additions & 1 deletion decoding/script-parser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ images:
[
"/bitcoin-topics/static/images/topics/thumbnails/project-stack-thumbnail.webp"
]
topicType: exercise
parent: project
---

Expand Down
Loading

0 comments on commit 505f950

Please sign in to comment.