firstbatchxyz / dkn-compute-node

Compute Node of Dria Knowledge Network.
Apache License 2.0
88 stars 34 forks source link

chore: refactor `h || s || e` logic to just `s || e` #52

Closed erhant closed 4 months ago

erhant commented 5 months ago

Given a result & task-id tuple $(y, t)$ with node key-pair $(k\text{priv}, k\text{pub})$ and task key-pair $(d\text{priv}, d\text{pub})$ it suffices to simply do:

$$ \begin{align} s \gets &\text{Sign}(k\text{priv}, t || y) \ e \gets &\text{Encrypt}(d\text{pub}, y) \end{align} $$

The admin node will verify as follows:

$$ \begin{align} y \gets &\text{Decrypt}(d\text{priv}, e) \ &\text{Verify}(k\text{pub}, s, t || y) \end{align} $$