stacks-network / sbtc

Repo containing sbtc
GNU General Public License v3.0
298 stars 9 forks source link

[Feat] - Ensure the bridge can dynmically get the signer aggregate pubkey #837

Open setbern opened 2 weeks ago

setbern commented 2 weeks ago

User story - Bridge should be able to get signer aggregate pubkey in order to sign the tapleaves.

This info can be fetched from the contract

;; Get the current aggregate pubkey.
;; This function returns the current aggregate pubkey.
(define-read-only (get-current-aggregate-pubkey)
  (var-get current-aggregate-pubkey)
)

The network rpc changes based on the network we're currently on

janniks commented 2 weeks ago
    const res = (await fetchCallReadOnlyFunction({
      contractAddress,
      contractName: 'sbtc-registry',
      functionName: 'get-current-aggregate-pubkey',
      functionArgs: [],
      senderAddress: STACKS_DEVNET.bootAddress, // zero address
      network: 'devnet', // will use localhost:3999
    })) as BufferCV;

    const pub = res.value.slice(2);
janniks commented 2 weeks ago

For devenv contractAddress = 'SN3R84XZYA63QS28932XQF3G1J8R9PC3W76P9CSQS'

setbern commented 5 days ago

https://github.com/stacks-network/sbtc-bridge/pull/28