Albert Su

@albertsu

Joined on Jan 22, 2023

  • The goal of this document is to present an overview of the different approaches to validating the secp256r1 elliptic curve in an EVM setting. The primary goal is to reduce the gas cost of the signature verification, but there are also secondary tradeoffs to consider such as deployment gas costs, pre-computation/proving times, ease of use, and future areas of gas reduction. Zero Knowledge via Halo2 Single Signature gas cost: 391,331 gas High Level Approach: Know Nothing Labs uses a zero knowledge proofs to reduce the gas costs of the secp256r1 signature. Specifically, they support ES256 along the P-256 elliptic curve, which is present on Apple's FaceID/Touch ID, Andriod devices, Intel SGX secure enclaves, hardware devices like Yubikeys, and much more. End to End Flow:
     Like  Bookmark
  • Goals Figure out what exactly happened with hundred finance on optimism Find a list of similar compound v2 forks on various chains using Defillama Write a proof of concept for each compound v2 fork(bug bounties? but forks usually don't give them out) What happened Hundred Finance was just hacked yesterday on Optimism for ~7m The root of the exploit was the ability to transfer the underlying asset to the cToken to artificially raise the price of the cToken and thus how much you can borrow.
     Like  Bookmark
  • My Background: The last time I touched anything AI or machine learning was back in fall 2019, where I did a bit of NLP stuff for the Berkeley Haas Neuroeconomics Lab. It was mostly playing around with GloVe - I think the coolest thing was finding relationships between words that study participants did using word vectors and PCA. Since then, I haven't really touched ML at all, besides using ChatGPT for hw. Study plan I have a few hours, and it seems like transformers is the new hot shit, so we should start there and see where to go afterwards. Obviously, the seminal paper on transformers is Attention is all you need, so let's rawdog the paper and read it.
     Like  Bookmark
  • Motivation I've been doing protocol engineering for nearly 4 years now with a handful of projects, some of which have had millions of dollars in TVL, but I am still kinda mid. This is my how I go from a mid solidity engineer to a kinda good one. Smart Contract Design Patterns Github Repositories https://github.com/sablier-labs/v2-core Seaport Openzeppelin
     Like  Bookmark
  • Overview Established in 2021 by former engineers from Facebook, Mysten Labs is dedicated to constructing essential infrastructure to boost the adoption of web3. The company is actively engaged in expediting consensus through Narwhal, enhancing the security of smart contract programming with Move, and creating more sophisticated on-chain assets with Sui. On Dec 06, 2021, Mysten Labs raised $36 million in a Series A funding round led by Andreessen Horowitz (a16z). Sui offers scalability and unprecedented low latency for common use cases. Sui makes most transactions processable in parallel, which makes better use of processing resources, and offers the option to increase throughput with more resources. Sui forgoes consensus to instead use simpler and lower-latency primitives for common use cases, such as payment transactions and assets transfer. This is unprecedented in the blockchain world and enables several new latency sensitive distributed applications, ranging from gaming to retail payment at physical points of sale Team Mysten Labs employs ~35 employees who are skilled in different fields like software engineering, cryptography, and product management. The founding team has extensive experience in web3, programming languages, distributed systems, and cryptography. The team members have also gained business experience working for organizations like Apple, Facebook, and University College London. Evan Cheng, Co-Founder & CEO, has worked at Apple and Facebook Sam Blackshear, Co-Founder & CTO, created the Move programming language and worked at the University of Colorado, Facebook, and Novi Financial. Sam earned a Ph.D. in Programming Languages from the University of Colorado at Boulder
     Like  Bookmark
  • Problem Placing a bet takes too long: 10-20 seconds Individually claiming winning bets takes way too long: 10 seconds * number of bets The main reason why it takes so long for these transactions are twofold: Placing a bet has two transactions, approving your USDB for spending, then going and spending that transaction. Permit2 would technically solve this problem, but integrating that is too much work We are sending each transaction and waiting for the transaction receipt, meaning that the transaction needs to be included in a block. Solution
     Like  Bookmark
  • What the fuck is account abstraction? Besides being a nice buzzword to raise your next 3 at 30 round, account abstraction removes all current limitations on what we currently consider wallets. Want to send transactions and have someone else pay for gas? -> Paymasters Want to have social recovery? -> Add multiple keys Want to build tornado cash into the wallet layer? Want to send ETH to someone's twitter handle since you don't know their wallet address? -> CREATE2 with some twitter hash and send it before they deploy their wallet There's already a shit ton of resources out there on account abstraction, so here are some notes. I'm assuming you understand the following account abstraction via EIP-4337 is implemented solely with smart contracts, no changes to Ethereum are necessary
     Like  Bookmark
  • Estimated time, 30 minutes. You have a choice, you can do the more web3 task(task 1) which requires more context about crypto, or the UI heavy task(task 2), which just tests speed for building UI components. Task 1 Create a frontend that allows users to: Connect their wallet Check their current balance of WETH Wrapping ETH Unwrapping WETH
     Like  Bookmark
  • Executive Summary SnowballX Protocol combines Small Business PE(high-value, cash-flowing assets from first world countries) with US Treasury and invesment grade bonds. The protocol is constructed around three core smart contracts: RWAProtocol, SNB Staking Protocol, and SNT Distributor. These are supported by five distinct tokens, each playing a crucial role in the ecosystem: SNB, SNT, NFT, vSNB, and RWAProtocol Token. The integration of these elements forms a seamless interface for users to engage with the protocol. The RWA Protocol allows users to stake USDT, securing a non-transferable SNB token and an NFT that represents an upfront interest rate with defined terms. Upon maturity, these can be redeemed for USDT with added interest, fostering an environment for stable growth. To complement this, the RWAProtocol token can be staked in the SNT Rewarder contract, earning additional SNT rewards and enhancing the overall yield. The SNT Rewarder is the distributive mechanism of the SNT token within the protocol, rewarding users for their participation and investment in the ecosystem. The SNB Staking contract introduces a mechanism where SNB tokens can be staked to receive vSNB tokens at a 1:1 ratio, further integrating users into the SnowballX ecosystem.
     Like  Bookmark
  • Web2 Recovery User Story The user will create their wallet with a specific recovery method provided, such as a google account. When the recovery sequence is initiated, the user will send a OpenID Connect JWT token they fetch from their google account, generate a zk proof showing ownership of the token which is then verified on chain. If the verification is successful, the account ownership will be transferred to a new address after a period of seven days, during which the original owners can submit a transaction to cancel the ownership transfer. How it works The user adds their web2 recovery method to their funwallet, for example, they can add their google account albert@fun.xyz
     Like  Bookmark
  • Motivation We should never roll our own crypto. This means we should not come up with our own signature schemes, validation schemes, etc. Previously, we were using our own signature scheme in EIP-712 is the standard for readable signatures in the EVM ecosystem: https://eips.ethereum.org/EIPS/eip-712 This allows users who are signing stuff in Create3 to use their EOAs and to read what they are signing instead of seeing a bunch of meaningless bytes Background If you don't know what ecrecover is(like me before starting this fix), you should read this: https://medium.com/mycrypto/the-magic-of-digital-signatures-on-ethereum-98fe184dc9c7 EIP-712 doesn't provide replay protection, as there is no nonce inbuilt into the EIP-712. This guide explains how to implement nonces: https://medium.com/immunefi/intro-to-cryptography-and-signatures-in-ethereum-2025b6a4a33d
     Like  Bookmark
  • User Story I want to send some erc20s to someone, but I don't have their address, I only have their twitter handle. I want to be able to send crypto to a wallet generated by their twitter handle, but that wallet currently does not exist. Solution 1. In the SDK, someone calls getAddressOffline(twitter handle, rpc, entrypoint address, factory) and we return Newly Generated Wallet Address = CREATE2(factory contract address, twitter handle, fun wallet bytecode) Done, do FunWallet.getAddressOffline(uniqueId, index, rpcUrl, factoryAddress)
     Like  Bookmark
  • Background Sometimes, you don't want a transaction to be sent right away. For example, there might be an NFT mint that starts tomorrow at 7AM, but you don't want to wake up at 7AM to mint the NFT. With fun.xyz's automated actions, you can schedule a transaction at 7AM, pre-sign it, and make sure it only executes when the NFT mint opens. This document explains the design decisions and the architecture of Automated Actions. This includes smart contract design, sdk changes, server changes, storage changes(dynamoDB), and a new service that simulates transactions and sends them to bundler. Tenets Availability: When an automated action is scheduled, it should be executed as soon as the validation condition is true Scalability: We want to minimize the costs are are paying to aws, dynamoDB, our api server, and the cost of rpcs for simulation Customer Experience
     Like  Bookmark
  • POV: you are a developer looking to integrate the fun.xyz wallet SDK Features Assets Transfer and hold erc20, erc721, and erc1155 tokens with approve, transfer, and permit Developer Fees Set flat developer fees on a per transaction basis or as a percentage of gas, paid in either ERC20 tokens or the native gas token Dealing with Gas
     Like  Bookmark
  • Pimlico What we are most concerned about is transactions don't fail due to lack of gas. Forcing users to set gas limit a bit high and getting a bigger gas refund than expected is not too big of a deal. This shit is hard since a different state variable can cause a contract to go down a different code path, making transaction costs wildly different. One solution to this problem is to simulate across many blocks, not just the most recent block. There's a eth_estimateUserOperationGas that in theory should solve this issue for us. However, if this is not a supported endpoint for the rpc provider and chain we are using, then this will be a big problem. Pimlico needs to support every chain we support for us to be able to use them as a bundler Gas is three parts:preVerificationGas: The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata verificationGas: The amount of gas to allocate for the verification step callGasLimit: Simplest, can just get from simulating the transaction and returning how much it costs, similar to estimateGas User story Create an accurate estimate gas function. We don't care about the gas price, we just want to set the gas limit barely high enough to get the transaction to succeed
     Like  Bookmark
  • Important Links Arbitrum Delegate Platform Tally.xyz Profile - This is our tally.xyz profile. To edit this, you need access to the delegate address. Delegate Address - This is an EOA since Tally isn't really working with gnosis safe right now. PM Albert or Isaac if you want the private key. Arbitrum Snapshot - This is where you go to vote. You need to have the above delegate address(an EOA) connected to snapshot in order to vote. Arbitrum Forum - This is where discussions happen. PM Albert or Isaac for the account login details.
     Like  Bookmark
  • Links App: https://bandit-club.vercel.app/ Frontend Github: https://github.com/AlbertSu123/ethdenverhack Backend Github: https://github.com/AlbertSu123/banditclub Overview Bandit Club is a new paradigm in smart contract monetization. Individuals pay a subscription fee to Bandit Club based on their addresses total volume. Bandit Club keeps 10% of the subscription fee. The remainder is distributed to the deployers of the smart contracts that the individual user has interacted with. It will initially be divided and based on # of interactions with each contract, but the DAO can change the pricing structure as necessary. Smart contracts can opt to only take users if they are Bandit Club subscribers, thus ensuring they are getting paid on every interaction. This will create a powerful feedback loop where more people will subscribe to gain access, which will in turn have more developers add the restriction on their contract, which will encourage more people to subscribe, etc. There is near zero fork risk for n+2 protocol after n, n+1 protocol on board as they inherit their network effects.
     Like  Bookmark
  • Links App: https://dynamicstableswap.netlify.app/#/ Contracts Github: https://github.com/AlbertSu123/dynamicstableswap-contracts Frontend Github: https://github.com/AlbertSu123/hgh Description This is a slight improvement on the traditional curve stableswap that protects liquidity providers against arbitrageurs during times of great volatility, such as when a stablecoin depegs. Traditionally, stableswap are used to swap between different pegged assets, such as USDC <> DAI or STETH <> ETH. Liquidity providers provide liquidity for each of the pegged assets in equal amounts in exchange for swap fees and liquidity mining incentives. However, during periods of high volatility, arbitrageurs will provide toxic flow to the pool, effectively stealing money from the liquidity providers. The absolute worst case scenario is when a stablecoin depegs, and arbitrageurs instantly rush in to sell the depegged stablecoins for the other stablecoins in the pool. Current stableswap and general AMM design doesn’t account for this edge case, as the trading fees are statically set and do not change after the pool is deployed.
     Like  Bookmark
  • Discord Server https://discord.gg/SMyKft3X5w Posting an Event To post an event, use this calendly link. Follow the instructions, if the event doesn't get saved, it is probably because calendly doesn't allow overlapping events. Since events here are custom set to have a 1 minute duration and the time between event slots is 5 minutes, simply choose the closest available slot and emphasize the time in the event description. Check the calendar below to see what times are booked. Adding all Events to your Calendar Public Calendar
     Like  Bookmark