Proof of Energy
A self-verifying note of computational work: no issuer, no signature, denominated in Z-bits.
Summary
A Sharenote is a proof of energy. It is a small binary record that proves one identity spent a declared amount of work in a stated algorithm. Anyone can check it from the record alone, and nobody has to issue it.
Every note is denominated on one continuous scale, the Z-bit. So notes are comparable, summable and splittable with exact integer math. What a note is worth to you, and what you accept it for, is your application's choice.
everyoneapp buildersrelay operatorsminers
Kinds and tags
| Kind | Name | How |
|---|---|---|
| 1723 | Note | unsigned; a relay stores it only after the record verifies |
| Tag | Meaning |
|---|---|
| g | the algorithm id, e.g. sha256d |
| z | the Z-bit, e.g. 20z00 or 34z10 |
| b | the binding in lowercase hex; present only when the note is bound |
The record
A Sharenote is a compact binary record. The proof is computed over these exact bytes. Multi-byte integers are big-endian.
| Field | Bytes | Meaning |
|---|---|---|
tag SN4U | 4 | separates the record from other bytes hashed the same way |
version | 1 | 0x01 |
algorithm | 2 + N | length, then lowercase ASCII id |
identity | 32 | x-only pubkey credited with the work |
z-bit | 2 | z (at least 1), then cc (0 to 99) |
binding | 2 + N | optional scope; length 0 means unbound |
nonce | 2 + N | the only field changed while mining |
The minter commits who, which algorithm, the Z-bit and the binding before searching. The note is worth exactly its Z-bit. A lucky hash earns no bonus. The pubkey sits inside the hash, so the credit cannot move to another identity without fresh work. No signature is needed, so a provider can mine notes credited to you without your key.
Algorithms and bindings
Version 1 defines two algorithms. H is read as a big-endian integer over all 32 bytes.
| id | H |
|---|---|
sha256d | SHA-256(SHA-256(record)) |
scrypt | scrypt(record, salt = record, N = 1024, r = 1, p = 1, 32 bytes) |
Values only compare and add within one algorithm. 34z10 in one is not 34z10 in another.
The binding is opaque. The application decides what it commits:
| binding commits | the note becomes |
|---|---|
| nothing | prepaid energy, spent later wherever accepted |
| your own reaction event | a like backed by work |
| a service and its current epoch | access paid in work |
| a work template | work that earns a share of a reward |
Verification
A relay or consumer checks the record, then (relays) the event. The first failing check decides.
- 1. Tag: starts with
SN4Uand a version byte, else REJECT. - 2. Version: known, else SKIP.
- 3. Algorithm: lowercase ASCII, else REJECT; a registry id, else SKIP.
- 4. Canonical: every length honored, nothing left over, valid BIP-340 key,
z ≥ 1,cc ≤ 99, else REJECT. - 5. Work:
H ≤ target(z-bit), else REJECT. - 6. Envelope (relays):
contentis the record in lowercase hex,pubkeyequalsidentity, tags are exactlyg/z/bmatching the record,idis the NIP-01 id. Asigis ignored.
| Verdict | Relay | Consumer |
|---|---|---|
ATTRIBUTED: valid, worth D = 2^256 / T | store | count |
REJECT: malformed or not enough work | drop | ignore |
SKIP: unknown version or algorithm | drop | ignore |
Transport on Nostr
A note rides in a kind:1723 event. It is unsigned, so the envelope differs from NIP-01: pubkey is the record's identity, content is the record in lowercase hex, created_at is publish time and not part of the proof, and there is no sig. Only relays and clients that support SNP-01 handle these events.
The event carries exactly one g, exactly one z, and one b only when the binding is non-empty. No other tag is allowed: anyone can republish an unsigned record, so a tag outside the record would carry nothing you can trust.
To get the energy behind a binding, query {"kinds":[1723], "#b":["<binding-hex>"]} and add the values per algorithm. The same note can travel in many events, so always count by proof, never by event.
Z-arithmetic
A Z-bit NNzcc maps to a target exactly, with integers only:
T(z, c) = floor( 2^(256 - z) · S_c / 2^48 )
S_c = round( 2^(48 - c/100) ) (scale table, 100 values)
The value is the expected number of hashes, D = 2^256 / T. Implementations carry the weight w = floor(2^384 / T). To add notes, sum weights and read the total back:
T_total = floor( 2^384 / Σ w_i )
z = 256 - bitlen(T_total), plus 1 if T_total is a power of two
c = max { c' in 0..99 : T(z, c') ≥ T_total }
| Sum | Result | Why |
|---|---|---|
20z00 + 20z00 | 21z00 | equal whole-bit notes add one bit |
2z01 + 2z01 | 3z00 | targets round down |
1z00 + 2z00 | 2z58 | 2 + 4 = 6, log2 6 ≈ 2.58 |
Rules: one algorithm only, each proof (algorithm, H) once, no floats. Compare amounts by weight, never by read-back Z-bits.
Splitting a reward
A reward of R whole units is split in proportion to work, the same for every observer, with nothing lost to rounding. Give recipient i the weight w_i of its notes and let W = Σ w_i:
s_i = floor( R · w_i / W )
r_i = R · w_i mod W
L = R - Σ s_i
Each recipient gets s_i. The L leftover units go one each to the largest remainders r_i. Ties go to the recipient whose smallest H is smallest.
The constraints that hold everything together: only ATTRIBUTED notes count; value comes from the committed Z-bit, never from H or a float log2; sums are exact; a relay verifies before storing; and whether to accept a note, or enforce single use, is the application's policy.
Worked example
An unbound 20z00 note mined with sha256d. Its record is 534e3455 01 0007 73686132353664 (sha256d), the 32-byte identity, 14 00 (20z00), 0000 (unbound), 0004 001644e1 (nonce). Hashing gives:
H = 00000e47d8d39787c3a2f7969cfed5400eb7b47e8a80f0d428131903957d9911
T(20z00) = 2^236
H ≤ T: ATTRIBUTED, worth20z00,D = 2^20, about a million hashes.- The same record committing
30z00(T = 2^226): REJECT,His too large.
Adding. 1z00 (value 2) plus 2z00 (value 4) is 6, which reads back as 2z58, not 3z00.
Splitting. R = 10 between those two notes: floors are 3 and 6, one unit left over. The 2z00 note has the larger remainder, so the final shares are 3 and 7.
Try it
Z-bit converter
Turn a Z-bit into its target, expected hashes and weight, exactly.
Mint a note
Mine a real sha256d note in your browser and inspect every byte of its SN4U record.
Add and split
Add notes by weight and split a reward the way SNP-01 does it.
Rendered from soprinter/snps/SNP-01.md. The full text has every rule; this page condenses it.
