Closed radicleart closed 12 months ago
See [sBTC DR] Withdraw on testnet via sbtc bridge fails https://github.com/stacks-network/sbtc-bridge-web/pull/266
Added tool to bridge to parse transaction data.
The code that builds the data seems to accord with the spec
export function getDataToSign(network:string, amount:number, bitcoinAddress:string):Uint8Array {
const net = (network === 'testnet') ? btc.TEST_NETWORK : btc.NETWORK;
const tx = new btc.Transaction({ allowUnknowOutput: true, allowUnknownInputs:true, allowUnknownOutputs:true });
console.log('getDataToSign:bitcoinAddress: ' + bitcoinAddress)
tx.addOutputAddress(bitcoinAddress, BigInt(dust), net);
const amtBuf = amountToBigUint64(amount, 8);
const data = concat(amtBuf, tx.getOutput(0).script!);
const dataLen = hex.decode(data.length.toString(8));
return concat(dataLen, data);
}
Closing in favour of https://github.com/stacks-network/sbtc/issues/266
This withdraw transaction fails because the stacks address does not match the senders stacks address.
The incorrect stacks address has 0 balance and the burn (ft-burn?) fails with error u1 - insufficient balance.
The bridge may be encoding the stacks address / signature data incorrectly ?