{"id":13767630,"url":"https://github.com/AztecProtocol/Oliver","last_synced_at":"2025-05-10T23:30:47.857Z","repository":{"id":98936420,"uuid":"203369683","full_name":"AztecProtocol/Oliver","owner":"AztecProtocol","description":"Huff implementation of the BabyJubJub curve","archived":true,"fork":false,"pushed_at":"2019-08-30T14:28:40.000Z","size":55,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-08T01:54:49.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AztecProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-20T12:15:42.000Z","updated_at":"2024-05-09T22:38:04.000Z","dependencies_parsed_at":"2024-01-11T23:53:18.790Z","dependency_job_id":"ff470506-6f3b-45e0-8f1a-ff9593c5957e","html_url":"https://github.com/AztecProtocol/Oliver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2FOliver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2FOliver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2FOliver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AztecProtocol%2FOliver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AztecProtocol","download_url":"https://codeload.github.com/AztecProtocol/Oliver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497296,"owners_count":21917683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T16:01:10.448Z","updated_at":"2025-05-10T23:30:47.569Z","avatar_url":"https://github.com/AztecProtocol.png","language":"JavaScript","readme":"## Oliver: efficient Baby-JubJub point arithmetic for smart contracts\n\nOliver (full name: Oliver Twisted Edwards) is a smart contract that performs elliptic curve point multiplication on the Baby-JubJub curve.\n\nIt can multiply up to 15 points (with up to 15 distinct scalars) at once.\n\n### Optimisations\n\nOliver is written in [Huff](https://github.com/AztecProtocol/huff), a low-level language that compiles to Ethereum Virtual Machine opcodes. It also uses many of the same optimisations employed by [weierstrudel](https://github.com/AztecProtocol/weierstrudel):\n\n* Shamir's trick, which combines multiple scalar multiplications into a single double-and-add loop, fixing the number of 'point doubling' operations to ~254\n* Sliding Window Non-Adjacent Form, a representation of scalar multipliers which reduces the number of 'point addition' operations to ~50 per point\n* Using the difference between the Baby-JubJub curve's 254-bit field modulus and the EVM's 256 word size to defer modular reductions until absolutely necessary\n\nBecause Baby-JubJub is a Twisted Edwards curve, a couple of optimisations from weierstrudel could not be used, namely the curve endomorphism which halved the number of point doubling operations required, and the trick whereby one could pretend points in projective coordinates had a Z value of 1. For these reasons, it's a bit less efficient than weierstrudel.\n\n### Benchmarks\n\nGas estimates can be obtained by running `yarn benchmark`.\n\n| Number of points | Approximate gas cost (average of 25 runs) | Cost per point |\n| ---------------- | ----------------------------------------- | -------------- |\n| 1                | 82,209                                    | 82,209         |\n| 2\t               | 107,060                                   | 53,530         |\n| 3                | 132,017                                   | 44,006         |\n| 4                | 157,479                                   | 39,370         |\n| 5                | 183,351                                   | 36,670         |\n| 6                | 210,331                                   | 35,055         |\n| 7                | 236,715                                   | 33,816         |\n| 8                | 265,050                                   | 33,131         |\n| 9                | 292,186                                   | 32,465         |\n| 10               | 321,404                                   | 32,140         |\n| 11               | 349,137                                   | 31,740         |\n| 12               | 379,098                                   | 31,592         |\n| 13               | 408,159                                   | 31,397         |\n| 14               | 439,310                                   | 31,379         |\n| 15               | 469,646                                   | 31,310         |\n\n### Usage\n\n1.  Run Oliver tests with `yarn test`\n2.  Run Oliver benchmarks with `yarn benchmark`\n","funding_links":[],"categories":["Know your roots, anon"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAztecProtocol%2FOliver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAztecProtocol%2FOliver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAztecProtocol%2FOliver/lists"}