Skip to content

Commit 4b11860

Browse files
Merge pull request #167 from cardano-hydrozoa/gf/spec-update
M2 spec update
2 parents 93e8425 + 08c153e commit 4b11860

25 files changed

+13434
-226
lines changed

specification/backmatter/A-future-work.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ \subsection{Eliminate post-dated transactions}%
6262

6363
Currently, Hydrozoa relies on multi-signed post-dated transactions for two features:
6464
\begin{itemize}
65-
\item Refunding a deposit after its deadline (\cref{h:l1-rule-based-transition}).
66-
\item Transitioning the head from the multisig regime to the rule-based regime after the multisig regime timeout (\cref{h:l1-rule-based-transition}).
65+
\item Refunding a deposit after its deadline (\cref{h:l1-rule-based-fallback}).
66+
\item Fallback to the rule-based regime after the multisig regime timeout (\cref{h:l1-rule-based-fallback}).
6767
\end{itemize}
6868
These transactions must be multi-signed because they spend utxos from the head's multisig native address.
6969
However, they are only intended as a fallback when the peers fail to reach a timely consensus on the preferred alternatives. For this reason, the L2 consensus protocol requires them to be post-dated; in this way, they can be multi-signed ahead of time while the peers can still reach a timely consensus.
@@ -87,7 +87,7 @@ \subsection{Eliminate post-dated transactions}%
8787
\end{split}
8888
\end{equation*}
8989

90-
This new observer script can classify its spent input as the treasury utxo or a deposit utxo. Then, it can decide whether to allow the rule-based transition or refund by comparing the transaction's time validity lower bound to the datum.
90+
This new observer script can classify its spent input as the treasury utxo or a deposit utxo. Then, it can decide whether to allow the rule-based fallback or refund by comparing the transaction's time validity lower bound to the datum.
9191
In other words, it allows a rule-based exit from a state managed by a native script.
9292

9393
\subsection{Fragmented treasury}%
@@ -98,7 +98,7 @@ \subsection{Fragmented treasury}%
9898

9999
Given the somewhat transient nature of state channels and the small numbers, we do not expect this constraint to affect most typical Hydrozoa use cases.
100100
However, if this becomes a problem, we could explore how to fragment a Hydrozoa head's treasury across multiple utxos.
101-
Observer scripts are helpful for fragmented treasuries because they facilitate an orderly transition of treasury fragments to the rule-based regime.
101+
Observer scripts are helpful for fragmented treasuries because they facilitate an orderly fallback of treasury fragments to the rule-based regime.
102102

103103
\section{Hydrozoa network and L2 interoperability}%
104104
\label{h:hydrozoa-network-l2-interoperability}%

specification/backmatter/B-deterministic-rollout-algorithm.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ \chapter{Deterministic rollout algorithm}%
88
The Hydrozoa protocol strives to generate L1 transactions deterministically whenever they require consensus from all peers (i.e., in the multisig regime).
99
This determinism allows the L2 consensus protocol and block validation procedure to focus on the essential contents of blocks without getting distracted in verifying the minutiae of the blocks' effects expressed as L1 transactions.
1010

11-
This determinism is easy to accomplish for a refund (\cref{h:l1-multisig-refund}) and a transition to the rule-based regime (\cref{h:l1-rule-based-transition}) because each of those transactions has a bounded number of inputs/outputs that are guaranteed to fit within Cardano's transaction size limit.
11+
This determinism is easy to accomplish for a refund (\cref{h:l1-multisig-refund}) and the fallback to the rule-based regime (\cref{h:l1-rule-based-fallback}) because each of those transactions has a bounded number of inputs/outputs that are guaranteed to fit within Cardano's transaction size limit.
1212
On the other hand, settlement of a major block on L1 (\cref{h:l1-multisig-settlement}) may require a large number of L2 withdrawals to be paid out on L1, such that one or more rollout transactions may be needed to handle its overflow of L1 outputs.
1313
Finalization (\cref{h:l1-multisig-finalization}) is also unconstrained in the number of L2 withdrawals it can pay out.
1414

specification/chapters/1-L1-multisig-regime.tex

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ \section{Utxo state}%
3333
\T{rolloutUtxos} &::& \T{UtxoSet^{L1}}
3434
\end{array}\right\}
3535
\end{equation*}
36+
37+
\begin{figure}[H]
38+
\begin{center}
39+
\includegraphics[width=\txDiagramScale\linewidth]{\subfix{../images/tx-diagram/1-multisig-regime-utxo-state.pdf}}
40+
\end{center}
41+
\caption[Multisig regime utxo state on L1.]{The L1 utxo state of the multisig regime.}
42+
\label{fig:utxo-state-multisig-regime}
43+
\end{figure}
44+
3645
Among these utxos, the head's treasury utxo is uniquely identified as the one holding the head's beacon token:
3746
\begin{enumerate}
3847
\item The policy ID corresponds to the head's native script (in minting policy form).
@@ -94,6 +103,14 @@ \section{Initialization}%
94103
\end{equation*}
95104
\end{itemize}
96105

106+
\begin{figure}[H]
107+
\begin{center}
108+
\includegraphics[width=\txDiagramScale\linewidth]{\subfix{../images/tx-diagram/2-initialization-tx.pdf}}
109+
\end{center}
110+
\caption[Multisig regime: Initialization tx.]{The Hydrozoa head's peers initialize its treasury utxo with an empty L2 ledger.}
111+
\label{fig:tx-initialization}
112+
\end{figure}
113+
97114
\section{Deposit}%
98115
\label{h:l1-multisig-deposit}%
99116

@@ -117,6 +134,14 @@ \section{Deposit}%
117134
The \code{refundAddress} and \code{refundDatum} fields define the address and datum to which the deposit's funds should be sent on L1 if the deposit is refunded.
118135
The funds in the deposit must be sufficient to pay for the refund transaction cost and create the refund utxo.
119136

137+
\begin{figure}[H]
138+
\begin{center}
139+
\includegraphics[width=\txDiagramScale\linewidth]{\subfix{../images/tx-diagram/3-deposit-tx.pdf}}
140+
\end{center}
141+
\caption[Multisig regime: Deposit tx.]{A user places some funds and instructions into a deposit utxo for a Hydrozoa Head.}
142+
\label{fig:tx-deposit}
143+
\end{figure}
144+
120145
\section{Refund}%
121146
\label{h:l1-multisig-refund}%
122147

@@ -132,6 +157,14 @@ \section{Refund}%
132157
The L2 consensus protocol (\cref{h:l2-consensus-on-refunds}) allows peers to obtain multi-signed post-dated refund transactions before posting their deposits on L1.
133158
It also allows them to immediately refund any deposits that its rules disqualify from being absorbed into the treasury.
134159

160+
\begin{figure}[H]
161+
\begin{center}
162+
\includegraphics[width=\txDiagramScale\linewidth]{\subfix{../images/tx-diagram/4-refund-tx.pdf}}
163+
\end{center}
164+
\caption[Multisig regime: Refund tx.]{The peers refund the deposit if it isn't absorbed into the treasury before the user's deadline.}
165+
\label{fig:tx-refund}
166+
\end{figure}
167+
135168
\section{Settlement}%
136169
\label{h:l1-multisig-settlement}%
137170

@@ -150,6 +183,15 @@ \section{Settlement}%
150183
It outputs the remaining withdrawals' aggregate funds as a single rollout utxo, sent to the head's native script address without a datum.
151184
Rollout transactions iteratively pay out more utxos from the rollout utxo, until all withdrawals are settled (\cref{h:l1-multisig-rollout}).
152185

186+
\begin{figure}[H]
187+
\begin{center}
188+
\includegraphics[width=\txDiagramScale\linewidth]{\subfix{../images/tx-diagram/5-settlement-tx.pdf}}
189+
\end{center}
190+
\caption[Multisig regime: Settlement tx.]{The peers absorb some deposits and pay out some withdrawals from the head's treasury.
191+
A rollout utxo can be produced to defer payout of some withdrawals for later.}
192+
\label{fig:tx-settlement}
193+
\end{figure}
194+
153195
\section{Finalization}%
154196
\label{h:l1-multisig-finalization}%
155197

@@ -164,10 +206,27 @@ \section{Finalization}%
164206
After the finalization transaction deals with the treasury and immediate/post-dated refund transactions deal with the unabsorbed deposits, no trace of the Hydrozoa head should be left in the L1 ledger.
165207
Any other utxos that remain at the head's native script address---assumed to be unrelated to the head---can be manually spent by the peers.
166208

209+
\begin{figure}[H]
210+
\begin{center}
211+
\includegraphics[width=\txDiagramScale\linewidth]{\subfix{../images/tx-diagram/6-finalization-tx.pdf}}
212+
\end{center}
213+
\caption[Multisig regime: Finalization tx.]{The peers pay out all remaining funds from the head's treasury.
214+
A rollout utxo can be produced to defer the payout of some withdrawals for later.}
215+
\label{fig:tx-finalization}
216+
\end{figure}
217+
167218
\section{Rollout}%
168219
\label{h:l1-multisig-rollout}%
169220

170221
The rollout utxo is spent in a rollout transaction, paying out some more withdrawals, and outputting a new rollout utxo with the aggregate funds of the rest of the withdrawals, if any remain.
171222
Further rollout transactions spend the shrinking rollout utxo, until all the withdrawals have been paid out (\cref{h:deterministic-rollout-rollouts}).
172223

224+
\begin{figure}[H]
225+
\begin{center}
226+
\includegraphics[width=\txDiagramScale\linewidth]{\subfix{../images/tx-diagram/7-rollout-tx.pdf}}
227+
\end{center}
228+
\caption[Multisig regime: Rollout tx.]{The peers pay out some withdrawals out of a rollout utxo, possibly leaving some for later payout.}
229+
\label{fig:tx-rollout}
230+
\end{figure}
231+
173232
\end{document}

0 commit comments

Comments
 (0)