Detail: How Code-In Works with 2 PDAs
What Happens Inside Code-In (with 2 PDAs)
Instead of making a space for storing the data, we leave a trace on the blockchain for tracking, which saves gas fees.
But to make sure the trace is permanently and reliably recorded on Solana, logs aren’t enough. we need a clear state change.
So we allocate 2 PDAs of yours and change the values inside them, crafting a transaction that definitely alters the blockchain state.

Here’s the Code-In diagram: using transactions, we create a linked-list-shaped, traceable data structure called the Code-PDA.
The final file is stored in another pocket a DBPDA (metadata PDA) which records the tail transaction last written in the Code-PDA and the metadata such as filetype, etc.
We use a DB PDA so that each transaction corresponds to exactly one piece of data, making management much easier. Below is a screenshot of the DBPDA’s transaction list.


After we fetch DBPda's Transaction list, we can use this as "Data list".
Transaction list = list of data.

Whenever the user clicks the item, it brings every chunk from the linked list.
Last updated