---
title: "Discussion on \"The 7 Bytes That Weren't in the IDL: How #[repr(C)] Padding Breaks a Borsh Client\" | Hashnode"
description: "Discussion on \"The 7 Bytes That Weren't in the IDL: How #[repr(C)] Padding Breaks a Borsh Client\". A u64 field added 7 bytes of padding my borsh client never sent, triggering custom program error: 0x0 on Solana. When Rust pads, and how to fix it."
url: "https://hashnode.com/posts/the-7-bytes-that-weren-t-in-the-idl-how-repr-c-padding-breaks-a-borsh-client/6a57c95fd6cc3a57108a73c7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The 7 Bytes That Weren't in the IDL: How #\[repr(C)\] Padding Breaks a Borsh Client](https://blog.ayushagr.me/the-7-bytes-that-weren-t-in-the-idl-how-repr-c-padding-breaks-a-borsh-client?utm_source=hashnode&utm_medium=feed)

A u64 field added 7 bytes of padding my borsh client never sent, triggering custom program error: 0x0 on Solana. When Rust pads, and how to fix it.

Jul 15 · 17 min read · blog.ayushagr.me  
Read the article

-   [#rust](https://hashnode.com/tag/rust)
-   [#solana](https://hashnode.com/tag/solana)
-   [#pinocchio](https://hashnode.com/tag/pinocchio)
-   [#borsh](https://hashnode.com/tag/borsh)
-   [#zero-copy](https://hashnode.com/tag/zero-copy)
-   [#repr-c](https://hashnode.com/tag/repr-c)
-   [#memory-layout](https://hashnode.com/tag/memory-layout)
-   [#struct-padding](https://hashnode.com/tag/struct-padding)
-   [#alignment](https://hashnode.com/tag/alignment)
-   [#idl](https://hashnode.com/tag/idl)
-   [#on-chain-programs](https://hashnode.com/tag/on-chain-programs)
-   [#systems-programming](https://hashnode.com/tag/systems-programming)

## Written by

[Ayush Agrawal](https://hashnode.com/@AyushAgr91)

@AyushAgr91

  
[View profile](https://hashnode.com/@AyushAgr91)

Blockchain + Backend Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
