<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Vinay</title>
    <description>The latest articles on Forem by Vinay (@blackat).</description>
    <link>https://forem.com/blackat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3881968%2Fd6b017fd-5606-40fa-a8ac-fdac3d3bea66.png</url>
      <title>Forem: Vinay</title>
      <link>https://forem.com/blackat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/blackat"/>
    <language>en</language>
    <item>
      <title>Why My Solana Wallet Broke Without "extractable: true" — And What PKCS8 Taught Me About Private Keys</title>
      <dc:creator>Vinay</dc:creator>
      <pubDate>Mon, 27 Apr 2026 09:34:20 +0000</pubDate>
      <link>https://forem.com/blackat/why-my-solana-wallet-broke-without-extractable-true-and-what-pkcs8-taught-me-about-private-keys-20kp</link>
      <guid>https://forem.com/blackat/why-my-solana-wallet-broke-without-extractable-true-and-what-pkcs8-taught-me-about-private-keys-20kp</guid>
      <description>&lt;p&gt;Last week, I built a small Solana wallet script where I could create, export, save, and reload a keypair.&lt;/p&gt;

&lt;p&gt;Here's the link of the script for reference: &lt;a href="https://github.com/bl4ck4t/solana_dev/blob/main/src/persistent-wallet.mjs" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It all started with this line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;generateKeyPairSigner&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;extractable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I tried exporting the private key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;exportKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pkcs8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wallet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keyPair&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;privateKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I learned two important things:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why &lt;code&gt;extractable: true&lt;/code&gt; is required
&lt;/h2&gt;

&lt;p&gt;If the key is not extractable:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;exportKey&lt;/code&gt; simply fails&lt;br&gt;
The private key stays locked inside the crypto subsystem&lt;br&gt;
You cannot save or reuse the wallet&lt;/p&gt;

&lt;p&gt;So without &lt;code&gt;extractable: true&lt;/code&gt;, the wallet is temporary (in-memory only).&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Why "pkcs8" and not "raw"?
&lt;/h2&gt;

&lt;p&gt;This part was subtle but important.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"pkcs8"&lt;/code&gt; is the standard format for exporting private keys&lt;br&gt;
It wraps the key with metadata (algorithm, structure, etc.)&lt;br&gt;
The Web Crypto API only allows private keys to be exported in PKCS#8 format&lt;/p&gt;

&lt;p&gt;If you try:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;crypto.subtle.exportKey("raw", wallet.keyPair.privateKey);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It will fail.&lt;/p&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"raw"&lt;/code&gt; format is only valid for public keys&lt;br&gt;
Private keys require a structured, secure encoding → hence PKCS#8&lt;/p&gt;


&lt;h2&gt;
  
  
  🧩 What I Did Next
&lt;/h2&gt;

&lt;p&gt;After exporting in PKCS#8, I extracted the actual 32-byte private key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;privateKeyBytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pkcs8Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then combined it with the public key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="s2"&gt;`const keyPairBytes = new Uint8Array(64);
keyPairBytes.set(privateKeyBytes, 0);
keyPairBytes.set(publicKeyBytes, 32);`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gave me the standard 64-byte Solana keypair, which I could:&lt;/p&gt;

&lt;p&gt;Save to a file&lt;br&gt;
Reload later&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚖️ Big Takeaway
&lt;/h2&gt;

&lt;p&gt;This small detail clarified a bigger concept for me:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;extractable: true&lt;/code&gt; → enables portability (save, backup, restore)&lt;br&gt;
&lt;code&gt;"pkcs8"&lt;/code&gt; → the only valid way to export private keys&lt;br&gt;
&lt;code&gt;"raw"&lt;/code&gt; → only works for public keys&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>web3</category>
      <category>blockchain</category>
      <category>solana</category>
    </item>
    <item>
      <title>🔑 From Usernames to Keypairs: Understanding Identity on Solana</title>
      <dc:creator>Vinay</dc:creator>
      <pubDate>Sat, 25 Apr 2026 12:10:32 +0000</pubDate>
      <link>https://forem.com/blackat/from-usernames-to-keypairs-understanding-identity-on-solana-472p</link>
      <guid>https://forem.com/blackat/from-usernames-to-keypairs-understanding-identity-on-solana-472p</guid>
      <description>&lt;p&gt;A few days ago, if you asked me what “identity” means in tech, I’d give you a very Web2 answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Email + password = identity&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every platform I used - GitHub, banking apps, social media - had its own login system. Different usernames, different passwords, all controlled by the companies behind them.&lt;/p&gt;

&lt;p&gt;Then I started learning Solana.&lt;/p&gt;

&lt;p&gt;And my understanding of identity completely changed.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏨 Web2 vs Web3: A Simple Analogy
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Web2 identity is like staying in a hotel.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You get a key card, but the hotel can deactivate it anytime.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Solana identity is like owning your own house.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;You hold the only key. No one can lock you out… but if you lose it, you're stuck outside.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This shift from platform-controlled access to user-controlled ownership is the core idea behind on-chain identity.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔑 Identity = Keypair
&lt;/h2&gt;

&lt;p&gt;On Solana, your identity starts with a cryptographic keypair:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Public Key&lt;/strong&gt; →  your address (safe to share)&lt;br&gt;
&lt;strong&gt;Private Key&lt;/strong&gt; → your proof of ownership (must stay secret)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you’ve used SSH before, this will feel familiar.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuykp59za5s7fv5sbl9cu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuykp59za5s7fv5sbl9cu.png" alt="This infographic illustrates the generation of a Solana keypair on a laptop, showing how the private key remains secure with the user while the public key is shared across the Solana network." width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No signup. No email. Just keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤯 One Keypair = My Identity
&lt;/h2&gt;

&lt;p&gt;In Web2, my identity is scattered. Each service (Google, Social Media, Github, etc..) manages its own version of "me".&lt;/p&gt;

&lt;p&gt;But on Solana, everything connects to one thing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1mt2vrmcw4bgkuat3fby.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1mt2vrmcw4bgkuat3fby.png" alt="A flowchart showing a user utilizing a cryptographic keypair as a single, sovereign gateway to manage tokens, NFTs, applications, and programs on the Solana network." width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s when it clicked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;My public key isn’t just an address — it’s my identity across the entire network.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;👀 The Weird Part: No Username?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Web2, we all know how a username looks like..&lt;br&gt;
I expected something like that.&lt;br&gt;
Instead, I got this 😵‍💫:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;14grJpemFaf88c8tiVb77W7T...&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not exactly memorable 😅&lt;/p&gt;

&lt;p&gt;But then I learned, On Solana, your identity is your public key:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s mathematically generated&lt;/li&gt;
&lt;li&gt;It uses Base58 encoding, avoiding confusing characters like 0, O, I, and l&lt;/li&gt;
&lt;li&gt;Not controlled by any company&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔐 “Logging In” Doesn’t Exist
&lt;/h2&gt;

&lt;p&gt;This is a subtle but important shift.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You’re not logging in. You’re proving ownership cryptographically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0i4qrzp3run6le4e3a2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0i4qrzp3run6le4e3a2.png" alt="The image is a dual-panel infographic comparing the centralized, password-based authentication of Web2 with the decentralized, private-key-signed verification of the Solana network." width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No passwords. No sessions. Just signatures.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏁 Final Thought
&lt;/h2&gt;

&lt;p&gt;I started this journey thinking I was just learning how wallets and transactions work.&lt;/p&gt;

&lt;p&gt;Instead, I ended up rethinking what “identity” even means.&lt;/p&gt;

&lt;p&gt;And honestly, once that clicks — everything else in Web3 starts to make a lot more sense.&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>solana</category>
      <category>web3</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
