Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added courses/scr403/assets/en/001.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added courses/scr403/assets/en/002.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added courses/scr403/assets/en/003.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added courses/scr403/assets/thumbnail.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions courses/scr403/course.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
id: 1f6d0544-c6f0-42c6-a8ef-acf485807b9d

topic: protocol

subtopic: script
type: theory

level: expert

hours: 10

teaching_format: self_paced

professors_id:
- a3b29adb-43ee-49f4-9582-b37e9cf72858

contributor_names:
- rogzy

published_at: 2026-03-02

tags:
- simplicity
- liquid
- scripting
- combinators
- type-system
- jets
- side-effects
- addresses
- CMR
- witness

original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0

license: CC-BY-SA-V4
842 changes: 842 additions & 0 deletions courses/scr403/en.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions courses/scr403/quizz/000/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: Why does Simplicity exclude dynamic memory allocation during execution?
answer: To enable static analysis and rule out entire classes of bugs and attacks.
wrong_answers:
- Because the Liquid Network does not support low-level memory operations.
- To reduce the programming learning curve for new smart-contract developers.
- Because Bitcoin Script itself also lacks any dynamic memory allocation.
explanation: >-
Simplicity avoids dynamic memory allocation so that all resource usage
can be determined statically before execution. This enables predictable
resource bounds and eliminates vulnerabilities related to memory management,
which is critical in a blockchain validation context.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/000/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 35ccd3ce-33df-4542-91d9-a558d92548df
chapterId: 6d46e77a-7e60-473b-b230-418da5ae44eb
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
12 changes: 12 additions & 0 deletions courses/scr403/quizz/001/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: What does sequential composition produce when chaining operation f (A → B) with operation g (B → C)?
answer: A single composite operation from A to C, with f's output feeding into g.
wrong_answers:
- A pair value containing both intermediate outputs of type B and C.
- A conditional that chooses between f and g based on the input.
- Two separate operations that run independently, sharing no data.
explanation: >-
Sequential composition chains two operations end-to-end. The output of the
first operation becomes the input of the second. In Simplicity, this is
expressed with the comp combinator: comp f g applies f first, then g to
the result.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/001/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 5c6d0109-ffe1-4da5-813d-204c9f467111
chapterId: 6d46e77a-7e60-473b-b230-418da5ae44eb
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
12 changes: 12 additions & 0 deletions courses/scr403/quizz/002/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: In parallel composition, what happens to the input?
answer: Both operations receive the same input, and their outputs form a product (pair).
wrong_answers:
- The input is split in half, with each operation receiving one separate part.
- One operation processes the input first, and the other receives the modified result.
- The input is tagged and routed to just one of the two operations to process.
explanation: >-
Parallel composition gives the same unmodified input to both operations
simultaneously. The results are bundled into a product type (pair). In
Simplicity, this uses the pair combinator, written f ▵ g, which produces
⟨f(a), g(a)⟩ for input a.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/002/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 9428566d-1ead-4d47-ba46-6b636029c0ef
chapterId: 6d46e77a-7e60-473b-b230-418da5ae44eb
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
12 changes: 12 additions & 0 deletions courses/scr403/quizz/003/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: What is a sum type (A + B) in Simplicity?
answer: "A tagged union: a value is either a left-tagged A or a right-tagged B."
wrong_answers:
- A type that contains all values from both A and B simultaneously.
- An arithmetic addition of the two component types' bit sizes.
- A function type that maps every input from A to an output in B.
explanation: >-
A sum type A + B is a tagged union. Each value carries a one-bit tag
indicating whether it's a left variant (of type A) or a right variant
(of type B). Even when A and B are the same type, left-tagged and
right-tagged values remain distinct.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/003/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: aa208130-3c60-4310-9867-dc6f80e8aba1
chapterId: 2a10a6ba-fada-4556-a673-3ae8c0794bf0
difficulty: easy
duration: 15
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
12 changes: 12 additions & 0 deletions courses/scr403/quizz/004/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: How many core combinators does Simplicity have?
answer: Nine (iden, unit, comp, pair, case, take, drop, injl, injr).
wrong_answers:
- Three (sequential composition, parallel composition, conditional).
- Five (comp, pair, case, take, and drop combinators only).
- Twelve (the nine core plus three extra extension combinators).
explanation: >-
Simplicity has exactly nine core combinators. Two basic operations (iden
and unit), three composition methods (comp, pair, case), and four
accessors (take, drop for products, injl and injr for sums). These nine
are sufficient to express any function between Simplicity types.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/004/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 54a868ea-e48c-4afc-a68a-f57b3d06c041
chapterId: 2a10a6ba-fada-4556-a673-3ae8c0794bf0
difficulty: easy
duration: 15
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
11 changes: 11 additions & 0 deletions courses/scr403/quizz/005/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
question: What does the 'take' combinator do?
answer: It extracts the left component of a product, discarding the right.
wrong_answers:
- It removes an element from a sum type, discarding the tag bit.
- It sequentially composes two separate operations end to end.
- It wraps a value with a left tag to build up a new sum type.
explanation: >-
The take combinator is an extractor for product types. Given take f
applied to a pair ⟨a, b⟩, it discards b and applies f to a. Combined
with iden, take iden extracts the first element of any pair.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/005/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 3f77abbb-10d4-41c6-a269-ccf8e0c44ff5
chapterId: 2a10a6ba-fada-4556-a673-3ae8c0794bf0
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
12 changes: 12 additions & 0 deletions courses/scr403/quizz/006/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: What does the completeness theorem guarantee about Simplicity?
answer: That any function between two Simplicity types can be built from the nine combinators.
wrong_answers:
- That Simplicity programs are guaranteed to always terminate in constant time.
- That Simplicity is Turing-complete and can simulate any Turing machine at all.
- That every valid Simplicity program has one single unique representation.
explanation: >-
The completeness theorem proves that for any function between finite
Simplicity types, there exists a Simplicity expression that computes it.
The constructive proof builds a lookup table using nested case and scribe
expressions. This has been formally verified in the Rocq proof assistant.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/006/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 963fde32-783e-4e20-8c3f-cae31bdcc2bf
chapterId: 2a10a6ba-fada-4556-a673-3ae8c0794bf0
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
13 changes: 13 additions & 0 deletions courses/scr403/quizz/007/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
question: How is the boolean type (𝟚) defined in Simplicity?
answer: As the sum type 𝟙 + 𝟙, holding exactly two values (false and true).
wrong_answers:
- As a product type 𝟙 × 𝟙 that would then hold only one value.
- As a special primitive type built directly into the language.
- As a 32-bit integer type restricted to just the values 0 and 1.
explanation: >-
The boolean type 𝟚 is defined as 𝟙 + 𝟙, a sum of two unit types. The
left-tagged value σᴸ⟨⟩ represents false (0) and the right-tagged value
σᴿ⟨⟩ represents true (1). This is a one-bit data type built from just
the unit type and the sum type former — the product former is not
needed.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/007/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: c0dc9faf-1c10-4082-82c3-e4b07e7217f9
chapterId: 2a10a6ba-fada-4556-a673-3ae8c0794bf0
difficulty: easy
duration: 15
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
13 changes: 13 additions & 0 deletions courses/scr403/quizz/008/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
question: How does the logical AND operation work in Simplicity?
answer: It branches on the first bit — if false it returns false, else the second bit.
wrong_answers:
- It multiplies the two boolean values together using the product type.
- It uses a lookup table with all four possible input combinations.
- It applies the XOR combinator and then the NOT combinator to the result.
explanation: >-
AND is defined as case (injl unit) (drop iden). The case combinator
branches on the first bit. If it's false (left-tagged), injl unit
returns false regardless of the second bit. If it's true (right-tagged),
drop iden returns the second bit unchanged. This matches the AND truth
table.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/008/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: e5e0c93e-c244-4d00-ac35-7bc6e4533813
chapterId: 9981ae62-ae50-4770-adf2-b253d1e08de3
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
12 changes: 12 additions & 0 deletions courses/scr403/quizz/009/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: What does a half-adder compute?
answer: The carry (AND) and sum (XOR) of two input bits.
wrong_answers:
- The sum of two multi-bit integers with carry propagation.
- The average of two bits rounded down.
- The bitwise OR and AND of two input bits.
explanation: >-
A half-adder takes two single bits and produces two outputs using
parallel composition: the carry bit (AND of inputs) and the sum bit
(XOR of inputs). In Simplicity it's defined as and ▵ xor, running
both operations on the same input pair.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/009/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 6d167e33-3e10-4e7a-8919-6565f929eb8d
chapterId: 9981ae62-ae50-4770-adf2-b253d1e08de3
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
12 changes: 12 additions & 0 deletions courses/scr403/quizz/010/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
question: How are fixed-length vectors built in Simplicity's type system?
answer: Through nested product types of power-of-two length (e.g. A⁴ = A² × A²).
wrong_answers:
- Using a special array type constructor built into the language.
- Through recursive sum types that chain the elements together in a list.
- Using variable-length buffers that have a fixed maximum size.
explanation: >-
Simplicity builds vectors from nested product types. A² is A × A,
A⁴ is A² × A², A⁸ is A⁴ × A⁴, and so on. This gives power-of-two
sized collections. For example, 𝟚²⁵⁶ (a 256-bit hash) is built by
nesting products 8 levels deep from the boolean type.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/010/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 582e5a78-71f9-4dca-87f0-bdcc65c5179b
chapterId: 9981ae62-ae50-4770-adf2-b253d1e08de3
difficulty: intermediate
duration: 30
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
13 changes: 13 additions & 0 deletions courses/scr403/quizz/011/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
question: What is the role of jets in Simplicity?
answer: Jets are native implementations replacing given Simplicity expressions for speed.
wrong_answers:
- Jets are a compilation step that converts Simplicity into Bitcoin Script.
- Jets are network messages that broadcast Simplicity programs to all nodes.
- Jets are debugging tools for testing and tracing Simplicity expressions.
explanation: >-
A jet is a native implementation that the network agrees to substitute
for a particular Simplicity expression (identified by its Merkle root).
The Simplicity expression serves as a formal specification of what the
jet computes, while the native code provides practical execution speed.
Common jets handle arithmetic and cryptographic operations like SHA-256.
reviewed: false
14 changes: 14 additions & 0 deletions courses/scr403/quizz/011/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
id: 1a8a9923-3600-446e-afd9-299c3bff7f9d
chapterId: 9981ae62-ae50-4770-adf2-b253d1e08de3
difficulty: easy
duration: 15
author: 2e1b5182-567e-453a-af29-36009340ff02
original_language: en

proofreading:
- language: en
last_contribution_date: 2026-03-02
urgency: 1
contributor_names:
- rogzy
reward: 0
13 changes: 13 additions & 0 deletions courses/scr403/quizz/012/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
question: Why are Simplicity expressions serialized as DAGs rather than trees?
answer: To prevent exponential growth, since shared sub-expressions are stored just once.
wrong_answers:
- Because plain tree structures cannot represent conditional branching at all.
- To enable parallel execution across many separate multi-core processors.
- Because the Liquid Network protocol strictly mandates the DAG format here.
explanation: >-
Simplicity expressions naturally form trees that could grow exponentially
as complexity increases. By serializing as directed acyclic graphs (DAGs),
sub-expressions that appear multiple times are stored once and referenced
by multiple parents. This keeps actual program sizes growing linearly
rather than exponentially.
reviewed: false
Loading