Skip to content

Instantly share code, notes, and snippets.

View arnabmitra's full-sized avatar
🙈

Arnab Mitra arnabmitra

🙈
View GitHub Profile

Introduction

EigenLayer introduces the possibility of re-using ethereum consensus, and IMO the most interesting usecase for that would be building a decentralized two-way and security-optimal bridge between Bitcoin and Ethereum.

All bridges rely on the security of the two chains they connect and the security of the custodian^[1] used for bridging, since if the security of any of those 3 were to fail, it would be possible to drain the bridge (eg: if its possible to double-spend on any of the two chains an attacker can redeem the same coin multiple times).

However, if a significant amount of the total ETH staked were to be restaked securing this bridge, the custodian would be piggybacking on ethereum security, so those two become the same and thus you'd remove the custodian from your list of dependencies and you're left with only having to depend on the security of the two chains, which is the theoretical ceiling of security. In other words, you'd achieve the best possible security.

But not just that, you

@arnabmitra
arnabmitra / regtest balance call
Created February 22, 2024 22:22
Simple call to regtest to get balances
package main
import (
"fmt"
"github.com/btcsuite/btcd/rpcclient"
"os"
)
func main() {
// Command-line arguments: address
import io.jsonwebtoken.ExpiredJwtException
import io.jsonwebtoken.Jwts
import io.jsonwebtoken.MalformedJwtException
import io.jsonwebtoken.SignatureAlgorithm
import io.jsonwebtoken.UnsupportedJwtException
import org.bouncycastle.jce.ECNamedCurveTable
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.bouncycastle.jce.spec.ECNamedCurveParameterSpec
#!/bin/bash
# Check if the number of arguments is correct
if [ "$#" -ne 2 ]; then
echo "Usage: ./get_and_watch_logs.sh <namespace> <prefix>"
exit 1
fi
namespace="$1"
prefix="$2"
# The global section has parameters that apply globally to the relayer operation.
[global]
# Specify the verbosity for the relayer logging output. Default: 'info'
# Valid options are 'error', 'warn', 'info', 'debug', 'trace'.
log_level = 'trace'
# Specify the mode to be used by the relayer. [Required]
[mode]
{
"jsonrpc": "2.0",
"id": -1,
"result": {
"round_state": {
"height/round/step": "8485556/20/6",
"start_time": "2022-12-01T23:55:49.210791387Z",
"proposal_block_hash": "8162FAF025D1F4F735BA6872A5E686F78E3C6C0C1685949DEBB4B1FE6256B2B7",
"locked_block_hash": "",
"valid_block_hash": "",
package types
import (
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"
)
func TestMarkerAddressLength(t *testing.T) {
https://x25519.ulfheim.net/
@arnabmitra
arnabmitra / gist:afc783250463fe04d7d5e96a23398843
Created November 10, 2021 00:13
create fee proposal with fee denom same as additional fee denom
#!/bin/bash
# I'm using a provenance "run" instance for these tests
# provenance setup, clean project, make, adjust the voting period in the config to test msg based fee proposals:
# 'make clean ; make build; make run-config; cat ./build/node0/config/genesis.json | jq '\'' .app_state.gov.voting_params.voting_period="20s" '\'' | tee ./build/node0/config/genesis.json; cat ./build/node0/config/genesis.json'
PROVENANCE_DEV_DIR=~/provenance
COMMON_TX_FLAGS="--gas auto --gas-prices 1905nhash --gas-adjustment 2 --chain-id chain-local --keyring-backend test --yes -o json"
######################################### SETUP FOR ATS CONTRACT EXECUTION ##############################################
@arnabmitra
arnabmitra / gist:b03896033d7ca87b9658bf44d9740fd3
Created November 9, 2021 20:03
Gov proposal and vote provenance chain.
#!/bin/bash
# I'm using a provenance "run" instance for these tests
# provenance setup, clean project, make, adjust the voting period in the config to test msg based fee proposals:
# 'make clean ; make build; make run-config; cat ./build/node0/config/genesis.json | jq '\'' .app_state.gov.voting_params.voting_period="20s" '\'' | tee ./build/node0/config/genesis.json; cat ./build/node0/config/genesis.json'
PROVENANCE_DEV_DIR=~/provenance
COMMON_TX_FLAGS="--gas auto --gas-prices 1905nhash --gas-adjustment 2 --chain-id chain-local --keyring-backend test --yes -o json"
######################################### SETUP FOR ATS CONTRACT EXECUTION ##############################################