What is Nostr?
ildella / Daniele
npub1ncd…r8ar
2024-02-28 21:04:17

ildella on Nostr: fiatjaf If I ask to verify a finalized event but change content and/or created_at, ...

fiatjaf (npub180c…h6w6)

If I ask to verify a finalized event but change content and/or created_at, anything at all actually... shouldn't the verification return false?

Or am I missing something huge? :/

```js
const secretKey = generateSecretKey()
const now = Math.floor(Date.now() / 1000)
const event = finalizeEvent({
kind: 1,
created_at: now,
content: 'hello',
tags: [],
}, secretKey)
const isGood = verifyEvent({...event, created_at: now - 10, content: 'something else'})
expect(isGood).toBe(false)
```
Author Public Key
npub1ncdaqhk5rea29hdpaxmyhzay3d5mkrattg3dgs4yjkcml99fkqcqz4r8ar