Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contracts.md #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions docs/wiki/transactions/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ All outputs include a Pedersen commitment of the form `r*G + v*H` with `r`
the blinding factor, `v` the value, and G and H two distinct generator points
on the same curve group.

### Aggregate Signatures (a.k.a. Schnorr, MuSig)
### Schnorr Signatures

We suppose we have the SHA256 hash function and the same G curve as above. In
its simplest form, an aggregate signature is built from:
its simplest form, a Schnorr signature is built from:

* the message `M` to sign, in our case the transaction fee
* a private key `x`, with its matching public key `x*G`
Expand All @@ -45,12 +45,13 @@ s*G = k*G + e * x*G
```

In this simple case of someone sending a transaction to a receiver they trust
(see later for the trustless case), an aggregate signature can be directly
(see later for the trustless case), a signature can be directly
built for a Grin transaction by taking the above private key `x` to be the sum
of output blinding factors minus the sum of input blinding factors. The resulting
kernel is assembled from the aggregate signature generated using `r` and the
public key `r*G`, and allows to verify non-inflation for all Grin transactions
(and signs the fees).
(and signs the fees). In the case of a multi-signature, a more complex protocol called MuSig
is used for generating a Schnorr signature.

Because these signatures are built simply from a scalar and a public key, they
can be used to construct a variety of contracts using "simple" arithmetic.
Expand Down