CRYPTO NEWS

How to split bytes from calldata and convert into memory variables?

Assume calldata for my smart contract being address as bytes, and few amounts as bytes chained together.

How can I extract the bytes for address and store it in

address memory address_ =

and the amounts dynamically in

uint256 memory amount_1 =

uint256 memory amount_2 =

uint256 memory amount_3 =

I’d ideally want to convert straight to uint memory and address memory instead of just splitting them as bytes and working with bytes in the contract logic.

  • How do I split that at all to get the correct array lengths?
  • How can I make my contract know at what index to split the bytes? Let’s say there’s only 2 amounts… I could pass the index for splitting it, but is that good practice? Maybe a separator byte?

I’ve found 2 methods on ethereum.stackexchange, but I don’t think they would be complete without a method to split dynamically…

(1)

    bytes4 selector;     assembly {         selector := calldataload(data.offset)     } 

(2)

address(uint160(bytes20(keccak256(abi.encodePacked(...))))) 

and I require a bit of further explanations about those methods. If you do understand them, I’ll be grateful for a contribution/explanation. Thanks!

Merge two multisignatures

I want to know if there is a multisignature scheme that allows the merging of two multisignatures for the same data but by two different sets of users, and without knowing the corresponding private keys. The goal is to obtain a single multisig that has the same size than the two multisigs it originates from.::Listen

I want to know if there is a multisignature scheme that allows the merging of two multisignatures for the same data but by two different sets of users, and without knowing the corresponding private keys. The goal is to obtain a single multisig that has the same size than the two multisigs it originates from.

This would be useful to construct certificates in a network of users. For example, two distinct sets of 10 users both sign the message $m$ and produce two multisignatures, $s_1$ and $s_2$. Another user, which has not signed $m$ yet, receives $s_1$ and $s_2$ and wants to merge them together before adding his signature to the resulting multisig. Is there a cryptosystem that allows that?

The only multisignature scheme I know of is based on RSA, but it does not allow what I want: the only way to merge $s_1$ and $s_2$ with this technique is for all signers to contribute to one of these multisigs.

Thank you for your help.

How to split bytes from calldata and convert into memory variables?

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