This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { fromBase64, fromHex, toBase64, toHex } from "secretjs"; | |
| import { TxRaw } from "secretjs/dist/protobuf/cosmos/tx/v1beta1/tx"; | |
| import { sha256 } from "@noble/hashes/sha256"; | |
| async function main() { | |
| const txhash = | |
| "2b324cd8d36ace2ff1d26145df2109bbaec9d508aa465d36ff88fcd72aa985a8".toUpperCase(); | |
| const tcpStream = fromHex( | |
| [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| eth_address = "0x" + hex(keccak256(pubkey_raw)[-20:]) | |
| cosmos_address = bech32(prefix, ripemd160(sha256(pubkey_compressed))) | |
| cosmos_evmos_address = bech32(prefix, keccak256(pubkey_raw)[-20:]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func TestVerifySignature(t *testing.T) { | |
| txBytes := []byte{ | |
| 10, 234, 1, 10, 131, /// ... | |
| } | |
| cdc := MakeEncodingConfig() | |
| var tx sdktx.Tx | |
| err := cdc.Codec.Unmarshal(txBytes, &tx) | |
| require.NoError(t, err) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // pnpm init | |
| // pnpm i -D bech32 ts-node @types/node | |
| // npx ts-node stride-vanity-address.ts | |
| import { bech32 } from "bech32"; | |
| // Debug: Test all possible values to find what maps to "1" | |
| for (let i = 0; i < 32; i++) { | |
| const test = bech32.encode("stride", [i]); | |
| console.log(`Value ${i} maps to ${test.charAt(7)}`); |
OlderNewer