New Peercoin Exploit Detected. It's Not Great, We Have A Plan

Hello! If you run the Peercoin Core wallet you might have noticed a warning message about unrecognized block versions. At least this is what tipped me off and started an investigation into what that was about.

Looking at a block chain explorer, I noticed a lot of blocks being generated with the same amount (50 PPC, which is a maximum staking constant we have for safety I suppose) and the Proof-of-Stake difficulty climbing quickly (it’s at a somewhat historically high 30+ number at the moment).

@peerchemist got notified (along with other team members that are smart and know things) and it was determined that there’s a bug in the validation code that allows someone to create Proof-of-Stake blocks that are structured like Proof-of-Work blocks and the difficulty of those weird Proof-of-Stake/Proof-of-Work blocks is the Proof-of-Stake difficulty… so it wouldn’t take much hash power to start churning out rewards for yourself!

And… someone(s) is doing just that :frowning: Here’s a patch for the problem (we think, please lend your brain powers to help if you can) validation: reject mismatched proof types · peerchemist/peercoin@3656b17 · GitHub

As soon as we can get the right people awake and functioning, we’ll get new builds with this patch in place and encourage everyone to resync their blockchains using the more correct validation rule. This will cause a split in the chains… one “good” and one “bad”. If you run an exchange and you’re reading this… it might be a good idea to shut Peercoin down for a little bit while this gets settled. I’m fairly certain everyone except the exploiters will adopt the new code and the “good” chain will win out.

So, yeah, apologies. But also, we will likely be working on security auditing (using AI for better or worse) to try to prevent being blind sided in the future.

8 Likes

Interesting. So this will technically be a hard fork?

Looks like it: Merge pull request #825 from peercoin/release-0.15 · peercoin/peercoin@cc9cb22 · GitHub

v0.15.2ppc tag has been pushed to peercoin repository. full writeup is coming, but for now everyone should just issue /invalidateblock 00000000000019689463e26094f65836af44d435280f03c002bf9f357626043c in the debug console. you will switch to correct fork. if you can, build from v0.15.2ppc tag and run that. we will have to restore guix builds, something broke long time ago.

3 Likes

I tried copying the above string into the Console (Window → Console) but it came back “Method not found”.

I tried again without the forward slash at the beginning and it came back “null”. Is that right?

Yes, it should be invalidateblock 00000000000019689463e26094f65836af44d435280f03c002bf9f357626043c without a /.

1 Like

This is how you build on Ubuntu:

sudo apt-get -y install build-essential autotools-dev automake autoconf libprotobuf-dev protobuf-compiler libminiupnpc-dev libzmq3-dev libqrencode-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libtool pkg-config libdb-dev libdb++-dev libboost-all-dev libssl-dev libevent-dev bsdmainutils libsqlite3-dev git

sudo apt-get -y update && sudo apt-get -y upgrade

git clone https://github.com/sandakersmann/peercoin

cd peercoin

./autogen.sh

./configure --with-gui=qt5 --with-incompatible-bdb

make

You will find peercoin-qt in the folder peercoin/src/qt/

1 Like

Nice , but that is against your repo, not the official peercoin/peercoin repo. Just saying.

Yes. I added another fix as well.

Binaries released on the main repo:

1 Like

Super! Will the deb-repo be updated?

Will there be a signed binary for Mac OS?

I’ll try.

Not soon; the old keys expired a while ago.

2 Likes

Thank you! :blush:

Flatpak is updated

2 Likes

Just did, pls verify.

1 Like

It took around 7 hours to deploy the fix:

Fantastic work by the team :slight_smile:

3 Likes

Hi peerchemist, I am getting the following sig verification issue:

~ $ sudo apt update
Hit:1 http://deb.debian.org/debian` trixie InRelease Hit:2 http://deb.debian.org/debian trixie-updates InRelease Hit:3 http://deb.debian.org/debian-security trixie-security InRelease Get:4 https://peercoin.github.io/deb-repo trixie InRelease [2,486 B] Err:4 https://peercoin.github.io/deb-repo trixie InRelease Sub-process /usr/bin/sqv returned an error code (1), error message is: Missing key 18B7790F9518DDD5B9166804B8276C0F851AAD7E, which is needed to verify signature. Hit:5 http://archive.raspberrypi.com/debian trixie InRelease Warning: OpenPGP signature verification failed: https://peercoin.github.io/deb-repo trixie InRelease: Sub-process /usr/bin/sqv returned an error code (1), error message is: Missing key 18B7790F9518DDD5B9166804B8276C0F851AAD7E, which is needed to verify signature. Error: The repository ‘ https://peercoin.github.io/deb-repo trixie InRelease’ is not signed. Notice: Updating from such a repository can’t be done securely, and is therefore disabled by default. Notice: See apt-secure(8) manpage for repository creation and user configuration details.`

Edit: followed the instructions at Peercoin APT repository , all good now thanks!

2 Likes

If anyone else is having issues getting the new wallet to run under Mac OS you can run the following in terminal to allow the execution of unsigned code:

xattr -d com.apple.quarantine /path to file

It worked for me.

3 Likes

updated to 0.15.2 on a win64 environment, still getting the message “warning: unknown block versions being mined! It’s possible unknown rules are in effect” in the peercoin client?

1 Like