<p>The style guide for Bitcoin Core is available on <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md" rel="nofollow noreferrer">GitHub here</a>. It no longer details a naming convention, but as <a href="https://bitcoin.stackexchange.com/users/2306/nick-odell">Nick ODell</a> already mentioned above, variables typically follow a form of <a href="http://en.wikipedia.org/wiki/Hungarian_notation#Systems_vs._Apps_Hungarian" rel="nofollow noreferrer">Apps Hungarian</a> naming.</p>

<p>In the past, the style guide did include <a href="https://github.com/bitcoin/bitcoin/blob/v0.9.5/doc/coding.md#coding" rel="nofollow noreferrer">a naming convention</a>, however it has since been removed because <a href="https://github.com/bitcoin/bitcoin/pull/4498#issuecomment-50391941" rel="nofollow noreferrer">it wasn't being consistently followed</a>.</p>

CC BY-SA 3.0
2015-05-28T14:19:18.390Z
2015-05-28T14:19:18.390Z
2017-04-13T12:47:33.743Z
Christopher Gurnee
<p><a href="http://en.wikipedia.org/wiki/Hungarian_notation" rel="nofollow">http://en.wikipedia.org/wiki/Hungarian_notation</a></p>

<ul>
<li><code>C</code> stands for Class</li>
<li><code>p</code> for Pointer</li>
<li><code>f</code> for Flag (boolean)</li>
<li><code>n</code> for Number</li>
<li><code>sz</code> for zero terminated string</li>
</ul>

<p>These conventions are no longer mandatory when contributing to bitcoin core.</p>

<p>You might also read <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md</a></p>

CC BY-SA 3.0
2015-05-28T14:12:36.220Z
2015-05-28T14:12:36.220Z
Jonas Schnelli
<p><strong>Is there specific reference for naming conventions in Bitcoin Core source code?</strong> <br/>
I see regularity in class naming with prefix "C" (Chain, CInv etc.) or pointer naming with "p" (pprev, pnode etc. ) and am wondering if there's more to my list of prefixes or other conventions.</p>

<p><strong>Is there a Bitcoin-specific naming convention at all?</strong></p>

CC BY-SA 3.0
2015-05-28T13:01:09.340Z
I don't know if there's a formal reference, but the second thing you're describing is http://en.wikipedia.org/wiki/Hungarian_notation
Nick ODell
CC BY-SA 3.0
2015-05-28T14:12:34.193Z
The bitcoin repo specifies their conventions here as well: https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md
morsecoder
<development><bitcoin-core-development><bitcoin-core>
Naming Convention In Bitcoin Source Code
Aliakbar Ahmadi
# Naming Convention In Bitcoin Source Code

(Asked by: username_0 on 2015-05-28)

**Is there specific reference for naming conventions in Bitcoin Core source code?**   
I see regularity in class naming with prefix "C" (Chain, CInv etc.) or pointer naming with "p" (pprev, pnode etc. ) and am wondering if there's more to my list of prefixes or other conventions.

**Is there a Bitcoin-specific naming convention at all?**

**Tags:** development, bitcoin-core-development, bitcoin-core

> **Comments:**
> **username_1**: I don't know if there's a formal reference, but the second thing you're describing is http://en.wikipedia.org/wiki/Hungarian_notation  
> **username_2**: The bitcoin repo specifies their conventions here as well: https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md  

---

## 2 answers

### Answer by username_4 on 2015-05-28. Score: 4 | Accepted answer

<http://en.wikipedia.org/wiki/Hungarian_notation>

* `C` stands for Class
* `p` for Pointer
* `f` for Flag (boolean)
* `n` for Number
* `sz` for zero terminated string

These conventions are no longer mandatory when contributing to bitcoin core.

You might also read <https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md>


---

### Answer by username_3 on 2015-05-28. Score: 1

The style guide for Bitcoin Core is available on [GitHub here](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md). It no longer details a naming convention, but as [username_1](https://bitcoin.stackexchange.com/users/2306/nick-odell) already mentioned above, variables typically follow a form of [Apps Hungarian](http://en.wikipedia.org/wiki/Hungarian_notation#Systems_vs._Apps_Hungarian) naming.

In the past, the style guide did include [a naming convention](https://github.com/bitcoin/bitcoin/blob/v0.9.5/doc/coding.md#coding), however it has since been removed because [it wasn't being consistently followed](https://github.com/bitcoin/bitcoin/pull/4498#issuecomment-50391941).


---

