xclaim-sol
xclaim-sol copied to clipboard
issueToken: implement replay protection for BTC lock transaction
Problem: transaction can be replayed by a user to trick contract into issuing multiple tokens, possible with different contracts
Fix:
- Contract must check that contract address is in Bitcoin transaction -> prevent issuing on multiple issuing chains
- Contract generates a nonce which must be included in the Bitcoin tx -> counter
As a result, the contract returns a digest of:
- user eth address
- contract address
- counter