Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: implement bitcoin relayer #432

Open
wants to merge 135 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
ecf2c8d
BB-104 Update base multisig code and test creating wallet
zuttodoS Jun 25, 2024
d16c830
BB-105 update multisig code to allow signing tx through API
zuttodoS Jun 27, 2024
33e93a2
update to allow using the UTXO of user multisig
zuttodoS Jul 2, 2024
0a904f5
BB-106 remove redundant code and update comments
zuttodoS Jul 3, 2024
daf9293
BB-107 update to test on signet
zuttodoS Jul 6, 2024
b168f43
remove redundant import
zuttodoS Jul 8, 2024
134f2f1
BB-106 fix Invalid Schnorr signature for swap tx; optimize multisig code
zuttodoS Jul 10, 2024
bd3722a
BB-104 update lock time tap-leaf to the multisig
zuttodoS Jul 10, 2024
33572f2
BB-106 update multisig time lock recovery test
zuttodoS Jul 12, 2024
54e80e7
BB-106 update multisig recovery to relative timelock
zuttodoS Jul 15, 2024
dabc047
BB-160 update rune transfering lib
zuttodoS Jul 17, 2024
9bc478f
BB-160 update runestone decipher
zuttodoS Jul 19, 2024
74b6b2a
Bb 158 relayer btc support init connection between shard of multisig …
quankori Jul 30, 2024
33916d9
Merge branch 'dev' into feat/BB-104-BB-105-BB-106-BB-107; Remove redu…
zuttodoS Jul 30, 2024
15d47eb
Merge pull request #3 from lydialabs/feat/BB-104-BB-105-BB-106-BB-107
homelanderlovecoding Jul 30, 2024
32d03b5
feat: update master and slave bitcoin relayer
shallcdn Jul 31, 2024
3f81f47
BB-104 Update base multisig code and test creating wallet
zuttodoS Jun 25, 2024
facb9b6
BB-105 update multisig code to allow signing tx through API
zuttodoS Jun 27, 2024
95dd2d1
update to allow using the UTXO of user multisig
zuttodoS Jul 2, 2024
897288c
BB-106 remove redundant code and update comments
zuttodoS Jul 3, 2024
1f8f83d
BB-107 update to test on signet
zuttodoS Jul 6, 2024
013356e
remove redundant import
zuttodoS Jul 8, 2024
e153bfa
BB-106 fix Invalid Schnorr signature for swap tx; optimize multisig code
zuttodoS Jul 10, 2024
fae6147
BB-104 update lock time tap-leaf to the multisig
zuttodoS Jul 10, 2024
e81d9f3
BB-106 update multisig time lock recovery test
zuttodoS Jul 12, 2024
5386d09
BB-106 update multisig recovery to relative timelock
zuttodoS Jul 15, 2024
e54d6e4
BB-160 update rune transfering lib
zuttodoS Jul 17, 2024
ea58766
BB-160 update runestone decipher
zuttodoS Jul 19, 2024
0e61814
Bb 158 relayer btc support init connection between shard of multisig …
quankori Jul 30, 2024
178b5fb
feat: update master and slave bitcoin relayer
shallcdn Jul 31, 2024
82b0646
init provide for btc
homelanderlovecoding Aug 2, 2024
70b0c20
added iclient and implement function in provide
homelanderlovecoding Aug 3, 2024
4c560e6
added tx search method
homelanderlovecoding Aug 4, 2024
af783bb
BB-31 update encoder and decoder for ICON bitcoin bridge
zuttodoS Aug 4, 2024
f0ecd0d
imple gettx detail
homelanderlovecoding Aug 5, 2024
ee6eba8
merge latest
homelanderlovecoding Aug 6, 2024
8f42a7b
decode btc message
homelanderlovecoding Aug 6, 2024
5eb3366
fixed test
homelanderlovecoding Aug 6, 2024
b1fbbc5
BB-68 update encoder and decoder for RadFi Provide Liquidity OP_RETURN
zuttodoS Aug 6, 2024
9664004
validate runes deposit request
homelanderlovecoding Aug 7, 2024
76af44f
fixed validation
homelanderlovecoding Aug 7, 2024
ee14986
BB-69 update encoder decoder for radfi withdraw liquidity OP_RETURN
zuttodoS Aug 7, 2024
fd732dd
merge latest
homelanderlovecoding Aug 8, 2024
81be1ec
BB-69 update encoder decoder for RadFi collect fees OP_RETURN
zuttodoS Aug 8, 2024
896118c
added contract abis
homelanderlovecoding Aug 8, 2024
1367c44
converted to xcall message
homelanderlovecoding Aug 9, 2024
b6cdc41
BB-71 update encoder and decoder for RadFi swap OP_RETURN
zuttodoS Aug 12, 2024
abd8898
feat: update logic to run btc relay
shallcdn Aug 14, 2024
bfaaa5f
BB-68 update code read the bitcoin and rune utxos relayers received i…
zuttodoS Aug 14, 2024
1e5fcd3
BB-183 Update code encode and decode OP_RETURN Init pool
zuttodoS Aug 15, 2024
7a5e4d1
BB-184 Update code encode and decode for OP_RETURN Radfi Increase Liq…
zuttodoS Aug 15, 2024
5e45507
feat: update bitcoin relayer config
shallcdn Aug 19, 2024
e9be6c9
update tx creation code and test for op_return
zuttodoS Aug 20, 2024
a5b01dc
update to combine radfi init pool to provide liquidity op_return
zuttodoS Aug 20, 2024
a39daf8
Merge branch 'feat/BB-31-BB-32' into development/BB-35
zuttodoS Aug 23, 2024
9c90b8a
update encoder decoder for bitcoin bridge xcall message OP_RETURN
zuttodoS Aug 23, 2024
d2da4ad
fix x call message encoding for radfi LP after merging code
zuttodoS Aug 23, 2024
07ee2ff
update relayer multisig code and unit test
zuttodoS Aug 26, 2024
d665592
feat: move hardcode constant to config file
shallcdn Aug 27, 2024
154d425
added tx index
homelanderlovecoding Aug 28, 2024
4847664
feat: add lvdb for provider and test for provider route
shallcdn Aug 30, 2024
d60f7f8
added example
homelanderlovecoding Aug 31, 2024
1f3ec7e
feat: add decode relay message function
shallcdn Aug 31, 2024
8b2646f
Merge branch 'development/BB-35' of github.com:lydialabs/centralized-…
Aug 31, 2024
dce1091
update building multisig tx for icon -> bitcoin flow
zuttodoS Sep 1, 2024
f5b4f9a
update master relayer request 2 slave relayers to sign
zuttodoS Sep 1, 2024
708f580
update sign combining for icon->bitcoin flow
zuttodoS Sep 2, 2024
f062bc0
feat: add more config for slave mode
shallcdn Sep 2, 2024
fd43ebc
update for signing and combining bitcoin relay message
zuttodoS Sep 3, 2024
659dc23
update to optimize params
zuttodoS Sep 3, 2024
033ec6d
update connectors to bitcoin bridge OP_RETURN
zuttodoS Sep 9, 2024
086587f
update bitcoin deposit cases for provider route unit test
zuttodoS Sep 17, 2024
008204e
feat: add logic to rollback message if an error occurs
shallcdn Sep 22, 2024
9bfdf06
feat: update condition to check transaction send to multisign wallet
shallcdn Sep 25, 2024
a05ed4e
added mess type
homelanderlovecoding Sep 25, 2024
c5e4d2a
update messageType to xCall OP_RETURN
zuttodoS Sep 25, 2024
ccdcc32
update to fix rune transfer code and add test
zuttodoS Sep 27, 2024
e4f6614
feat: update logic to handle revert message
shallcdn Sep 29, 2024
d06ffe5
feat: update condition rollback message
shallcdn Sep 29, 2024
1c4d188
feat: change logic to get rollback message from db
shallcdn Sep 29, 2024
b0582f0
feat: change logic to get multisig by order
shallcdn Sep 30, 2024
50d7fc5
clean bitcoin tx code
zuttodoS Oct 4, 2024
3d6493f
remove redundant code
zuttodoS Oct 8, 2024
c4d0237
fix: get bridge message in txSearch
Oct 10, 2024
9782a5a
Merge pull request #4 from lydialabs/fix/get-bridge-message-in-txSearch
spiderlipovitan Oct 10, 2024
f11a09f
fix: correct format when call recvMessage to Icon with messageType (#5)
spiderlipovitan Oct 16, 2024
0fcbbac
update new unisat API interface
zuttodoS Oct 22, 2024
0120763
feat: withdraw rune from icon to btc
spiderlipovitan Oct 28, 2024
8485177
Merge pull request #6 from lydialabs/feat/withdraw-rune-from-icon-btc
spiderlipovitan Oct 29, 2024
d3f3d24
feat: validate btc message and refund
spiderlipovitan Nov 6, 2024
e6775b5
Merge pull request #7 from lydialabs/feat/validate-btc-message
spiderlipovitan Nov 6, 2024
fd4112f
feat: add doc for bitcoin relayer
shallcdn Nov 7, 2024
c818460
feat: call sign tx to slave with feeRate
spiderlipovitan Nov 12, 2024
e94ce32
Merge pull request #8 from lydialabs/feat/call-slave-with-feeRate
spiderlipovitan Nov 12, 2024
626433d
fix: set rune amount when withdraw
spiderlipovitan Nov 12, 2024
53f9850
Merge pull request #9 from lydialabs/fix/set-rune-amount
spiderlipovitan Nov 12, 2024
5f93683
feat: remove opreturn in bridge message
spiderlipovitan Nov 15, 2024
042aca6
Merge pull request #10 from lydialabs/feat/remove-opreturn
spiderlipovitan Nov 15, 2024
4736f65
feat: calculate tx vsize
spiderlipovitan Nov 15, 2024
a3844b7
Merge pull request #11 from lydialabs/feat/calculate-tx-vsize
spiderlipovitan Nov 15, 2024
ccb1c4e
fix: build multisig tx with rollback case
spiderlipovitan Nov 15, 2024
dccfbe2
Merge pull request #13 from lydialabs/fix/build-multisig-tx
spiderlipovitan Nov 15, 2024
6705a68
fix: update listener logic
shallcdn Nov 15, 2024
b8ca4af
feat: handle callback
spiderlipovitan Nov 15, 2024
ad36ada
Merge pull request #14 from lydialabs/feat/handle-callback
spiderlipovitan Nov 15, 2024
e66302f
fix: del cache relaymessage after success
spiderlipovitan Nov 15, 2024
997fcd0
Merge pull request #15 from lydialabs/fix/handle-cache
spiderlipovitan Nov 15, 2024
94b7363
fix: update log to track fetch bitcoin block number
shallcdn Nov 16, 2024
be4b022
chore: ignore data and keystore folder
shallcdn Nov 16, 2024
9b49c0c
feat: add condition to query block
shallcdn Nov 16, 2024
219d744
fix: interval time to get new block
shallcdn Nov 16, 2024
8b24dc4
feat: save handled message (#16)
spiderlipovitan Nov 16, 2024
8f3f82b
fix: remove unused
spiderlipovitan Nov 16, 2024
d001d80
Merge pull request #17 from lydialabs/fix/relay-message
spiderlipovitan Nov 16, 2024
f417347
fix: slave select default input from master
spiderlipovitan Nov 17, 2024
495e866
Merge pull request #18 from lydialabs/fix/slave-select-input
spiderlipovitan Nov 17, 2024
161c65a
feat: mainnet test
spiderlipovitan Nov 17, 2024
f2dbd6d
Merge pull request #19 from lydialabs/feat/test
spiderlipovitan Nov 17, 2024
d6314d2
chore: clean code
spiderlipovitan Nov 17, 2024
d97d429
Merge pull request #20 from lydialabs/chore/clean
spiderlipovitan Nov 17, 2024
a6aa177
chore: update document
shallcdn Nov 18, 2024
cdcb901
chore: update document and clean todo
shallcdn Nov 18, 2024
dbfe6d3
chore: resolve conflict
spiderlipovitan Nov 18, 2024
afa0fd9
chore: update documents and missing func in provier
spiderlipovitan Nov 18, 2024
8f55600
Merge branch 'main' into feat/bitcoin-relayer
shallcdn Nov 18, 2024
02d3ee1
Content fix - Justin
justinlydialabs Nov 18, 2024
02133f5
chore: update docs
spiderlipovitan Nov 19, 2024
74ded84
fix: remove unused code
spiderlipovitan Nov 22, 2024
a2873f0
chore: remove unnecessary
spiderlipovitan Nov 25, 2024
794455f
fix: handle error without fatalf log
spiderlipovitan Nov 26, 2024
877c3cb
fix: validate slave signs before sign transaction
spiderlipovitan Nov 26, 2024
1db133d
fix: remove fatal log
spiderlipovitan Nov 26, 2024
7c41ba0
chore: update doc
shallcdn Nov 29, 2024
2c6eeb1
chore: update doc for more details
shallcdn Nov 29, 2024
9d71ae7
fix: update mempoolURL in test
spiderlipovitan Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ artifacts
vendor
.DS_Store
.*env
dist
dist

keystore
data
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,35 @@ The following chains are supported:

## How to use ?

Refer to the [WIKI](<https://github.com/icon-project/centralized-relay/wiki>).
Refer to the [WIKI](https://github.com/icon-project/centralized-relay/wiki).

## Bitcoin Relay

How to run Slave server

### Prerequisites

Go 1.x installed
Set up your environment variables as required

### Start Slave 1

```bash
GO_ENV=slave PORT=8081 API_KEY=your_api_key go run main.go bitcoin
```

### Start Slave 2

```bash
GO_ENV=slave PORT=8082 API_KEY=your_api_key go run main.go bitcoin
```

### Start Master

```bash
GO_ENV=master PORT=8080 SLAVE_SERVER_1=http://localhost:8081 SLAVE_SERVER_2=http://localhost:8082 API_KEY=your_api_key go run main.go bitcoin IS_PROCESS=1
```

This env to trigger call the slaves

- IS_PROCESS=1
3 changes: 3 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

jsoniter "github.com/json-iterator/go"

"github.com/icon-project/centralized-relay/relayer/chains/bitcoin"
"github.com/icon-project/centralized-relay/relayer/chains/solana"
"github.com/icon-project/centralized-relay/relayer/chains/steller"
"github.com/icon-project/centralized-relay/relayer/chains/sui"
Expand Down Expand Up @@ -266,6 +267,8 @@ func (iw *ProviderConfigYAMLWrapper) UnmarshalYAML(n *yaml.Node) error {
iw.Value = new(steller.Config)
case "sui":
iw.Value = new(sui.Config)
case "bitcoin":
iw.Value = new(bitcoin.Config)
default:
return fmt.Errorf("%s is an invalid chain type, check your config file", iw.Type)
}
Expand Down
Loading
Loading