Skip to content

Instantly share code, notes, and snippets.

View NicolasFlamel1's full-sized avatar
๐Ÿ’œ
MWC

Nicolas Flamel NicolasFlamel1

๐Ÿ’œ
MWC
View GitHub Profile
// This is some code for a wrapped MimbleWimble Coin ERC-20 token that I worked on for a couple of days in 2020. This was never deployed on Ethereum's mainnet. This code probably isn't very good.
// Contract address: 0x7FCb7cf13798757a686F05ae86b7Ed5142d9bC74 (I think on the ropsten testnet)
// Contract bytecode: 608060405234801561001057600080fd5b50604051610d2e380380610d2e8339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b506040525050600080546001600160a01b03191633179055506100fe81610104565b50610158565b6000546001600160a01b0316331461011b57600080fd5b805160211461012957600080fd5b8060008151811061013657fe5b01602001516004805460ff191660f89290921c91909117905560210151600355565b610bc7806101676000
# Scans all blocks from a Grin archive node to reconstruct a wallet's transaction history. All applicable UTXOs and when they were spent are logged to a file, and a brief overview of the wallet's transaction history is shown in the console. This code lacks any error checking. A wallet's rewind hash can be obtained by running the command `grin-wallet rewind_hash` with the Grin CLI wallet, https://github.com/mimblewimble/grin-wallet.
# Imports
from secp256k1_zkp_mw import *
from hashlib import blake2b
import requests
import time
from datetime import datetime
# This demonstrates how to use the secp256k1-zkp-mw Python module, https://github.com/grinventions/secp256k1-zkp-mw, to find all the unspent Grin outputs belonging to a wallet. This code lacks any error checking. A wallet's rewind hash can be obtained by running the command `grin-wallet rewind_hash` with the Grin CLI wallet, https://github.com/mimblewimble/grin-wallet.
# Imports
from secp256k1_zkp_mw import *
from hashlib import blake2b
import requests
# Constants