From e0bd47c8e2c03c75a850ccdfbfb985b5fde54c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kami=C5=84ski=20=40=20StarkWare?= Date: Tue, 14 May 2024 13:53:50 +0200 Subject: [PATCH 1/2] SocialPay sequence diagram (#28) * SocialPay sequence diagram * better titles --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bc44b9bf..368ca008 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,37 @@ Freedom requires censorship resistance, and Nostr provides exactly that. ## Roadmap -- [ ] Cairo implementation of Nostr signature verification +- [x] Cairo implementation of Nostr signature verification - [ ] Starknet account contract implementation, controlled by Nostr keypair -- [ ] Simple frontend to sign and verify messages (using a browser extension lke [Flamingo](https://www.getflamingo.org/) or any other [NIP-07](https://github.com/nostr-protocol/nips/blob/master/07.md) compatible extension, list can be found [here](https://github.com/aljazceru/awesome-nostr#nip-07-browser-extensions)) - [ ] Joyboy landing page - [ ] SocialPay feature to send and receive tips through Nostr signed messages - [ ] Implement a full Nostr client application with Starknet integration - [ ] Run Nostr relay server - [ ] Crossover with [Vault](https://github.com/keep-starknet-strange/vault) to bring Social features to the Vault application +## Architecture +### SocialPay +#### Alice sends tokens to Bob +```mermaid +sequenceDiagram + actor Alice + actor Bob + participant SocialPay relay + participant Starknet Node + participant Alice Account + participant STRK Token + + Alice->>SocialPay relay: @joyboy send 10 STRK to @bob + activate SocialPay relay + SocialPay relay->>Starknet Node: SocialPay transaction + Starknet Node->>Alice Account: SocialPay handler + Alice Account->>STRK Token: transfer + Starknet Node->>SocialPay relay: SocialPay transaction complete + SocialPay relay->>Bob: @bob you just recived 10 STRK from @alice + SocialPay relay->>Alice: @alice transfer of 10 STRK to @bob is complete + deactivate SocialPay relay +``` + ## Modules
From dfe1e77d51263cd50f17e25456a7deae14ba15b2 Mon Sep 17 00:00:00 2001 From: Catherine Jonathan <35270183+kateberryd@users.noreply.github.com> Date: Tue, 14 May 2024 18:00:32 +0100 Subject: [PATCH 2/2] feat: implement a Cairo struct to represent NIP-01 event (#19) * feat: implement a Cairo struct to represent NIP-01 event * fix: update nip01 struct type * fix: run scarb fmt --check * fix: modify nip event * fix: split sig intow two u256 * fix: update tags type --- onchain/src/nip01.cairo | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 onchain/src/nip01.cairo diff --git a/onchain/src/nip01.cairo b/onchain/src/nip01.cairo new file mode 100644 index 00000000..98b9766a --- /dev/null +++ b/onchain/src/nip01.cairo @@ -0,0 +1,12 @@ +#[derive(Copy, Drop)] +struct NIP01Event { + id: u256, + pubkey: u256, + created_at: u64, + kind: u16, + tags: Array>, + content: ByteArray, + sig_r: u256, + sig_s: u256 +} +