Oddbean new post about | logout
 ### Hey Cashu enthusiasts,
Questions on Cashu wallet and Nutzaps (nip60-61):

#### Question1: Swaps
1. User monitors for nutzap events
2. Nutzap event is found with Proof
3. Nutzap is redeemed. ALWAYS.
Why is default redemption important? What about the case when token is already in a mint that user trusts, p2pk locked anyway? Is it necessary in that case too? Why?

#### Question 2: P2PK
- NDK wallet has this nice function to parse P2PK pubkeys [here](https://github.com/nostr-dev-kit/ndk/blob/master/ndk/src/events/kinds/nutzap/index.ts#L96) . Why does this splicing remove first 2 and last 1 byte from the P2PK?

cc nostr:nprofile1qqs9pk20ctv9srrg9vr354p03v0rrgsqkpggh2u45va77zz4mu5p6ccpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhsz9thwden5te0dehhxarj9ehhsarj9ejx2a30qyg8wumn8ghj7mn0wd68ytnddakj7xph5zr nostr:nprofile1qqsdmup6e2z6mcpeue6z6kl08he49hcen5xnrc3tnpvw0mdgtjemh0spzemhxue69uhhyetvv9ujuvrcvd5xzapwvdhk6qg5waehxw309aex2mrp0yhxgctdw4eju6t0qyt8wumn8ghj7un9d3shjtnwdaehgu3wvfskueqgxmmun nostr:nprofile1qqs04xzt6ldm9qhs0ctw0t58kf4z57umjzmjg6jywu0seadwtqqc75sprfmhxue69uhhq7tjv9kkjepwve5kzar2v9nzucm0d5hsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qythwumn8ghj7un9d3shjtnswf5k6ctv9ehx2ap0y8qdrm

PS: See you in Berlin
#asknostr #cashu #ndk #ecash 
 Removing the last byte of the p2pk seems to be a bug caused by the tricky splice(start, end) fn, start being inclusive, end being _exclusive_ . Removal of the padding is '02' is fair enough. 
 question 1: you're right, not necessary to redeem right away 
 I wonder that this is because the user might want to get the proofs in the preferred unit or denomination.

So best to avoid checking a bunch of stuff about the Proofs and just get a new Token with said proofs according to exact receiver preferences. 
 nostr:nprofile1qqs04xzt6ldm9qhs0ctw0t58kf4z57umjzmjg6jywu0seadwtqqc75sprfmhxue69uhhq7tjv9kkjepwve5kzar2v9nzucm0d5hsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qythwumn8ghj7un9d3shjtnswf5k6ctv9ehx2ap0y8qdrm can you confirm this p2pk last byte removal bug?

And what do you think of the swapping of tokens topic?