169 releases (17 breaking)

new 0.18.0-alpha.0 Apr 15, 2024
0.17.1 Mar 28, 2024
0.14.31 Dec 19, 2023
0.14.23 Nov 29, 2023
0.2.4 Nov 24, 2020

#225 in Cryptography

Download history 121/week @ 2023-12-23 285/week @ 2023-12-30 408/week @ 2024-01-06 607/week @ 2024-01-13 507/week @ 2024-01-20 256/week @ 2024-01-27 260/week @ 2024-02-03 433/week @ 2024-02-10 706/week @ 2024-02-17 252/week @ 2024-02-24 682/week @ 2024-03-02 420/week @ 2024-03-09 4025/week @ 2024-03-16 1880/week @ 2024-03-23 511/week @ 2024-03-30 419/week @ 2024-04-06

6,956 downloads per month
Used in 11 crates (7 directly)

GPL-3.0 license

210KB
4K SLoC

sn_transfers

The sn_transfers crate is responsible for managing transfers within the Safe Network.

Its main component is the CashNote, which forms the basis of transfers on the Safe Network.

A CashNote represents a spendable unit of currency in the network, denoting ownership of a certain number of NanoTokens.

To execute a transfer, a SignedSpend needs to be created and validated on the network.

Transfers are directed to UniquePubKeys, which are derived from MainPubKeys. Using a DerivationIndex, the recipient can generate the necessary SecretKey to spend the NanoTokens.

Since most of the required information is stored in a SignedSpend on the network, we also provide a CashNoteRedemption struct. This struct contains the minimum information needed to retrieve a full Spend from the network and generate the keys required to spend the NanoTokens.

For error handling, we expose Error and Result types.

Additionally, this crate re-exports the bls crate used in the public API and includes a helper module for creating an Rng when invoking sn_transfers methods that require them.

Dependencies

~16–25MB
~440K SLoC