Skip to content

Commit 1c0eae8

Browse files
committed
add mermaid flowcharts to explain taproot and TXs
1 parent ebea5e0 commit 1c0eae8

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

docs/getting-started/simplicityhl.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,16 @@ See "What is the CMR?" below for more information.
4141

4242
## Understanding the Contract Model
4343

44-
### How Contracts Execute
44+
### How Contracts Execute On-Chain
4545

46-
**On-chain:**
46+
```mermaid
47+
graph TD
48+
A[Transaction] --> B["Simplicity VM <br>(Total: Guaranteed to terminate)"];
49+
B --> C["Your Program + Witness <br>(Stateless: Validates only)"];
50+
C --> D{Result};
51+
D -- pass --> E[Transaction is Valid];
52+
D -- abort --> F[Transaction is Rejected];
4753
```
48-
Transaction → Simplicity VM → Your Program + Witness → abort/pass
49-
```
50-
51-
* **If aborts:** Transaction is rejected
52-
* **Otherwise:** Transaction is valid
53-
54-
**No state:** Contracts are stateless - they validate only
55-
56-
**Total:** Every program runs in finite time for all inputs (and it is efficiently possible
57-
to compute bounds on this time; see "Cost and Resource Bounds" below)
5854

5955
### Witness Data
6056

@@ -344,16 +340,12 @@ A CMR (Commitment Merkle Root) is a 32-byte hash that uniquely identifies your S
344340

345341
**Code reference:** [`rust-simplicity/src/policy/sighash.rs`](https://github.com/BlockstreamResearch/rust-simplicity/blob/master/src/policy/sighash.rs)
346342

347-
```
348-
Your Contract (.simf)
349-
↓ Compile
350-
Simplicity Bytecode (identified by its CMR)
351-
↓ Create Taproot Tree
352-
Merkle Root
353-
↓ Combine with Internal Key
354-
Taproot Output Key
355-
↓ Encode
356-
P2TR Address (tex1p...)
343+
```mermaid
344+
graph TD
345+
A["Your Contract (.simf)"] -->|Compile| B["Simplicity Bytecode (identified by its CMR)"];
346+
B -->|Create Taproot Tree| C["Merkle Root"];
347+
C -->|Combine with Internal Key| D["Taproot Output Key"];
348+
D -->|Encode| E["P2TR Address (tex1p...)"];
357349
```
358350

359351
**Internal Key:** A provably unspendable public key (NUMS point)

0 commit comments

Comments
 (0)