Skip to content

Commit 4d24f4a

Browse files
committed
Add AtomicSwap circuit
1 parent a9b5df0 commit 4d24f4a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

circuits/atomic_swap.circom

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pragma circom 2.1.1;
2+
3+
include "./ecdsa/ecdsa.circom";
4+
include "../node_modules/circomlib/circuits/poseidon.circom";
5+
6+
template AtomicSwap() {
7+
signal input secret[4];
8+
9+
signal output pubkey[2][4];
10+
signal output secretHash;
11+
12+
pubkey <== ECDSAPrivToPub(64, 4)(secret);
13+
secretHash <== Poseidon(4)(secret);
14+
}
15+
16+
component main = AtomicSwap();

circuits/main.circom

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)