pencilflip πŸ„ Profile picture
Nov 23, 2021 β€’ 8 tweets β€’ 3 min read β€’ Read on X
Here's a diagram that shows all the different parts of a Solana transaction.

More details below πŸ‘‡
1/ Each Solana transaction contains a message, and the first part of each message is its header.

The header is simple, it just contains the numbers described in the diagram.
2/ The next part of the transaction message is an array of accounts. They are ordered based on whether they require a signature and whether they are writable.

This array also contains the addresses of the programs used by the instructions.
3/ Notably, Solana forces you to explicitly specify which accounts require signatures, and which accounts are writeable.

That's why when you create an instruction on the client-side (TypeScript in this example), it looks like this πŸ‘‡
4/ The message blockhash is pretty self-explanatory. It's included so that validators can reject txs that are too old.
5/ Solana transactions can contain multiple instructions!

This is important, b/c you may want to execute multiple instructions atomically (i.e. all of them succeed, or all of them fail).

The indexes described in the diagram index into the account addresses array we saw above.
6/ Each Solana transaction also contains an array of signatures.

Each item is a digital signature of the message, signed by some private key.
7/ That's it! For more details, check out the official docs.

docs.solana.com/developing/pro…

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with pencilflip πŸ„

pencilflip πŸ„ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @pencilflip

Jul 20, 2022
Metaplex recently announced a new Digital Asset Standard, which is meant to improve upon the existing Metaplex NFT Protocol

Their doc, while thorough, is also long and complex πŸ˜΅β€πŸ’«

So here's a quick and simple summary of the most important improvements

1/ COST

The DAS reduces the cost to mint a basic NFT from ~0.012 SOL β†’ ~0.003 SOL

I assume NFT compression (basically, moving more data off-chain to save costs) will reduce minting costs even more, but estimated costs for compressed NFTs are not mentioned in the docs Image
2/ INCREASED FUNCTIONALITY

The DAS moves more functionality into the NFT program

For example, sales will be forced to go through the program, meaning royalties can be enforced

As another example, fractionalization will also be built into the program

Read 8 tweets
Mar 22, 2022
Solana NFTs 101 πŸŽ“

🌟 Part 1: Account overview 🌟

Solana NFTs are composed of at least three accounts:

1. Token mint account
2. Token account
3. Metadata account
4. [Optional] Edition account

Let's review these accounts one-by-one Image
1/ Every token in Solana, fungible or non-fungible, has a mint account

The mint account's address uniquely identifies the token

This account also determines who is allowed to mint more tokens and how many tokens are in supply

NFT mints should have supply = 1 and decimals = 0 Image
2/ Once a single NFT has been minted, which increases supply from 0 to 1, the mint authority (the account that is allowed to mint more tokens) should be set to "None"

This means no more tokens can be minted, fixing the supply at 1β€”the token is now non-fungible!
Read 14 tweets
Jan 19, 2022
.@armaniferrante recently published a great repository of 10 vulnerabilities to avoid when writing Solana programs.

Here's the quick rundown if you don't feel like digging into the code πŸ‘‡

ImageImageImage
1) Signer authorization

If your instruction takes in an "authority" account, make sure the account has signed the transaction.

Why? Because only the owner of the "authority" account can sign for itβ€”but anyone can pass in the account as a non-signer.
Don't do thisβ€”authority is not required to be a signer. Image
Read 33 tweets
Jan 16, 2022
The @metaplex team is working on a new metadata standard for both fungible and non-fungible tokens.

It's backwards compatible and has official support for on-chain collections. And it's currently being tested in devnet.

For more details, see below πŸ‘‡
1/ First, and perhaps most importantly, this new standard is backwards compatible.

This means NFTs that use the old standard will still function properly (e.g. be displayed properly in Phantom) once the new standard rolls out.
2/ So, what changes does the new standard introduce?

First, let's look at the old on-chain metadata struct. Image
Read 14 tweets
Dec 30, 2021
If you're writing Solana instructions involving tokens/NFTs, please require the token's mint account to be passed!

Otherwise, if you query for the mint's transactions, transactions that include your instruction may not show up... more on this πŸ‘‡
For exampleβ€”the regular "Transfer" instruction of the SPL Token Program does not take in the mint account.

Thus, if you transfer an NFT using this instruction, it WON'T show up on that NFT's Solana Explorer page. Image
That's why @phantom uses the "Transfer Checked" instruction, which does take in the mint account.

And that's why NFT transfers conducted via Phantom will always show up in Solana Explorer for the token mint account. Image
Read 7 tweets
Dec 12, 2021
Solana vs. Ethereum L2s, a UX comparison
1/ A lot of people are excited about ZK-rollups, and for good reason.

However, from a UX experience, ZK-rollups aren't too different than existing L2s. E.g. Polygon already offers low fees and fast transactions.

Let's look at Solana vs. L2s, and see why one might be preferred.
2/ To simplify things, I'll mainly be looking at Polygon.

Yes, I know that ZK-rollups are more secure than Polygon's sidechain.

But really, most users don't care about that πŸ€·β€β™‚οΈ. Users care about things like low fees and fast transactions, e.g. how good the UX is.
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(