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 128 commits into
base: main
Choose a base branch
from

Conversation

shallcdn
Copy link

Description:

  • Implement Bitcoin relayer

Features:

  • Deposit BTC/Runes from BTC to Icon
  • Withdraw BTC/Runes from Icon to BTC
  • Rollback BTC/Runes when deposit fail
  • Refund BTC if the bridge message amount does not match the output to the relayer

Docs:

Including testing results and how to use bitcoin relayer

Mainnet contracts:

Name Address Token Id
XCall cxa07f426062a1384bdd762afa6a87d123fbc81c75
Asset manager cx2b763789b35d9a22db9b1ca41e2d9cc164283602  
Bitcoin address (dec 8) cx93e0ab1a31a16c98569ef1daff1dda13da187f7c 0x1.btc/0:0
UNCOMMON•GOODS (dec 0) cxd13eb06bfa756c3ca5a5aca7b7fe2d5ea01fc867 0x1.btc/1:0
Governance cx360034481214dedc3de0226f3bf2562bc0a371d5  
Xcall manager cxb86d8386f9847204dcf19d285cc3d4bbb686bdca  
Bitcoin multisig relayer 0x1.btc/bc1p2sdwgq7j32j250w8h47fe9v3hyc8fl2rdftwhxp0r7ww89mcwrns5reskh  

Checklist:

Please review the CONTRIBUTING.md file for detailed contributing guidelines.

zuttodoS and others added 30 commits June 25, 2024 16:34
…wallet (#2)

* feat: add transmission and bitcoin module

---------

Co-authored-by: k0r1 <[email protected]>
Add Bitcoin taproot multisig wallet library
…wallet (#2)

* feat: add transmission and bitcoin module

---------

Co-authored-by: k0r1 <[email protected]>
spiderlipovitan and others added 27 commits November 15, 2024 14:43
fix: build multisig tx with rollback case
fix: del cache relaymessage after success
fix: slave select default input from master
@@ -12,7 +13,9 @@ func (p *Provider) getRelayMessageFromLog(log types.Log) (*providerTypes.Message
return nil, fmt.Errorf("topic length mismatch")
}
topic := log.Topics[0]

if len(topic) != 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this logic break the existing implementation as we are doing the bitcoin relay for all the topic messages ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just redundant code, we have reviewed but left them out.
I removed them!


body, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatalf("Error reading response: %v", err)
Copy link
Collaborator

@bcsainju bcsainju Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider replacing FatalF with other severity as it means printf followed by os.exit leading the application to exit for every error. The relayer uses zap logger

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed these redundant codes too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants