Skip to content

Commit

Permalink
Merge pull request #11 from mlabs-haskell/uhbif19/initial-docs
Browse files Browse the repository at this point in the history
Initial docs
  • Loading branch information
uhbif19 committed Feb 28, 2024
2 parents 8b8072e + d784b3d commit 5906b34
Show file tree
Hide file tree
Showing 5 changed files with 472 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
.vscode
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Define and reuse Cardano DApp logic via annotated CEM-machines, resulting in free implementations for:

* On-chain scripts
* Tx building/submission/resubmission on L1/L2/emulated testnet
* Tx building/submission/resubmission on L1/emulated testnet
* Tx parsing/indexing
* Automatically testing invariants
* Human-readable specs
Expand Down
42 changes: 42 additions & 0 deletions docs/arch_principles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Constraints design

## Principles

* Generic compilation across: on-chain code,
offchain Tx construction and indexing backend
* Simple normalization and SMT conversion for:
* Equivalence checking
* Bi-simulation checking
* Constraints determine TxIn/Outs up to UTxO coin-selection
(we call it almost-determinacy)
* Datum properties encoded as class types
* Common on-chain optimizations are performed if possible
* Constraints normalization, and CSE
* Best error short-cutting
* Common security problems prevention

## Potential obstacles

* Ease and optimality of backend compilation
* Robustness of SMT conversion and overall normalization
* Possibility for parsing and correct offchain usage
of almost-determinacy
* Having enough information for Tx submit retrying strategies
* Design for using custom Datum properties is not obvious

# CEM machine design

As it is done on top of constraints language,
all their principles and obstacles are affecting CEM as well.

## Principles

* State-machine is deterministic modulo coin-change
* Transaction can always be parsed back into SM transitions
* Potential non-deterministic on-chain optimizations
should not affect this principle.

## Potential obstacles

* Some scripts inexpressible by such model (as it happens in PAB)
* Sub-optimal code from deterministic transitions model

5 comments on commit 5906b34

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5906b34 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 3-564fd35d discovered in docs/goals_and_soa.md) and submitted as #17. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5906b34 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 3-3d54eede discovered in docs/goals_and_soa.md) and submitted as #18. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5906b34 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 3-b2217e99 discovered in docs/goals_and_soa.md) and submitted as #19. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5906b34 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 3-28c563ae discovered in docs/goals_and_soa.md) and submitted as #20. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 5906b34 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 3-548c6789 discovered in docs/goals_and_soa.md) and submitted as #21. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.