Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

HarryR/bn256 #20

Merged
merged 11 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
90 changes: 3 additions & 87 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
branch = "master"
name = "github.com/btcsuite/btcd"

[[constraint]]
branch = "master"
name = "github.com/clearmatics/bn256"

[[constraint]]
name = "github.com/stretchr/testify"
version = "1.1.4"
72 changes: 37 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,55 @@ Orbital is a command-line tool to generate off-chain data required by [Möbius][

## Usage

When deployed a Möbius contract will emit a `Message` that is an arbitrary hex encoded string. This message is signed to make withdrawals from the contract.
When deployed a Möbius contract will emit a `RingMessage` that is an arbitrary hex encoded string. This message is signed to make withdrawals from the contract.

Orbital can be used to generate all data needed to deposit and withdraw from a Möbius smart contract. Providing you have the `Message` value data can be generated as follows. In this example the hex encoded string is given as `666f6f62617262617a`. A ring size of 2 is generated.
Orbital can be used to generate all data needed to deposit and withdraw from a Möbius smart contract. Providing you have the `RingMessage` value data can be generated as follows. In this example the hex encoded string is given as `291a6780850827fcd8621...`. A ring size of 2 is generated.

orbital inputs -n 2 -m 666f6f62617262617a
./orbital inputs -n 2 -m 291a6780850827fcd8621d0e5471343831109bc14142ec101527b048bb3d1794

This generates JSON containing complete data required to deposit and withdraw. If you are just evaluating Möbius this is all you need to deposit into a contract and then make withdrawals once the ring is full.

``` JSON
{
"pubkeys": [
{
"x": 70742237615164982931155265691258765833107687230355458841421693916924953784687,
"y": 30840380996293202136210045282507572367400788071239347648907713335359761829138
},
{
"x": 27087078830110323521665066978195701528751557301745005184936110685042440855975,
"y": 59727407121757349990184094045181827269744685570035889585265768058760849316377
}
"message": "KRpngIUIJ/zYYh0OVHE0ODEQm8FBQuwQFSewSLs9F5Q=",
"ring": [
{
"x": 15522664089955551659852289328166700143127393484899632195419246838083707083092,
"y": 139725407559755444649292554266801350425737376800472574275109410266714217628
},
{
"x": 15769601697165987408284147780311087633600327546404112082093068531966136785797,
"y": 574193457253025311982882197162167841837660560297023031472921816123174737979
}
],
"signatures": [
{
"tau": {
"x": 115291306959110534762331116217359678632223049313671872799618131253150795715011,
"y": 76080870794898937526792396323808041305747583416466311515213280049789496276229
},
"ctlist": [
35677189825894557156716153963502736039665348954321031305574694716619151189549,
65174561444261965848365705550964568453721181219861371050511999790449291429430,
68918314092231193430341549175302250051979507143988817957533282992996303297168,
112489839489816450458560166033668548097711559543822342428171065661517939963774
]
},
{
"tau": {
"x": 115006347313112976079885905821054725945159504615599662386088608699176267829093,
"y": 69044543452700772992241492155130578191353062867454014235414028518071012328630
{
"tau": {
"x": 10156463942228021228545876819561826038791281705421256076529438066781624852871,
"y": 10521028020321534223595269087268496225446461286869992881505824752024716692663
},
"ctlist": [
21368655831583064736758400887160467297479232369129086125811187621405591279735,
12597762440685916653847888008183831634464726993537178408507664656131668212830,
6990298203776631120661116765313744556075488813405658404819872199156195642387,
14268213418230864809482216147768002586757463386138671647979779695664999133350
]
},
"ctlist": [
36089834007966644604238667848008859557570133615472349059737948082862755319880,
112132419790538882202963829436143925417567529362411156317555836886017363595398,
74804663813747299689957267313237784270831420442219423802333920445997909078632,
84943970980345001069419227022334735117723462889367512917231257466664229790991
]
}
{
"tau": {
"x": 18350120056062457577455309792248846176018677319782425143665947389092379940018,
"y": 17410042836747417050905448604207541669732600995872545566239761559163293972399
},
"ctlist": [
5234961786120978809275036908808283773251072203711221622865855236314635213488,
13528210618504793075305289291975247736253154818401760963070837217369448096451,
2788192854693864373131102131755172014022189917825686286639429882366651311778,
17072584727078276773282114103923714960058637541295589940252538659929574197139
]
}
]
}

```

Beyond evaluation it is likely that you will want to first generate public/private keypairs and distribute this to allow signatures to be created separately. To create a public/private keypairs for a ring size of `2` use
Expand Down
8 changes: 6 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# TODO

* Move curve to `alt_bn128`
* Benchmarks for verification, generation, derivation
* Push up external bn256 repo (with modifications required)
* Re-integrate secp256k1
* Benchmarks for verification, generation, derivation etc.
* Developer documentation / technical reference / links to whitepapers
* Make README very simple, from end-user perspective
* Interesting use cases
Loading