Commit Graph

47 Commits

Author SHA1 Message Date
noot
cca0b6c771 allow for multiple ongoing swaps (#128) 2022-06-13 20:50:10 -04:00
Matthew Di Ferrante
961ceea463 Optimize gas usage through less reads (#122)
* rework contracts to use less gas by storing just swap hash when creating a swap

* prevent overriding of existing swaps

* ensure swap exists when trying to refund

* update bindings script and go contract bindings

* update swapfactory go tests

* updating protocol, compiles

* update recoverer, everything builds

* fix cmd/recover tests

* fix recover tests

* lint

* fix checkContractCode

* fix protocol/ tests

* inherit secp256k1 instead of using library to prevent double deployment

* rerun abigen and hardcode runtime bin for now

* add nolint to long hardcoded runtime bin line

* cleanup commented out stuff

Co-authored-by: noot <elizabethjbinks@gmail.com>
2022-05-28 22:36:01 +02:00
noot
65d64544d7 implement unhappy path and error case integration tests (#102) 2022-03-21 15:54:41 -04:00
noot
d62765a1ff implement SwapFactory.sol and integrate into codebase (#85) 2022-01-26 19:27:29 -05:00
noot
c472ba4d94 cleanup ethereum tests (#77) 2022-01-17 10:56:43 -05:00
noot
651b3060a3 reimplement ecrecover hack for secp256k1 ecmul; change license to LGPL (#76) 2022-01-16 23:24:43 -05:00
noot
39e6cc0bcd integrate DLEq into protocol (#67)
* update contract to use secp256k1 curve verification

* update go contract bindings script and bindings

* cleanup rust code, move to its own folder

* remove commented out stuff

* go fmt

* add go wrapper around farcaster-dleq

* add unit tests for farcaster-dleq wrapper

* add dleq unit test for keys

* add swap.go claim test, worksgit status

* add swap.go refund tests

* lint

* update SendKeysMessage to include DLEqProof, update alice/bob generateKeys

* add dleq proof verification to alice/bob handlers

* move alice and bob to protocol package

* add common protocol funcs for generating/verifying dleq proof

* lint

* update alice to store secp256k1 pubkey commitments in contract, update alice/bob to use dleq secret when calling contract

* update alice unit tests

* fix bob unit tests

* update network msg size

* add build-dleq makefile step

* cleanup

* attempt to fix test

* skip inconsistent test on CI
2022-01-15 13:41:27 -05:00
noot
242cb82d92 implement recovery in case program crashes during swap (#65) 2022-01-11 23:40:46 -05:00
noot
6131c1d36f revert changes from issue #36 (#43)
* update protocol code

* lint, fix tests

* fix tests
2021-11-23 23:55:04 -05:00
noot
e32fc7ba48 protocol update: update contract to verify hash of private spend key, saving on gas (#37) 2021-11-22 00:01:53 -05:00
noot
5da175b471 utilize t0 and t1 logic in protocol code for Alice and Bob (#30) 2021-11-21 21:10:34 -05:00
Aleixo Sánchez
682bbfcf04 Test key derivation in Swap contract with random secrets (#14)
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2021-10-29 16:36:29 -04:00
noot
e9057490f9 add ci checks for build, test, lint; lint code; change filenames to be go-idiomatic (#12) 2021-10-25 18:20:14 -04:00
Aleixo Sánchez
5c27e17595 Fix Hardhat tests and tidying things up 2021-10-24 22:44:24 +02:00
Robert Hambrock
251cb04d34 revert SwapOnChain.sol to original state, modulo rename 2021-10-24 16:33:37 +02:00
Aleixo Sánchez
2f32f452db Update ethereum/contracts/SwapDLEQ.sol 2021-10-24 15:30:31 +01:00
Aleixo Sánchez
843efd23ea Revert SwapOnChain to ed25519 contract 2021-10-24 16:29:30 +02:00
Aleixo Sánchez
504deac20e Update ethereum/contracts/SwapDLEQ.sol 2021-10-24 15:24:37 +01:00
Aleixo Sánchez
1782ef4e6a Update ethereum/contracts/SwapDLEQ.sol 2021-10-24 15:24:14 +01:00
Aleixo Sánchez
f440017fb2 Update ethereum/contracts/SwapDLEQ.sol 2021-10-24 15:22:50 +01:00
Aleixo Sánchez
6879fe24cf Update ethereum/contracts/SwapDLEQ.sol 2021-10-24 15:21:54 +01:00
Aleixo Sánchez
01fbf0f2bd Update ethereum/contracts/Ed25519_alt.sol 2021-10-24 15:21:03 +01:00
Robert Hambrock
8a547bd901 Merge branch 'onchain-rename' into secp256k1_solidity 2021-10-24 15:58:25 +02:00
Robert Hambrock
3bf04202d3 rename Swap->SwapOnChain 2021-10-24 15:49:10 +02:00
Robert Hambrock
e96b4b190d rename Swap->SwapDLEQ 2021-10-24 15:26:48 +02:00
Robert Hambrock
5a3e72b2cd revert to fail on incorrect claim/refund privkey 2021-10-24 14:12:36 +02:00
Aleixo Sánchez
d6234ba00c Add license identifier 2021-10-24 14:12:36 +02:00
Robert Hambrock
e441ed13a2 fix ethereum/contracts/EC.sol
thanks @alxs

Co-authored-by: Aleixo Sánchez <15819210+alxs@users.noreply.github.com>
2021-10-24 14:12:36 +02:00
Robert Hambrock
d22a4e8c7a add attribution for 1Address in EC.sol 2021-10-24 14:12:36 +02:00
Robert Hambrock
cd7635fb36 temporarily disable pubkey verification in solidity
will debug later - first implement DLEQ proof exchange
2021-10-24 14:12:36 +02:00
Robert Hambrock
eccbf798ea add EC.sol and implement
currently replacing onchain implementation, but will ultimately coexist
2021-10-24 14:12:32 +02:00
Robert Hambrock
a007df7f86 add clone of https://github.com/1Address/ecsol/blob/master/contracts/EC.sol 2021-10-24 14:07:53 +02:00
Aleixo Sánchez
4a745b4487 Add sources & attribution 2021-10-24 13:13:01 +02:00
Aleixo Sánchez
ddef2c823b add secp tests 2021-10-24 12:41:01 +02:00
Aleixo Sánchez
f411f1b7ad add Hardhat project for Swap contract 2021-10-24 11:11:37 +02:00
Aleixo Sánchez
dc671597d0 only allow calling set_ready once 2021-10-24 10:41:10 +02:00
Aleixo Sánchez
a92e1bc84e Fix wrong bit being modified in pK 2021-10-24 03:20:28 +02:00
noot
e7ae8fed8c update Ed25519_alt.sol version 2021-10-23 20:46:54 -04:00
Aleixo Sánchez
66a99dc164 fix function visibility 2021-10-24 02:34:51 +02:00
Aleixo Sánchez
1fd7bda0ba fix function visibility 2021-10-24 02:34:16 +02:00
Aleixo Sánchez
33e96f9cf6 Fix finding LSB 2021-10-24 02:06:25 +02:00
Aleixo Sánchez
30a7bdcbca add alternative ed25519 implementation 2021-10-24 00:33:32 +02:00
Aleixo Sánchez
73b9463ab4 check pub key against cononical encoding 2021-10-23 19:13:07 +02:00
Aleixo Sánchez
20b89ff449 documentation 2021-10-23 18:24:21 +02:00
Aleixo Sánchez
630a32779c Fix leftover code 2021-10-23 18:17:52 +02:00
Aleixo Sánchez
b576296d49 compare points directly instead of hash 2021-10-23 18:12:35 +02:00
Aleixo Sánchez
f08858cc69 add .gitignore, renaming 2021-10-23 17:57:19 +02:00