Skip to content

Instantly share code, notes, and snippets.

View pradyuman-verma's full-sized avatar
❄️
Living in Web3

prady pradyuman-verma

❄️
Living in Web3
View GitHub Profile

Keybase proof

I hereby claim:

  • I am pradyuman-verma on github.
  • I am pradyumnverma (https://keybase.io/pradyumnverma) on keybase.
  • I have a public key whose fingerprint is 8682 ED6D C499 D155 9962 FA04 5FF1 5662 0D5B 1E14

To claim this, I am signing this object:

@pradyuman-verma
pradyuman-verma / Summer of Bitcoin'21.md
Last active October 23, 2021 16:11
The following gists summarizes my work in @bcoin-org as a part of Summer of Bitcoin 2021

The following blog summarises my work in bcoin as a part of Summer of Bitcoin 2021.

I am thankful to my mentor Matthew Zipkin, for being incredibly supportive throughout this journey. And kudos to all my peers for being this amazing.

Project Introduction: Bcoin

Bcoin is an alternative implementation of Bitcoin protocol built with Javascript. A full node can be used for full blockchain validation and is aware of all known consensus rules. It is easier to use, faster to learn, and more well-documented than competing implementations.

My ten-week summer internship work with bcoin helped increase test coverage in its test library and implement bech32m address encoding format to make bcoin taproot ready and also involved reviewing pull requests and issues.

@pradyuman-verma
pradyuman-verma / FlashLoan.md
Last active December 13, 2021 08:02
FlashLoan

This gist will explain how you can use the dsa-connect Flashloan feature.

I will be using this code.

/**
This code is from the Instadapp terminal, so there is no need to import node modules.
*/

// Connect your metamask account. It will be rendered as USER_ADDRESS
@pradyuman-verma
pradyuman-verma / push-to-someone-elses-pr.md
Created March 23, 2022 09:15 — forked from wtbarnes/push-to-someone-elses-pr.md
Brief instructions for how to modify and push to someone else's PR on github

How to Push to Someone Else's Pull Request

Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their branch feature and have proposed to merge this into origin/master, where

origin -> https://github.com/author/repo.git

Now say you would like to make commits to their PR and push those changes. First, add their fork as a remote called

@pradyuman-verma
pradyuman-verma / sob21.md
Created May 24, 2022 20:25
Regtest Playground - Performing a Double-Spent and Chain Reorg in bcoin !

In the previous blog, we are done with setting up our bcoin node in regtest mode. In this blog, we will try to play more in this regtest mode and try performing chain reorganisation, and Double-spent attacks.

So, the first question that arises is what the regtest mode is?

Regtest mode

Bitcoin Core provides testing tools designed to let developers test their applications with reduced risks and limitations. One of the modes is the regtest.

Regtest (regression test) mode creates a local private blockchain where you can adjust the parameters to what you want. You usually use this when it is not needed to communicate with other peers and blocks. An example of what you can do with the parameters is created blocks instantly, and you have complete control over the environment.

@pradyuman-verma
pradyuman-verma / bcoin.md
Created May 24, 2022 20:30
Getting started with Bcoin (JavaScript Implementation of Full Node)

In this article, we will walk through "how to install and run a full node of Bitcoin using Bcoin."

We will create a wallet, send some coins and mine some blocks in regtest mode. So, let's start.

Introduction

The Bitcoin blockchain is designed as a decentralised P2P network where nobody owns or controls Bitcoin, and everyone can participate. A full node is a program that fully validates transactions and blocks. By running a Bitcoin full node, you are supporting the Bitcoin network to become more decentralised and fostering the growth of Bitcoin.

What is Bcoin?

//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
interface ListInterface {
function accountID(address) external returns (uint64);
}
contract InstaEventManager {
ListInterface internal immutable instalist;
[
{
"market": "0xc3d688B66703497DAA19211EEdff47f25384cdc3",
"marketName": "USDC",
"key": "usdc",
"totalSupplyInBase": "77.497297179140780653",
"totalBorrowInBase": "0",
"totalSupplyInUsd": "77.497297179140780653",
"totalBorrowInUsd": "0",
"netBaseBalance": "0",
[
{
"market": "0xc3d688B66703497DAA19211EEdff47f25384cdc3",
"marketName": "USDC",
"key": "usdc",
"baseToken": {
"key": "usdc",
"type": "token",
"symbol": "USDC",
"name": "USD Coin",
// SPDX-License-Identifier: WTF
pragma solidity ^0.8.0;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender)
external