stacks-network / sbtc-developer-release

sBTC primitives, signer components, helper tools
https://sbtc.tech
MIT License
1.98k stars 22 forks source link

[sBTC DR 0.2] Use better message signing format for withdrawal requests #286

Open friedger opened 11 months ago

friedger commented 11 months ago

Description

Withdrawal requests contain a signature of a hashed message. Currently, the message is specified as a byte array of amount and btc receiver address. The current implementation uses a human readable string as message (see #266) because wallets do not support arbitrary message signing (for good reasons).

We should use a structured message and update the SIP and the client libraries.

The current SIP suggest to withdraw with a stx address, not with a btc address. See comment: https://github.com/stacksgov/sips/pull/156/files#r1359458341

Expected Approach

Use a structured message as defined in SIP 17

Acceptance Criteria

friedger commented 11 months ago

The asset contract could contain a read-only function that does the hashing of the message so that clients can verify that they are creating the correct message.