Faustian (@0xfaustian) header
Faustian (@0xfaustian) profile picture

programmable PoW and rust

Joined March 2024
Photo by Faustian (@0xfaustian)Photo by Faustian (@0xfaustian)Photo by Faustian (@0xfaustian)
Programmable PoW
As promised, all pieces of the NockAPP SDK v1 quietly went live in the past few days. Everything developers need to begin building NockApps: ✅ NockApp kernels ✅ Runtime drivers ✅ CLI tooling ✅ Fakenet support ✅ Docs/tutorials We're only soft-launching right now because it's Friday afternoon. We'll do a proper article next week. ;-) There's much more we're planning, from Jock type support to improving the templates to reducing the Rust editing required... But we're very proud to bring all of this together, for the first time, for the first generation of developers building on Nockchain! ✅nockchain.org/nockapp/ ✅github.com/nockchain/nockcha…
2
38
Linear Vesting in Solidity Linear vesting is a great method for initial capital raising, as funds are not immediately released but linearly unlocked over a determined time-frame. This will prevent large market sells and will increase fairness. Here's how a simple calculation for a linear vesting contract could look like: This function simply calculates how much of your initial investment is claimable, depending on the vestingStart and the current block.timestamp. If you incorporate this calculation into a claim function, you need to ensure that the already claimed value is deducted. This will prevent excess claiming.
1
8
67
4,490
The height of a merkle tree is logarithmically proportional to the amount of initial data points. That means if you wanted to prove a certain piece of data exists in the merkle root of an inital 1,000,000 data, you would only need to provide 20 hashes to do so! (2^20 =1048576)
72
Ever wondered how mappings are stored in Solidity storage? After all, a mapping can have a undetermined amount of key value pairs.
1
90
When you define a mapping in storage, the mapping itself takes 1 slot in storage. The hash of the key + the value of the mapping storage slot determines where the value will be stored.
1
80
Ex: for a uint => uint mapping called n where n is stored in slot 1, the value n[2][3] will have hash(key=2 and slot 1) and the value of this hash will be the storage slot where 3 is stored
55
Increasing Solidity optimization runs produces longer bytecode but saves gas during execution. For instance, Hardhat defaults to 200 runs; reducing to 1 cuts deployment cost but raises transaction gas fees. Set it to 1,000,000 and your transactions will be cheaper.
55
The max value a uint256 can hold is 115792089237316195423570985008687907853269984665640564039457584007913129639935
1
47
This is roughly 10^77, for reference the amount of atoms in the known universe is estimated to be 10^78 - 10^82
37
Currently at the @fhe_org conference Toronto, I’m fully homo today!!
2
1
68
Great talk on key decomposition techniques
51
The cheapest opcode is STOP which costs 0 gas as all it does is halt execution. The most expensive opcode is CREATE, which deploys a new contract and takes at least 32000 gas. The formula for CREATE's gas cost is: 32000 + mem_expansion_cost + code_deposit_cost
34
An eth transfer takes 21000 gas. This is always true for mainnet. However, when transferring on an L2 you must also pay for the cost of posting transaction data onto mainnet. Interesting that Optimism's etherscan breaks down L2/L1 gas cost while Arbitrum shows the combined only.
1
35
Currently using @privy_io to add social login to a fully on chain agar.io type game. Your bubble will display your discord/twitter/farcaster instead of your address
1
2
42