Can someone familiar with bolt11 explain to me how the timestamp is encoded here?
I get the same bech32 encoding, so I must be doing something right, but I don't understand this intermediate value. I'm starting to think it's wrong.
6c6e6263 is lnbc, the invoice has no amount, so the next 7 bytes (35 bits) should be the timestamp, right? It's 0b25fe64500d04, but I have 010c121f1c1902.My timestamp is encoded in base32, and when decoded it's exactly the timestamp it should be:
0x01 << 30 | 0x0c << 25 | 0x12 << 20 | 0x1f << 15 | 0x1c << 10 | 0x19 << 5 | 0x02 = 1496314658
So excuse me, but wtf is
0b25fe64500d04 in the test vector?? 😅also asked this in #lightning-101 of the LDK Discord server
0b25fe64500d04, but 0x0d != 0x50, 0x04 != 0x0d.010c121f1c1902in base32 to0b25fe64in base256, we group the bits into 8 bits from the left and pad at the right after 35 bits: