Releases: iotaledger/streams
v2.0.0: User overhaul
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[2.0.0] - 2022-10-28
This version is not reverse compatible with v1.2.0
Large changes to the API to make the streams Library easier to use.
The previous version can be found under branch V1
This release is not compatible with stardust.
Effort towards this will be made in the branch named stardust, but as of yet is not functional. (See #284)
Added
- Generalized Author and Subscriber into User
- Created a User builder pattern for convenient creation
- Created a Message builder for sending messages
- User permission (Read/Write/Admin)
- Branch topics (Set a name for your stream and sub branches)
- Usage of DID Identifier using fragments
- A smaller Tangle client called uTangle (Nano-tangle)
Removed
- Old API
Changed
- Concrete Error types for each Streams crate
- Documentation on all public methods
- Merged crates into a more manageable layout
- Split Identifier into Identity and Identifier
Other
Bindings
- Bindings temporarily removed. Once Rust API is stable, effort will be put into getting them back.
Protocol
- The message index with the binary digest of the
blake2b256
hash of the Message'sAddress
has been slightly decreased in size again. This change was needed in order to have correct hex format whilst fitting in the 64 character limit. This results in indexes from a seed beeing different from their 1.2.0 counterpart
Quick start example
This example shows how to Create a User and send a message in the new system. For further use for now we would like to refer to our scenarios
Cargo.toml:
streams = { git = "https://github.com/iotaledger/streams", branch = "main" }
anyhow = {version = "1.0", default-features = false}
tokio = {version = "1.5", features = ["rt-multi-thread", "macros"]}
hex = {version = "0.4", default-features = false}
use streams::{
transport::utangle::Client,
id::Ed25519, User,
};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let seed = std::env::var("SEED")?;
let node_url = "https://api.lb-0.h.chrysalis-devnet.iota.cafe";
let transport: Client = Client::new(node_url);
let mut author = User::builder()
.with_transport(transport)
.with_identity(Ed25519::from_seed(seed))
.build();
let base_branch = "BASE_BRANCH";
let _announcement = author.create_stream(base_branch).await?;
let payload = b"PUBLICPAYLOAD";
// Create and send public message with payload (unencrypted)
let message = author.message().public().with_payload(*payload).send().await?;
// You can look this index up on the explorer: https://explorer.iota.org/devnet
println!("message index: {}", hex::encode(message.address().to_msg_index()));
Ok(())
}
v1.2.0
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[1.2.0] - 2021-10-06
This version is not reverse compatible with v1.1.0
Added
- Added fetch_prev_msg and fetch_prev_msgs
- State reset available
- Allow transport to be clonable
- Added single depth channel implementation and example
- Added manual subscription/unsubscription for Authors
- Reintroduce unsubscribe message
- Added guards against adding existing users
- Added reset_state to author api
- Added announcement_link function
- New workflows and actions for PR's, including compiling c and wasm bindings
- Select transport in .env in examples
Removed
- Removed encoding and payload length, replaced with implementation type enum
- All core functions converted to async (removing double api)
- Removed Subscriber::recover (it is unnecessary now without internal sync)
- Remove all cargo.locks from git state
Changed
- Unified state storage for pk's and psk's
- Refactored Client to allow for use of existing iota.rs client features including authentication and permanode support
- Corrected error message discrepancy for missing links
- Updated Author::recover to not conduct internal sync
- Fixed a panic in fetch_prev_msgs if a user tries to walk too far back
Other
Bindings
- Add all new functions and bring to feature parity
- Cleanup and channels.h updates
- Exposed Address::toMsgIndex
- WASM api refactor for getters/setters/copy
Development
- General linting fixes, performance refactoring
- Doc migration to Docusaurus, all docs available in IOTA wiki
- Began setting up testing procedure for WASM
Breaking Changes
Protocol
- Messages are now indexed with the binary digest of the
blake2b256
hash of the Message'sAddress
. Messages from previous versions were indexed with the hexadecimal encoding of this digest, resulting in indexes twice as large. This change implies that messages sent with prior versions of Streams won't be found when using Streams v1.2.0 or newer.
Rust
Author::new
andSubscriber::new
signatures has changedsync
client has been removed, Streams is nowasync
only. Useblock_on()
of your preferred runtime to make itsync
Address::from_str
now takes a single string (the whole string returned byAddress::to_string()
. It requires importingFromStr
trait.Address::to_string()
now requires importingToString
Display
forAddress
now outputs the String"<channel-address>:<msgid>"
in hexadecimal (the reciprocal ofAddress::from_str
. The hash used for indexing the messages can be obtained withAddress::to_msg_index()
Author::send_keyload(..)
now takes an iterable of&Identifier
as parameter, which can be eitherIdentifier::edPubKey
orIdentifier::PskId
Wasm
- patching
global
withnode-fetch
is no longer needed (but addingnode-fetch
in the dependencies is still required) SendOptions
constructor signature has changedAuthor
constructor signature has changedAddress#to_string()
has been renamed toAddress#toString()
Address.from_str
has been renamed toAddress.parse
and takes 1 single string now (that outputted byAddress#toString()
UserResponse#get_link()
method has been removed in favour of accessing to the attributeUserResponse#link
directlyUserResponse#get_seq_link()
method has been removed in favour of accessing to the attributeUserResponse#seqLink
directlyUserResponse#get_message()
method has been removed in favour of accessing to the attributeUserResponse#message
directlyMessage#get_pk()
has been renamedMessage#get_identifier()
Client
has been renamedStreamsClient
, to make room for iota.rsClient
which can now be instantiated from@iota/streams
either directly of with aClientBuilder
v1.1.0
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[1.1.0] - 2021-07-09
Added
- Chrysalis-2 client support.
- User state serialization.
- Documentation: getting started, API reference, examples for rust, c and wasm.
- State recovery without state.
- Fetching of link details per transport
- Adding of PSKs to author and subscriber
- Updated C Bindings api and error management
- Improved WASM interfaces
Removed
- Old trinary tangle client support.
Other
- Updated streams examples for rust interface: https://github.com/iotaledger/streams-examples/tree/v1.1.0
v1.0.1
This release provides improved error handling with a centralised message location, as well as fixes the message limit bug with the client requests, and additional functions for c bindings.
core: Error handling and messages consolidated
bindings/c: Additional functionality and updated example
cargo: Re-export modules from core, use updated iota.rs to fix request bug
1.0.0: Binary Streams
- core: improved spongos automaton and prng, fixed transform and join command;
- transport: improved transport traits and implementations, better support for async, upgraded iota_client dependency version;
- app: introduced cursor for sequencing state, cleaned up link generator trait, introduced generic message type;
- channels: encapsulated transport into Author/Subscriber tangle API, only synchronous transport is supported, fixed message handling issues;
- bindings/c: added cmake support, cleaned up bindings implementation;
- cargo: improved crate features.
1.0.0-alpha1: Binary Streams
- The Rust based core library is now complete
- C Bindings have been provided for easier compatibility with other languages
- The codebase has been completely converted to binary resulting in an impressive size reduction.
- The Merkle Tree Signature Scheme (MSS) has been replaced with Ed25519 signature scheme and NTRU key encapsulation has been replaced with X25519 key exchange. The MSS was much too wasteful and inefficient in some use cases. With binary, Ed25519 is much more lightweight for embedded applications resulting in a drastic improvement in performance and a considerable memory reduction.
- Single Branch and Multi-Branch Sequencing has been implemented in this release. This functionality should allow for existing MAM implementations to migrate over to Streams much easier due to full compatibility with previous MAM capabilities.
- Core functionality for no-std has been implemented, and should be completed after this release candidate is finalized later this month.
- An incompatibility issue with Hornet Nodes has been addressed allowing ease of integration for Streams with Hornet Nodes.