Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- Skip requests to the `DataStore` for asset vault witnesses which are already in transaction inputs ([#2298](https://github.com/0xMiden/miden-base/pull/2298)).
- [BREAKING] refactored `TransactionAuthenticator::get_public_key()` method to return `Arc<PublicKey> `instead of `&PublicKey` ([#2304](https://github.com/0xMiden/miden-base/pull/2304)).
- [BREAKING] Renamed `NoteInputs` to `NoteStorage` to better reflect that values are stored data associated with a note rather than inputs ([#1662](https://github.com/0xMiden/miden-base/issues/1662)).
- Removed `NoteType::Encrypted` ([#2315](https://github.com/0xMiden/miden-base/pull/2315)).

## 0.13.0 (2026-01-16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use miden::core::word
# Constants for different note types
const PUBLIC_NOTE=1 # 0b01
const PRIVATE_NOTE=2 # 0b10
const ENCRYPTED_NOTE=3 # 0b11

# The default value of the felt at index 3 in the note metadata header when a new note is created.
# All zeros sets the attachment kind to None and the user-defined attachment scheme to "none".
Expand Down
8 changes: 4 additions & 4 deletions crates/miden-protocol/src/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,10 @@ pub enum NoteError {
NoteExecutionHintAfterBlockCannotBeU32Max,
#[error("invalid note execution hint payload {1} for tag {0}")]
InvalidNoteExecutionHintPayload(u8, u32),
#[error("note type {0} does not match any of the valid note types {public}, {private} or {encrypted}",
public = NoteType::Public,
private = NoteType::Private,
encrypted = NoteType::Encrypted,
#[error(
"note type {0} does not match any of the valid note types {public} or {private}",
public = NoteType::Public,
private = NoteType::Private,
)]
UnknownNoteType(Box<str>),
#[error("note location index {node_index_in_block} is out of bounds 0..={highest_index}")]
Expand Down
13 changes: 1 addition & 12 deletions crates/miden-protocol/src/note/note_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use crate::utils::serde::{
// Keep these masks in sync with `miden-lib/asm/miden/kernels/tx/tx.masm`
const PUBLIC: u8 = 0b01;
const PRIVATE: u8 = 0b10;
const ENCRYPTED: u8 = 0b11;

// NOTE TYPE
// ================================================================================================
Expand All @@ -28,9 +27,6 @@ pub enum NoteType {
/// Notes with this type have only their hash published to the network.
Private = PRIVATE,

/// Notes with this type are shared with the network encrypted.
Encrypted = ENCRYPTED,

/// Notes with this type are fully shared with the network.
Public = PUBLIC,
}
Expand All @@ -53,7 +49,6 @@ impl TryFrom<u8> for NoteType {
fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
PRIVATE => Ok(NoteType::Private),
ENCRYPTED => Ok(NoteType::Encrypted),
PUBLIC => Ok(NoteType::Public),
_ => Err(NoteError::UnknownNoteType(format!("0b{value:b}").into())),
}
Expand Down Expand Up @@ -101,7 +96,6 @@ impl FromStr for NoteType {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"private" => Ok(NoteType::Private),
"encrypted" => Ok(NoteType::Encrypted),
"public" => Ok(NoteType::Public),
_ => Err(NoteError::UnknownNoteType(s.into())),
}
Expand All @@ -123,7 +117,6 @@ impl Deserializable for NoteType {

let note_type = match discriminant {
PRIVATE => NoteType::Private,
ENCRYPTED => NoteType::Encrypted,
PUBLIC => NoteType::Public,
discriminant => {
return Err(DeserializationError::InvalidValue(format!(
Expand All @@ -143,7 +136,6 @@ impl Display for NoteType {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
NoteType::Private => write!(f, "private"),
NoteType::Encrypted => write!(f, "encrypted"),
NoteType::Public => write!(f, "public"),
}
}
Expand All @@ -155,17 +147,14 @@ fn test_from_str_note_type() {

use crate::alloc::string::ToString;

for string in ["private", "public", "encrypted"] {
for string in ["private", "public"] {
let parsed_note_type = NoteType::from_str(string).unwrap();
assert_eq!(parsed_note_type.to_string(), string);
}

let public_type_invalid_err = NoteType::from_str("puBlIc").unwrap_err();
assert_matches!(public_type_invalid_err, NoteError::UnknownNoteType(_));

let encrypted_type_invalid = NoteType::from_str("eNcrYptEd").unwrap_err();
assert_matches!(encrypted_type_invalid, NoteError::UnknownNoteType(_));

let invalid_type = NoteType::from_str("invalid").unwrap_err();
assert_matches!(invalid_type, NoteError::UnknownNoteType(_));
}
2 changes: 0 additions & 2 deletions crates/miden-testing/tests/scripts/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,6 @@ async fn test_mint_note_output_note_types(#[case] note_type: NoteType) -> anyhow
let recipient = NoteRecipient::new(serial_num, p2id_script, note_storage);
MintNoteStorage::new_public(recipient, amount, output_note_tag.into())?
},
NoteType::Encrypted => unreachable!("Encrypted note type not used in this test"),
};

let mut rng = RpoRandomCoin::new([Felt::from(42u32); 4].into());
Expand Down Expand Up @@ -1215,7 +1214,6 @@ async fn test_mint_note_output_note_types(#[case] note_type: NoteType) -> anyhow

assert_eq!(created_note, &p2id_mint_output_note);
},
NoteType::Encrypted => unreachable!("Encrypted note type not used in this test"),
}

mock_chain.add_pending_executed_transaction(&executed_transaction)?;
Expand Down