leo/examples/groups
Alessandro Coglio ac38dfa028
[examples] Update some example files. (#2493)
* [examples] Update some READMEs.

These contained some copied-and-pasted text that had not been updated.

Also added a note about the need to switch private key for the second command
in `simple_token`.

* [examples] Update input file for lottery.

* [examples] Remove `leo build` from `vote` script.
2023-07-21 17:13:06 -07:00
..
build [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
inputs fix groups example, add comments 2022-07-20 23:25:13 -07:00
src implement group::GEN Leo syntax (#2401) 2023-05-31 16:05:56 -07:00
.env [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
.gitignore [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
program.json [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
README.md [examples] Update some example files. (#2493) 2023-07-21 17:13:06 -07:00

Leo group operations.

Run Guide

To run this program, run:

leo run main

Execute Guide

To execute this program, run:

leo execute main

Overview

This example shows how to do basic operations over groups.

It takes the input data from inputs/groups.in

Documentation Group Element

The set of affine points on the elliptic curve passed into the Leo compiler forms a group. A subset of those points, defined by a chosen generator point, forms a subgroup of the group. Leo supports the set of points in this subgroup as a primitive data type. Group elements are special since their values can be defined as coordinate pairs (x, y)group. The group type keyword group must be used when specifying a pair of group coordinates since implicit syntax would collide with normal tuple (a, b) values.

let a = 0group; // the zero of the group

let b = group::GEN; // the group generator

let c = (0, 1)group; // coordinate notation