Michael Amadi pfp

Michael Amadi

@michaels

92 Following
315 Followers


Michael Amadi pfp
Michael Amadi
@michaels
Happy to share that I'm joining @ OPLabsPBC as a Protocol Engineer. Excited to collaborate with some of the brightest minds to help scale Ethereum and build the future 🔴
7 replies
8 recasts
269 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Found an elliptic curve lib I was writing from scratch last year but didn't have the time to work much on it. I spent the weekend completing it. It's not as optimized as standard cryptography libs, but I can say it's way faster than it was initially. https://github.com/AmadiMichael/EllipticCurves
1 reply
0 recast
14 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Wrote a generic (over the number of `bitsPerIteration`) Strauss Shamir impl. The space complexity is O(2 ** 2n), where n is the bitsPerIteration. Because of this, it's important to find a balance between gas cost per iteration and memory expansion cost that comes with reducing the number of iterations by storing precomputed values in memory. OpenZeppelin for example, uses 2 bits per iteration for their P256 verifier. This example uses scalar numbers for simplicity but would also work if used with EC points and operations.
1 reply
0 recast
2 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Okay, issue raised. Maybe native bytecode linking (like huffidity) will be possible with EOF Solidity... any feedback is appreciated and welcome https://github.com/ethereum/solidity/issues/15211
1 reply
1 recast
4 reactions

Michael Amadi pfp
Michael Amadi
@michaels
EOF-Solidity feature requests: 1) Native support for Code Section types: Defined as a struct of 4 fields: bytecode, num of inputs, num of outputs and max stack height. This is to be defined at the contract level and must be known at compile time so that it can be validated and compiled together with the solidity code. Then within any function, the code section can be called via solidity or inline assembly and outputs are to be consumed. This feature enables using custom bytecode e.g hyper optimized hand written bytecode or from another compiler be used within solidity. Example with unchecked add 3 bytecode in comments:
1 reply
0 recast
2 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Improved it a bit. Here's an example of parsing a factory contract that creates another contract. This example is cool because it shows how nested container sections are encoded. - The first command parses the factory contracts eof bytecode - The second command copies the bytecode of the factory's first and only container (which is the init container of the contract to be deployed) and parses it, - The third command copies the bytecode of the init container's first and only container (which is the eof bytecode the init container will return as the runtime code of the contract to be deployed). https://github.com/AmadiMichael/EOF-Bytecode-Parser
0 reply
0 recast
2 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Spent yesterday evening making an EOF bytecode parser with some header invariant validation based on the specs. Also using this to get back into rust. Here's an example output when run with EOF bytecode: 0xef0001010004020001000304000400008000013050fe0bad60a7 Repo link in comments
1 reply
0 recast
4 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Here's an interesting way to encode all of the supported opcodes of an EVM chain in 256 bits. This is that of Ethereum mainnet currently. Base 2: 1110010000111111000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000111111111111111111111111111000000000000000100111111111111110000111111111111 Base 10: 103238640842065774761881656312677524192904604960857204817777740543577286447103 Base 16: 0xe43f0000000000000000001fffffffffffffffffffff07ffffff00013fff0fff Its also easy to check if a particular `opcode` is supported, like so: ``` uint256 opcodesBitmap = 103238640842065774761881656312677524192904604960857204817777740543577286447103; uint256 mask = shl(opcode, 0x01); bool isSupported = and(opcodesBitmap, mask); return isSupported; ```
1 reply
0 recast
4 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Officially an EOF Maxi
1 reply
0 recast
3 reactions

Michael Amadi pfp
Michael Amadi
@michaels
EOF Weekend 🔎
0 reply
0 recast
8 reactions

Michael Amadi pfp
Michael Amadi
@michaels
TIL: For addresses that do not exist, i.e., a) haven't sent a tx, i.e., nonce is 0 and b) haven't been the recipient of a non-zero value tx Their EXTCODEHASH is bytes32(0) and not keccak256(new bytes(0)) as you might expect. ...
1 reply
0 recast
3 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Successfully contributed to @penumbrazone summoning ceremony. Contribution receipt: 29F27D2CAC85019D41ECECDE693FA1DE0DDABF8B64D35A89673ED31985DCA1C1 Slot: 2152
0 reply
0 recast
0 reaction

Michael Amadi pfp
Michael Amadi
@michaels
Done with it. Learning fundamentals makes higher level stuff make so much more sense. Strongly recommend.
0 reply
0 recast
4 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Started yesterday...
2 replies
1 recast
4 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Just finished the Self-Hosted EVM quest on Node Guardians and can't recommend it enough. Link in comments
1 reply
0 recast
2 reactions

Michael Amadi pfp
Michael Amadi
@michaels
You're in her dms, I'm in her PXE. We're not the same.
1 reply
0 recast
2 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Last week was my last at Rareskills. It's been a wonderful ride researching, learning, and building with brilliant colleagues! Very grateful for the invaluable experiences and the exceptional people who made it an unforgettable part of my journey!
0 reply
0 recast
6 reactions

Michael Amadi pfp
Michael Amadi
@michaels
With EIP-7702 what happens if the one-time code executes the selfdestruct opcode? - Gas refund? - More gas? Seems the better option since the nodes will still attempt to delete the code & storage at the address after More importantly, what happens to the ETH at the address? Gets drained to the selfdestruct parameter?
1 reply
0 recast
5 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Congrats to everyone who submitted for the curta golf contest @atarpara @philogy @crypto-frens.eth 0xjustadev Spent hours working on a constant gas solution for hours only to realize when I was done that there was a codesize gas penalty imposed 🤦🏾‍♂️ Thought I should still share it though Link in comment
1 reply
1 recast
8 reactions

Michael Amadi pfp
Michael Amadi
@michaels
Thrilled to have been selected as one of the recipients of Builders Grant from @base for my P256 Huff Verifier: https://warpcast.com/michaels/0x51e39e31 Grateful for the support and excited to continue building 🫡
0 reply
0 recast
3 reactions