# 区块链新手任务 ## 安全 1. 对公业务不要使用个人私钥,找安全申请地址,或者使用签名机 2. 个人私钥不要明文导出,如果实在需要导出,可考虑keystore形式; 3. 使用硬件钱包或者安全托管机构来保管巨额资金 ## 链 ### 1. 搭建私链 基于 heco 代码,和脚本,搭建私有链,正常产块 ### 2. 发送交易 以太坊核心数据结构:区块、交易; 通过调用 json rpc 接口,或者 web3js api 发送转账交易到链上 > 《精通以太坊》!!一定要先认真看!! 电子版: https://github.com/inoutcode/ethereum_book ### 3. 批量发送交易 使用 ethercamp 批量发送脚本 > web3 api 的 js 实现 https://web3js.readthedocs.io/en/v1.3.4/ https://docs.ethers.io/v5/ ### 4. 添加 rpc端口 在链代码中添加一个 rpc,根据区块查询交易数量 ### 5. 使用 geth 打开 txpool 接口访问,获取交易池数据 > https://eth.wiki/json-rpc/API ### 6. 调整 geth 命令行参数 改变区块最低 gaslimit > https://geth.ethereum.org/docs/interface/command-line-options ## 合约 ### 1. remix 发行合约 发行一个 erc20 合约; 构造函数接受 tag 参数; 带有一个 submit(address to, uint amount) 接口,调用后为 to 地址增发 amount 数量的代币; 浏览器开源; > https://solidity.readthedocs.io/ > 浏览器验证 1 交易部署工具是remix 还是 truffle or? 2 交易验证版本/是否开启优化? 3 合约部署过程中,是否有独立的library 部署? 4 涉及多文件部分建议使用truffle-flatten 合并为单一文件 5 是否包含spdx 文件, 如果包含,编译器版本是否小于0.6.6 6 只保留了一个 spdx 7 有初始化参数嘛,是否考虑使用https://abi.hashex.org/ 帮助浏览器识别合初始化造参数。 https://info.etherscan.com/determine-correct-constructor-argument-during-source-code-verification-on-etherscan/ 浏览器上先有了部署的合约bytecode,开源的过程中,浏览器要验证源码是不是和合约匹配, 即 depolyed bytecode == compiled bytecode + construct auguments bytecode 我们需要提供 : 1 合约源码,编译器版本,编译器优化是否打开,以生成正确的compiled bytecode 2 construct aguments bytecode, 这个是部署合约时构造函数的参数,可以通过https://abi.hashex.org/ 生成 ### 2. ethernaut 完成合约安全练习,了解合约安全点 > 合约安全互动教程 https://ethernaut.openzeppelin.com/ ### 3. 使用 hardhat 框架发行合约 为上述合约添加测试用例、实现自动化部署、自动化浏览器开源验证 > 合约开发脚手架 https://hardhat.org/ ### 4. 合约交互 开发一个后台程序,定期调用上述合约的接口,实现长时间工作 > 要注意 gasprice 和 gaslimit ## EVM ### 加指令 为 evm 支持一个新opcode, 引入mimc 哈希算法;可以 precompile 方式引入; https://eth.wiki/en/concepts/evm/ethereum-virtual-machine-(evm)-awesome-list ## 密码学 ### ecies 应用 是用 ecies 加密和解密一个特定输入 > 密码概念与实现 https://github.com/ethereum/go-ethereum/tree/master/crypto/ecies https://cryptobook.nakov.com/asymmetric-key-ciphers/ecc-encryption-decryption
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up