Replying to Avatar nick

But many addresses are a hash of the public key, so we cannot validate the public keys when transactions are paying money to them. For these addresses it is impossible to filter based on public key until it is revealed, at time of spending, which requires them to be real and not spam!

Though I haven't thought about this wrt P2TR, and was somewhat surprised to see point validity isn't enforced:

https://github.com/bitcoin/bitcoin/pull/24106

I think id rather the spammers use invalid secp points! A nice broom to have up the sleeve? Can easily patch into a node to sweep out all the invalid ones from the utxoset.

It is super easy to generate these "fake" secp256k1 points which are valid:

02b33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33f

```rust

use rand::{RngCore, thread_rng};

use secp256kfun::{

Point, hex,

marker::{NonZero, Public},

};

fn main() {

let mut rng = thread_rng();

let hex_str = "b33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33fb33f";

let hex_bytes = hex::decode(hex_str).expect("invalid hex string");

loop {

let mut random_bytes = [0u8; 64];

rng.fill_bytes(&mut random_bytes);

let my_point_bytes = {

let mut bytes = [0u8; 33];

bytes[0] = 0x02; // start with 02

let hex_len = hex_bytes.len().min(32);

bytes[1..1 + hex_len].copy_from_slice(&hex_bytes[0..hex_len]);

// fill the rest with random bytes

if hex_len < 32 {

bytes[1 + hex_len..33].copy_from_slice(&random_bytes[0..32 - hex_len]);

}

bytes

};

let point = Point::<_, Public, NonZero>::from_bytes(my_point_bytes);

match point {

Some(valid_point) => {

println!("Random valid point: {:?}", valid_point);

}

None => {

eprintln!("Invalid point from bytes: {}", hex::encode(&my_point_bytes));

}

}

}

}

```

A spam‑style transaction begins when a wallet crafts an output script like OP_DATA_33 OP_CHECKSIG; because the “pubkey” is just any 33‑byte blob with a 0x02/0x03 prefix, the node that first sees it only verifies the script template is standard and relays it to peers, who drop it into their mempools; miners then pick it up, validate the inputs (not the new outputs), and record it in a block; when that block is accepted, every full node inserts the output—complete with fake key—into its UTXO database, where it must be stored forever even though a future spend will fail the OP_CHECKSIG curve test. If we slip a single call to secp256k1_ec_pubkey_parse into the existing relay policy (or, via soft fork, into consensus), the flow stops at the mempool stage: half of all random blobs are rejected outright, attackers now have to brute‑force curve‑valid bytes, their payload density drops, and the “cheapest bytes forever” loophole disappears—yet honest nodes notice no measurable performance hit because the code and library are already in Core.

Checksum catches typos at the surface; a quick curve check one layer deeper—during relay or consensus—blocks those fake‑key outputs before they hard‑code themselves into the UTXO set, and forces spammers to pay at least some extra computation and density penalty.

Reply to this note

Please Login to reply.

Discussion

Yeah not sure i am convinced of the reasons in that issue to **not** filter these, but i am thinking there may be value to the fact that this filter could be created at any time in the future, clear out a large chunk of the UTXO set after they have wasted their sats. Depends if how bad you consider the spam, is it about utxoset bloat or want to filter their existence in blocks

I feel the same way; I'm still trying to grasp this situation. In a surprising turn of events, the entire OP_RETURN debacle has become a blessing. As we can see from this discussion and the node charts, more and more people are becoming educated about spam issues, with the number of knots gaining momentum. 🫡💪🪢

Has been great discussing this - got me thinking deeply and I found a bug in one of our cryptography libraries while exploring valid secp256k1 points! I haven't looked into knots really, semi dismissed it a while ago when i first saw this nuts counting system was supported(?)

https://en.bitcoin.it/wiki/Tonal_Bitcoin

By the way, your product looks amazing! I can't wait to try it!