Skip to content

Commit edc515f

Browse files
authored
Merge pull request #71 from jrakibi/fix/responsive-transaction-diagrams
Fix: Improve Transaction Diagram Responsiveness
2 parents 39bdf78 + d7ab2ff commit edc515f

7 files changed

+85
-51
lines changed

decoding/transaction-signing-01.mdx

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,31 @@ Each input in a Bitcoin transaction must specify:
2121
- ScriptSig: Placeholder for the unlocking script
2222
- Sequence (4 bytes): Usually 0xFFFFFFFF
2323

24-
<div className="w-full rounded-xl overflow-hidden full-width">
25-
<SvgDisplay
26-
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature7.svg"
27-
width="100%"
28-
height="auto"
29-
/>
24+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden full-width">
25+
<div className="min-w-[800px]">
26+
<SvgDisplay
27+
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature7.svg"
28+
width="100%"
29+
height="100%"
30+
className="min-h-[400px] md:min-h-[500px] lg:min-h-[600px] object-contain"
31+
style={{
32+
aspectRatio: "16/9",
33+
maxHeight: "800px",
34+
transform: "scale(1.2)",
35+
transformOrigin: "center center"
36+
}}
37+
/>
38+
</div>
3039
</div>
3140

32-
The following table summarizes our UTXOs (Transaction IDs shown in big-endian format):
33-
34-
| Input | Transaction ID (big-endian) | Output Index | Sequence |
35-
| ----- | ---------------------------------------------------------------- | ------------ | -------- |
36-
| #1 | 9f96add4e4db413543df3eea1781c3be62637f1e2dd44069fa99801a88f7f7ff | 0 | eeffffff |
37-
| #2 | 8ac60eb9575db5b2d987e29f301b5b819ea83a5c6579d282d189cc04b8e151ef | 1 | ffffffff |
41+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden">
42+
<div className="min-w-[800px]">
43+
| Input | Transaction ID (big-endian) | Output Index | Sequence |
44+
| ----- | -------------------------- | ------------ | -------- |
45+
| #1 | 9f96add4e4db413543df3eea1781c3be62637f1e2dd44069fa99801a88f7f7ff | 0 | eeffffff |
46+
| #2 | 8ac60eb9575db5b2d987e29f301b5b819ea83a5c6579d282d189cc04b8e151ef | 1 | ffffffff |
47+
</div>
48+
</div>
3849

3950
_Note: In the transaction serialization below, these Transaction IDs are converted to little-endian format as required by the Bitcoin protocol._
4051

decoding/transaction-signing-02.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ Each output in a Bitcoin transaction requires:
1919
- Amount (8 bytes): Value in satoshis
2020
- ScriptPubKey: Locking script that defines spending conditions
2121

22-
<div className="w-full rounded-xl overflow-hidden full-width">
23-
<SvgDisplay
24-
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature8.svg"
25-
width="100%"
26-
height="auto"
27-
/>
22+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden full-width">
23+
<div className="min-w-[800px]">
24+
<SvgDisplay
25+
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature8.svg"
26+
width="100%"
27+
height="auto"
28+
className="min-h-[150px] md:min-h-[180px] lg:min-h-[220px] object-contain"
29+
/>
30+
</div>
2831
</div>
2932

3033
---
@@ -48,10 +51,14 @@ Each output in a Bitcoin transaction requires:
4851

4952
The following table summarizes our outputs from test vector:
5053

51-
| Output | Amount (BTC) | ScriptPubKey |
52-
| ------ | ------------ | ---------------------------------------------------- |
53-
| #1 | 1.2 | 1976a9148280b37df378db99f66f85c95a783a76ac7a6d5988ac |
54-
| #2 | 2.2 | 1976a9143bde42dbee7e4dbe6a21b2d50ce2f0167faa815988ac |
54+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden">
55+
<div className="min-w-[800px]">
56+
| Output | Amount (BTC) | ScriptPubKey |
57+
| ------ | ------------ | ---------------------------------------------------- |
58+
| #1 | 1.2 | 1976a9148280b37df378db99f66f85c95a783a76ac7a6d5988ac |
59+
| #2 | 2.2 | 1976a9143bde42dbee7e4dbe6a21b2d50ce2f0167faa815988ac |
60+
</div>
61+
</div>
5562

5663
Our transaction structure at this stage is:
5764

decoding/transaction-signing-03.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ When signing a P2WPKH (Segregated Witness) input, the signature and public key w
1818

1919
This is different from legacy transactions where signatures are placed directly in the `scriptSig`. The witness field starts empty and gets populated during the signing process.
2020

21-
<div className="w-full rounded-xl overflow-hidden full-width">
22-
<SvgDisplay
23-
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature9.svg"
24-
width="100%"
25-
height="auto"
26-
/>
21+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden full-width">
22+
<div className="min-w-[800px]">
23+
<SvgDisplay
24+
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature9.svg"
25+
width="100%"
26+
height="auto"
27+
className="min-h-[150px] md:min-h-[180px] lg:min-h-[220px] object-contain"
28+
/>
29+
</div>
2730
</div>
2831

2932
For signing a P2WPKH input, we need to generate the `scriptCode`

decoding/transaction-signing-04.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ images:
1414
parent: "transaction-signing"
1515
---
1616

17-
<div className="w-full rounded-xl overflow-hidden full-width">
18-
<SvgDisplay
19-
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature9.svg"
20-
width="100%"
21-
height="auto"
22-
/>
17+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden full-width">
18+
<div className="min-w-[800px]">
19+
<SvgDisplay
20+
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature9.svg"
21+
width="100%"
22+
height="auto"
23+
className="min-h-[150px] md:min-h-[180px] lg:min-h-[220px] object-contain"
24+
/>
25+
</div>
2326
</div>
2427

2528
After creating the basic transaction and scriptCode, we need to calculate three important hashes:

decoding/transaction-signing-06.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ When signing a transaction input, we follow these steps:
2424

2525
Let's use these values from our test vector:
2626

27-
| Value | Hex |
28-
|-------|-----|
29-
| Private Key | 619c335025c7f4012e556c2a58b2506e30b8511b53ade95ea316fd8c3286feb9 |
30-
| Public Key | 025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357 |
31-
| Commitment Hash | c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670 |
27+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden">
28+
<div className="min-w-[800px]">
29+
| Value | Hex |
30+
|-------|-----|
31+
| Private Key | 619c335025c7f4012e556c2a58b2506e30b8511b53ade95ea316fd8c3286feb9 |
32+
| Public Key | 025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357 |
33+
| Commitment Hash | c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670 |
34+
</div>
35+
</div>
3236

3337
## Step 1: ECDSA Signature Generation
3438

decoding/transaction-signing-07.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ parent: "transaction-signing"
1616

1717
Our transaction now has all its fields populated except for the witness data.
1818

19-
<div className="w-full rounded-xl overflow-hidden full-width">
20-
<SvgDisplay
21-
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature9.svg"
22-
width="100%"
23-
height="auto"
24-
/>
19+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden full-width">
20+
<div className="min-w-[800px]">
21+
<SvgDisplay
22+
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature9.svg"
23+
width="100%"
24+
height="auto"
25+
className="min-h-[150px] md:min-h-[180px] lg:min-h-[220px] object-contain"
26+
/>
27+
</div>
2528
</div>
2629

2730
For a P2WPKH input, the witness structure is:

decoding/transaction-signing-08.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ images:
1414
parent: "transaction-signing"
1515
---
1616

17-
<div className="w-full rounded-xl overflow-hidden full-width">
18-
<SvgDisplay
19-
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature10.svg"
20-
width="100%"
21-
height="auto"
22-
/>
17+
<div className="w-full rounded-xl overflow-x-auto overflow-y-hidden full-width">
18+
<div className="min-w-[800px]">
19+
<SvgDisplay
20+
src="/decoding-bitcoin/static/images/topics/transactions/signature/signature10.svg"
21+
width="100%"
22+
height="auto"
23+
className="min-h-[150px] md:min-h-[180px] lg:min-h-[220px] object-contain"
24+
/>
25+
</div>
2326
</div>
2427

2528
Our final signed transaction hex:

0 commit comments

Comments
 (0)