A demo without 🚀 science, just simple UTXO spending logic.

Overview

Stuck TX Demo

Docker container that runs 4 dogecoind to demonstrate "the stuck tx problem".

Scenario

  1. A wallet sends out 3 transactions to a recipient of resp 51k, 52k and 53k DOGE.
  2. All transactions get stuck because there is no miner that is accepting the fee
  3. The first transaction (tx0) gets replaced by respending its inputs
  4. The second transaction (tx1) gets replaced without respending inputs
  5. The third transaction (tx2) is forgotten
  6. When the wallet (or an attacker!!!) sends the original tx1 again, the recipient gets the amount twice

Usage

You need an x86 linux pc or vm with docker and git installed.

git clone https://github.com/patricklodder/wallet-stucktx-demo.git
cd wallet-stucktx-demo
docker build -t wallet-stucktx-demo:latest .
docker run wallet-stucktx-demo:latest

Example output

[00] Setup...  (T=T-2h)
  wallet: sends   txs with 0.10000000 DOGE/kb fee
  relay1: accepts txs with 1.00000000 DOGE/kb fee
  relay2: accepts txs with 0.00100000 DOGE/kb fee
   miner: accepts txs with 1.00000000 DOGE/kb fee

[01] Mining blocks and seeding wallet...  (T=T-2h)
  our wallet has 5 inputs with a total balance of 500000.00000000 DOGE

[02] Sending 3 too low fee transactions... (T-2h)
  tx0: 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 sending 51000 to n4LRQGEKcyRCXqD2MH3ompyMTJKitxu1WP
  tx1: 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 sending 52000 to n4LRQGEKcyRCXqD2MH3ompyMTJKitxu1WP
  tx2: 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc sending 53000 to n4LRQGEKcyRCXqD2MH3ompyMTJKitxu1WP
  our wallet node has 3 mempool entries
  our wallet has 2 inputs with a total balance of 343999.93220000 DOGE

[03] Syncing mempools... (T=T-2h)
  wallet has 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 in mempool
  wallet has 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
  wallet has 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool
  relay2 has 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 in mempool
  relay2 has 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
  relay2 has 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool
  relay1 does not have 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 in mempool
  relay1 does not have 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
  relay1 does not have 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool
   miner does not have 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 in mempool
   miner does not have 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
   miner does not have 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool

[04] Mining a block... (T=T-2h)
  wallet still has 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 in mempool
  wallet still has 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
  wallet still has 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool
  relay2 still has 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 in mempool
  relay2 still has 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
  relay2 still has 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool
  our wallet has 2 inputs with a total balance of 343999.93220000 DOGE

==============================================

[05] Timewarp back to the future, mempools expire... (T=T+0)
  wallet has 0 transactions in mempool
  relay1 has 0 transactions in mempool
  relay2 has 0 transactions in mempool
   miner has 0 transactions in mempool

[06] Our wallet seems confused now... (T=T+0)
  our wallet has 2 inputs with a total balance of 200000.00000000 DOGE
  very concern!

[07] But the wallet still remembers these transactions... (T=T+0)
  wallet remembers tx 041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 for -51000.00000000
  wallet remembers tx 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 for -52000.00000000
  wallet remembers tx 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc for -53000.00000000

[08] Replace tx0 for 51000 correctly... (T=T+0)
  copy inputs:
    aeaef799f34676b2de572d6de105485147263df68490cfe9232595a3a60f47b6 / 1
  copy outputs:
    mtPvDHF7AqorQiZzrAjnYT4Q1U8eJnKk1K: 48999.97740000
    n4LRQGEKcyRCXqD2MH3ompyMTJKitxu1WP: 51000.00000000
  change fee to 1 DOGE by changing the change output:
    mtPvDHF7AqorQiZzrAjnYT4Q1U8eJnKk1K: 48999.00000000
  create, sign and push new tx:
    wallet sent d7703393f53fce77f859e6ed3b7a8a96eaa3749d372ddce8500be85dadbf1528

[09] The replacement tx0 gets accepted everywhere... (T=T+0)
  wallet has d7703393f53fce77f859e6ed3b7a8a96eaa3749d372ddce8500be85dadbf1528 in mempool
  relay1 has d7703393f53fce77f859e6ed3b7a8a96eaa3749d372ddce8500be85dadbf1528 in mempool
  relay2 has d7703393f53fce77f859e6ed3b7a8a96eaa3749d372ddce8500be85dadbf1528 in mempool
   miner has d7703393f53fce77f859e6ed3b7a8a96eaa3749d372ddce8500be85dadbf1528 in mempool
  and gets mined...
  our wallet has 3 inputs with a total balance of 248999.00000000 DOGE
  that takes care of tx1! wow

[10] We do an oopsie and we accidentally: (T=T+0)
     send out a new tx1 without replacing the original inputs, and
     completely forget about tx2
  wallet has 31cf7f93fcf22ec5d83846c9bec8409d38a491faccd019844e1a5ad6bdf1ca50 in mempool
  relay1 has 31cf7f93fcf22ec5d83846c9bec8409d38a491faccd019844e1a5ad6bdf1ca50 in mempool
  relay2 has 31cf7f93fcf22ec5d83846c9bec8409d38a491faccd019844e1a5ad6bdf1ca50 in mempool
   miner has 31cf7f93fcf22ec5d83846c9bec8409d38a491faccd019844e1a5ad6bdf1ca50 in mempool
  it gets mined...
  our wallet has 3 inputs with a total balance of 196998.00000000 DOGE
  such confuse!!!

==============================================

[11] The miner updates... (T=T+0)
  wallet: sends   txs with 0.10000000 DOGE/kb fee
  relay1: accepts txs with 1.00000000 DOGE/kb fee
  relay2: accepts txs with 0.00100000 DOGE/kb fee
   miner: accepts txs with 0.00100000 DOGE/kb fee

[12] Our wallet sends out cached transactions... (T=T+0)
  wallet has 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
  wallet has 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool
   miner has 2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 in mempool
   miner has 1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc in mempool

[13] The cached transactions get mined... (T=T+0)
  our wallet has 5 inputs with a total balance of 291997.95480000 DOGE

  (negative confirmations indicate a replaced transaction)
  041166db29f2b683d6d93e80c89f1c21d6ed1784cca1affb1237f80ac35389d7 for -51000.00000000 has -4 conf
  2e81e9aeefeb6ca1e0c242bcb29e447ee70e5ae5e106e476d754ea7bb09b1d68 for -52000.00000000 has 1 conf
  1a0a798316436d96a5e0ef9fdc5ee563b38da973a7a589730ef7af9f01424acc for -53000.00000000 has 1 conf
  d7703393f53fce77f859e6ed3b7a8a96eaa3749d372ddce8500be85dadbf1528 for -51000.00000000 has 4 conf
  31cf7f93fcf22ec5d83846c9bec8409d38a491faccd019844e1a5ad6bdf1ca50 for -52000.00000000 has 3 conf

HOUSTON, WE HAVE A PROBLEM!
    let's make it n4LRQGEKcyRCXqD2MH3ompyMTJKitxu1WP's problem!
    Dear n4LRQGEKcyRCXqD2MH3ompyMTJKitxu1WP, you owe us 52,000 DOGE. Plz send.

=====THE END=====

Owner
Patrick Lodder
Patrick Lodder
Telegram bot that let's you flip a coin in a dialog

coin_flip Telegram bot that let's you flip a coin in a dialog Report issue · Request feature About Software development tool that lets you finally dec

Ivan Akostelov 2 Dec 12, 2021
Michelle is a Discord Bot coded in Python with Discord.py by Mudit07.

Michelle is a Discord Bot coded in Python with Discord.py by Mudit07.

Michelle 3 Oct 09, 2021
Open Source API and interchange format for editorial timeline information.

OpenTimelineIO is currently in Public Beta. That means that it may be missing some essential features and there are large changes planned. During this phase we actively encourage you to provide feedb

Pixar Animation Studios 1.2k Jan 01, 2023
The official Magenta Voice Skill SDK used to develop skills for the Magenta Voice Assistant using Voice Platform!

Magenta Voice Skill SDK Development • Support • Contribute • Contributors • Licensing Magenta Voice Skill SDK for Python is a package that assists in

Telekom Open Source Software 18 Nov 19, 2022
Набор утилит для Discord с использованием языка программирования Python.

Discord Tools v0.1 Functions: WebHook spamer Spotify account generator (What?) QR Code Token stealer Token generator Discord nitro gen/check Discor to

Максим Скризов 3 Aug 23, 2022
Robocord is a bot created for the Pycord community.

Robocord is a bot created for the community of the Pycord Server. Just a bot created for Pycord Server. You can start pull requests, I will check it and if its good I will add it to the bot. 👍

Bruce 7 Jun 26, 2022
My attempt to reverse the Discord nitro token generation function.

discord-theory-I PART: I My attempt to reverse the Discord nitro token generation function. The Nitro generation tools thing is common in Discord now,

Jakom 29 Aug 14, 2022
Exporta archivos masivamente del TEC Digital.

TEC Digital Files Exporter Script que permite exportar los archivos de cursos del TEC Digital del Instituto Tecnológico de Costa Rica, debido al borra

Joseph Vargas 22 Apr 08, 2021
An open source, multipurpose, configurable discord bot that does it all

Spacebot - Discord Bot Music, Moderation, Fun, Utilities, Games and Fully Configurable. Overview • Contributing • Self hosting • Documentation (not re

Dhravya Shah 41 Dec 10, 2022
Yuichixspam - TLEEGRAM SPAM BOT For Python

𝒀𝑼𝑰𝑪𝑯𝑰 ✘ 𝑺𝑷𝑨𝑴 𝑩𝑶𝑻ノ 🚀 Deploy on Heroku (https://heroku.com/deploy?t

MOHIT X PANDIT 6 Jan 30, 2022
Validate all your Customer IAM Policies against AWS Access Analyzer - Policy Validation

✅ Access Analyzer - Batch Policy Validator This script will analyze using AWS Access Analyzer - Policy Validation all your account customer managed IA

Victor GRENU 41 Dec 12, 2022
Maestral is an open-source Dropbox client written in Python.

Maestral - A light-weight and open-source Dropbox client for macOS and Linux

2.6k Jan 03, 2023
Python script for download course from platzi.com

Platzi Downloader Tool Esta es una pequeña herramienta que hace mucho y que te ahorra una gran cantidad de trabajo a la hora de descargar cursos de Pl

Devil64-Dev 21 Sep 22, 2022
Python client for the Datadog API

datadog-api-client-python This repository contains a Python API client for the Datadog API. The code is generated using openapi-generator and apigento

Datadog, Inc. 58 Dec 16, 2022
My attempt at weaponizing Discord.

MayorbotC2 This is my Discord C2 bot. There are many like it, but this one is mine. MayorbotC2 is a project I absolutely forgot about until I was pilf

Joe Helle 19 May 16, 2022
Get-Phone-Number-Details-using-Python - To get the details of any number, we can use an amazing Python module known as phonenumbers.

Get-Phone-Number-Details-using-Python To get the details of any number, we can use an amazing Python module known as phonenumbers. We can use the amaz

Coding Taggers 1 Jan 01, 2022
Telephus is a connection pooled, low-level client API for Cassandra in Twisted python.

Telephus Son of Heracles who loved Cassandra. He went a little crazy, at one point. One might almost say he was twisted. Description Telephus is a con

Brandon Williams 93 Apr 29, 2021
Updater for PGCG (Paradox Game Converters Group) converters written in Python.

Updater Updater for PGCG (Paradox Game Converters Group) converters written in Python. Needs to be put inside an "Updater" directory in the root conve

Paradox Game Converters 2 Jan 10, 2022
Discord spam bots with multiple account support and more

Discord spam bots with multiple account support and more. PLEASE READ EVERYTHING BEFORE WRITING AN ISSUE!! Server Messages Text Image Dm Messages Text

Mr. Nobody 6 Sep 14, 2022