CRYPTO NEWS

Size of signature

I was wondering what is typically the size of digital signature for every 1-bit data that is signed. I am trying to figure out how size of messages increases if I send only the data in a message or packet versus when I send the signed-data.

N.B. I am new this world of Cryptography, so don’t mind if my question sounds too puerile.

is pull over push pattern recommended for erc20 withdrawal too?

I had a chance to read the pull over push pattern for transferring/withdrawing ethers, but i’m not sure if i need to apply this for erc20 transfers. i.e. function buy(uint256 _someId, uint256 _price) external { require(weth.allowance(msgSender(), address(this)) >= _price, ‘insuffient weth’); // more codes … weth.safeTransferFrom(msgSender(), test[_someId].beneficiary, _price); _mint(msgSender(), tokenId); } This is my current::Listen

I had a chance to read the pull over push pattern for transferring/withdrawing ethers, but i’m not sure if i need to apply this for erc20 transfers.

i.e.

  function buy(uint256 _someId, uint256 _price) external {               require(weth.allowance(msgSender(), address(this)) >= _price, 'insuffient weth');         // more codes ...         weth.safeTransferFrom(msgSender(), test[_someId].beneficiary, _price);         _mint(msgSender(), tokenId);   } 

This is my current implementation where weth is transfered to beneficiary EOA right away, but if I apply pull and push pattern here, it would look like

  function buy(uint256 _someId, uint256 _price) external {               require(weth.allowance(msgSender(), address(this)) >= _price, 'insuffient weth');         // more codes ...         balance[msgSender()] += _price;         weth.safeTransferFrom(msgSender(), **address(this)**, _price);         _mint(msgSender(), tokenId);   }   function withdraw()... {     uint amount = balance[msgSender()];      require(amount != 0);     require(weth.balanceOf(address(this)) >= amount);      balance[msgSender()] = 0;      weth.transfer(msgSender(), amount);  } 

contract receives weth first and records the balance of the erc20 deposit.

Then user would withdraw it later by contract sending directly to beneficiary EOA.

To me it seems not right to apply erc20 transfers with pull over push? What’s the suggestion?

Size of signature

Shopping cart
There are no products in the cart!
Continue shopping
0