Skip to content

Commit

Permalink
Spec: Update collectCom on-chain
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo authored and v0d1ch committed May 7, 2024
1 parent 2d10c87 commit b0b996d
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions spec/onchain.tex
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,15 @@ \subsection{CollectCom Transaction}\label{sec:collect-tx}
\begin{menumerate}
\item State is advanced from $\datumHead \sim \stInitial$ to
$\datumHead' \sim \stOpen$, parameters $\cid,\hydraKeysAgg,\nop,\cPer$ stay
unchanged and the new state is governed again by $\nuHead$:
unchanged and the new state is governed again by $\nuHead$
\[
(\stInitial,\cid,\seed,\hydraKeysAgg,\nop,\cPer) \xrightarrow{\stCollect} (\stOpen,\cid,\hydraKeysAgg,\nop,\cPer,\textcolor{blue}{s}, \eta)
(\stInitial,\cid,\seed,\hydraKeysAgg,\nop,\cPer) \xrightarrow{\stCollect} (\stOpen,\cid,\hydraKeysAgg,\nop,\cPer,\textcolor{blue}{0},\eta,\eta)
\]
\item Commits collected in $\eta = U^{\#}$ with snapshot number $0$,
where
\item Commits are collected in $\eta$
\[
U^{\#} = \combine([C_{1}, \dots, C_{\nop}])
\eta = U^{\#} = \combine([C_{1}, \dots, C_{\nop}])
\]
where
\[
\combine(\underline{C}) = \hash(\mathsf{concat}({\sortOn(1, \mathsf{concat}(\underline{C}))}^{\downarrow2}))
\]
Expand All @@ -278,21 +278,33 @@ \subsection{CollectCom Transaction}\label{sec:collect-tx}
can also be reproduced from the UTxO set later in the fanout.}.

\item All committed value captured and no value is extracted
$\valHead' = \valHead \cup (\bigcup_{i=1}^{n} \valCommit{i})$.
\[
\valHead' = \valHead \cup (\bigcup_{i=1}^{n} \valCommit{i})
\]
\item Every participant had the chance to commit, by checking all tokens are
present in output\footnote{This is sufficient as a Head participant would
check off-chain whether a Head is initialized correctly with the right
number of tokens.}
% NOTE: Implemented slightly different as we would only count PTs and = n
$|\{\cid \rightarrow . \rightarrow 1\} \in \valHead'| = \nop + 1$.
\item Transaction is signed by a participant $\exists \{\cid \mapsto \keyHash_{i} \mapsto 1\} \in \valCommit{i} \Rightarrow \keyHash_{i} \in \txKeys$.
\item No minting or burning $\txMint = \varnothing$.
\[
|\{\cid \rightarrow . \rightarrow 1\} \in \valHead'| = \nop + 1
\]
\item Transaction is signed by a participant
\[
\exists \{\cid \mapsto \keyHash_{i} \mapsto 1\} \in \valCommit{i} \Rightarrow \keyHash_{i} \in \txKeys
\]
\item No minting or burning
\[
\txMint = \varnothing
\]
\end{menumerate}

\noindent Each spent $\nuCommit$ validator with $\datumCommit{i} = (\cid,\cdot)$ and $\redeemerCommit{i} = \mathsf{collect}$ ensures that:
\begin{menumerate}
\item The state token of currency $\cid$ is present in the output value
$\st \in \valHead'$.
\[
\st \in \valHead'
\]
\end{menumerate}

\begin{figure}
Expand Down Expand Up @@ -324,11 +336,11 @@ \subsection{Increment Transaction}\label{sec:increment-tx}
\item State is advanced from $\datumHead \sim \stOpen$ to
$\datumHead' \sim \stOpen$, parameters $\cid,\hydraKeysAgg,\nop,\cPer$
stay unchanged and the new state is governed again by $\nuHead$
\todo{explain $\stOpen$ tuple}
\todo{need to check all fields!}
\[
(\stOpen,\cid,\hydraKeysAgg,\nop,\cPer,s,\eta_{\mathsf{prev}},\eta) \xrightarrow[\xi]{\mathsf{increment}} (\stOpen,\cid,\hydraKeysAgg,\nop,\cPer,s',\eta,\eta')
\]
\todo{explain $\stOpen$ tuple}
\todo{need to check all fields!}
\item Increment snapshot number $s'$ is higher than the currently stored snapshot number $s$
\[
s' > s
Expand Down

0 comments on commit b0b996d

Please sign in to comment.