zeta-chain / node

ZetaChain’s blockchain node and an observer validator client
https://zetachain.com
MIT License
167 stars 109 forks source link

`context.origin` should contain the full sender's Bitcoin address #1366

Closed fadeev closed 10 months ago

fadeev commented 1 year ago

Right now when a user calls an omnichain contract from Bitcoin, context.origin only contains the first 20 bytes of the hex representation of the bech32 Bitcoin addres.

So, if the address is:

tb1q2dr85d57450xwde6560qyhj7zvzw9895hq25tx

The hex representation of it is:

0x74623171326472383564353734353078776465363536307179686a377a767a7739383935687132357478

context.origin is:

0x7462317132647238356435373435307877646536

Having the full hex address in context.origin will greatly improve the developer experience of creating omnichain contracts.

fadeev commented 10 months ago

Ok, I was wrong. Looks like context.origin indeed contains the whole address, the decoding function in the contract was truncating it.