docs(blockchain): rename locked notes to service notes - #423
Open
thomaslavaur wants to merge 1 commit into
Open
Conversation
7 tasks
danielSanchezQ
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Authors: Thomas Lavaur thomas@logos.co
The Mantle Ledger tracks three kinds of notes, regular notes, locked notes and channel notes, and only one of them was named after the state it is left in rather than after the role it plays. Channel notes are unspendable too, so "locked" never distinguished the two. This PR renames the kind, its state dictionary, its class and its identifier field into
service note,service_notes,ServiceNoteandservice_note_idacross the six blockchain specifications that use them.Reviewer Orientation
Read Motivation first, then check the rename is complete rather than reading each document top to bottom. Nothing here changes a wire layout, a hash preimage or a validation rule, so the review question is whether the new name is the right one and whether any occurrence was missed.
service_note_idin the three structures that carry it, and the two sentences that now say where the stake is lockedSDPDeclareandSDPWithdrawfield order and widths being untouchedStatus tracker
Change log
Motivation
The Mantle Ledger tracks three kinds of notes and names two of them after what they are for, channel notes hold channel funds and regular notes hold everything else, while the third was named after what happens to it. A locked note is a note a Service Declaration uses as collateral, and locking is the mechanism that keeps it there, not the reason it exists. The name describes the side effect and leaves the purpose to be inferred.
That inversion costs the reader twice. Channel notes are unspendable for as long as they represent channel funds, so a rule that says a note is spendable when it is "not locked" reads as if it covered them, while the ledger check it describes rejects service notes and channel notes through two separate assertions. And a reader meeting
locked_note_idin aDeclarationMessagelearns that the note is locked, which the declaration itself already implies, rather than that it is the note carrying the service collateral.Naming the kind after its role removes both problems.
service notesays what the note is for, leaves "locked" to describe the state a Declare Operation puts it in and a Withdraw Operation takes it out of, and lets the spendability rule name the two kinds it rejects instead of reusing a state word that applies to both.Proposal
The note kind previously called a locked note is called a service note. The rename is uniform and mechanical:
LockedNotebecomesServiceNote,locked_notesbecomesservice_notes,locked_note_idbecomesservice_note_id, theLockedNoteIdproduction of the SDP Operations becomesServiceNoteId, and theLocked notessection of Mantle becomesService notes.Only the naming changes. No structure gains or loses a field, no field changes width, position or order, no hash preimage changes, and no validation or execution step is added, removed or reordered.
locked_note_idwas already absent from thedeclaration_idpreimage, so the identifier of a declaration is unaffected by the rename of the field.Alongside the rename, the prose that leaned on "locked" to mean "is a service note" is restated in terms of the kind: the Mantle spendability sentence and the Input Gas description of Gas Cost Determination now name the note kinds the check rejects, and the SDP and Cryptoeconomics sentences about the minimum stake now say that the stake is locked in a service note.
Discussion
Why
service noterather thancollateral noteorstake noteThe three candidates all name the role.
collateral notedescribes the function accurately but is narrower than the mechanism: the note is a Service Declaration's collateral today, and the kind is defined by which registry holds it rather than by what the registry is used for.stake notecollides with Proof of Stake, where every aged note in the ledger is stake, service notes included, since a service note keeps participating in the leadership lottery while it is locked.service noteis the one that names the thing the note is bound to, matches theServiceTypeit is declared against, and sits next tochannel noteas a parallel construction, both being a note kind named after the subsystem holding it.Backwards compatibility
None is at stake. The rename touches identifiers and prose in specification documents, and every wire format, preimage and rule they define is byte-identical before and after. An implementation built against the previous revision of these documents conforms to this one without a change, and the corresponding source identifiers can be renamed at leisure rather than as a condition of conformance.
What was deliberately left alone
Lockedremains the right word for the state, and the SDP withdrawal text that says the stake is unlocked at epoche+2is unchanged.mantle-transaction-encoding/appendices/keep the historical name. They record proposals as they were accepted and are not living specifications.master. The open fast bootstrapping work addslocked_notesto the Epoch State Root, along with asdp_locked_note_hashfunction and aLOCKED_NOTE_HASH_V1domain separation tag. Whichever of the two merges second carries the rename, and the two tags are the part that must not be missed, being hashed rather than merely written.Details
1. The note kind and its state
Mantle owns the definition. The section and its anchor:
The SDP state validators keep, and the class it holds:
The
Ledgerfield, and the spendability rule that no longer reuses a state word covering both unspendable kinds:class Ledger: notes: list[Note] - locked_notes: dict[NoteId, LockedNote] + service_notes: dict[NoteId, ServiceNote] channel_notes: dict[NoteId, ChannelId]The two SDP Operation validation steps that named the state rather than the kind, both rules unchanged:
The remaining occurrences in Mantle are the same rename applied to the
DeclarationInfo,DeclarationMessageandWithdrawMessagefields, to theSDP_DECLARE,SDP_WITHDRAWand SDP epoch finalization pseudocode, to the worked examples, and to the test vector note recording that thedeclaration_idpreimage excludes the field.2. The identifier field
SDP carries the field in
DeclarationMessage,DeclarationInfoandWithdrawMessage, identically in each:class DeclarationMessage: service_type: ServiceType locators: list[Locator] provider_id: Ed25519PublicKey - locked_note_id: NoteId + service_note_id: NoteId zk_id: ZkPublicKeyThe two sentences that described the collateral without naming its kind:
3. The encoding production
Mantle Transaction Encoding renames the production and the two references to it. The field order, the widths and the encoded bytes of
SDPDeclareandSDPWithdraware unchanged:4. The Input Gas description
Gas Cost Determination described the Input Gas as covering a check that the note is "not locked", which named one of the two kinds the spendability check rejects. It now names both, matching what Mantle asserts:
The gas amounts are unchanged. Both checks were already negligible and both were already performed.
The SDP Declaration and SDP Withdraw breakdowns are the same rename applied to their bullets, with
Locking the noterestated asRegister the note as a service note, which is the operation the bullet was already pricing.Chores
service_note_idof the two Blend declaration snippets and the paragraph describing which note a Genesis declaration names.1.11.1in Mantle,1.4.2in SDP,1.6.1in Mantle Transaction Encoding,1.5.2in Gas Cost Determination,1.1.5in Genesis Block,1.2.2in Cryptoeconomics.Implementation
locked_notesintoservice_notesandLockedNoteintoServiceNotelocked_note_idfield of the declaration message, the withdraw message and the stored declaration intoservice_note_id, including its serialization and deserializationdeclaration_idpreimage is untouched by the field rename, the note identifier not being part of itSDP_DECLAREandSDP_WITHDRAWare unchanged, the existing test vectors passing without regenerationAffected Specifications
1.11.1, the note kind, its section anchor, the ledger state and the SDP Operations1.4.2, theservice_note_idfield and the two minimum stake sentences1.6.1, theServiceNoteIdproduction name only1.5.2, the Input Gas, SDP Declaration and SDP Withdraw descriptions1.1.5, terminology only1.2.2, terminology onlymaster, but the open fast bootstrapping work addslocked_notes,sdp_locked_note_hashand theLOCKED_NOTE_HASH_V1andLOCKED_NOTE_DICT_HASH_V1tags to the Epoch State RootVersion numbers to watch when merging: Mantle Transaction Encoding is at
1.6.0as of the channel configuration lineage PR and Mantle at1.11.0, so both rows renumber if another PR lands first.