Skip to content

Commit de9bae6

Browse files
committed
Fix space-cli & update docs
1 parent 8dc4096 commit de9bae6

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

SUBSPACES.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,40 @@ $ space-cli operate @bitcoin
1414

1515
Use [subs](https://github.com/spacesprotocol/subs) to issue subspaces off-chain and create commitments.
1616

17+
18+
An **end-user** can generate a key pair like this:
19+
20+
```
21+
$ subs request alice@bitcoin
22+
✔ Created handle request
23+
24+
→ Private key saved: [email protected]
25+
```
26+
27+
An **operator** such as @bitcoin, can accept requests into their tree:
28+
29+
```
30+
31+
```
32+
33+
34+
For this example, we will commit just one handle, but it's more efficient to add a large batch of handles before making a commitment.
35+
36+
```
37+
$ subs commit
38+
✔ Committed batch
39+
→ Tree root: 79d39952ac5a8d6daedd48e59c0a58d12d10644c09f2fa3c70e9fe76e72f866a
40+
```
41+
42+
1743
### 3. Submit Commitments
1844

19-
Submit a commitment for your space with a Merkle root. Each commitment is cryptographically bound to all previous commitments.
45+
After your tree is updated, commit it's root hash. Each commitment is cryptographically bound to all previous commitments you made on-chain.
2046

21-
**Example:** To submit a commitment for `@bitcoin` with root hash `85d3a410db41b317b7c0310df64cefb6504482c0b5c7e8a36c992ed0dfdb38af`:
47+
**Example:** To submit a commitment for `@bitcoin` with root hash `79d39952ac5a8d6daedd48e59c0a58d12d10644c09f2fa3c70e9fe76e72f866a`:
2248

2349
```bash
24-
$ space-cli commit @bitcoin 85d3a410db41b317b7c0310df64cefb6504482c0b5c7e8a36c992ed0dfdb38af
50+
$ space-cli commit @bitcoin 79d39952ac5a8d6daedd48e59c0a58d12d10644c09f2fa3c70e9fe76e72f866a
2551
```
2652

2753
**Retrieve commitments** for a space:
@@ -30,6 +56,7 @@ $ space-cli commit @bitcoin 85d3a410db41b317b7c0310df64cefb6504482c0b5c7e8a36c99
3056
$ space-cli getcommitment @bitcoin
3157
```
3258

59+
3360
### Delegating Operational Control
3461

3562
You can authorize another party to make commitments on your behalf:

client/src/bin/space-cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,18 +1144,18 @@ async fn handle_commands(cli: &SpaceCli, command: Commands) -> Result<(), Client
11441144
false,
11451145
)
11461146
.await?;
1147-
1147+
let addr = SpaceAddress::from_str(&sptr_addr).expect("valid");
11481148
println!("Creating UTXO for sptr {}", sptr);
11491149
cli.send_request(
11501150
Some(RpcWalletRequest::CreatePtr(CreatePtrParams {
1151-
address: sptr_addr,
1151+
address: addr.0.to_string(),
11521152
})),
11531153
None,
11541154
fee_rate,
11551155
false,
11561156
)
11571157
.await?;
1158-
println!("Space should be operational was txs are confirmed");
1158+
println!("Space should be operational once txs are confirmed");
11591159
}
11601160
Commands::Commit { space, root, fee_rate } => {
11611161
let space_info = match cli.client.get_space(&space).await? {

ptr/src/sptr.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ impl KeyHash for Sptr {}
1111
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
1212
pub struct Sptr(pub(crate) [u8; 32]);
1313

14-
// COMMITMENT_KEY
15-
// SPTR_KEY
16-
// SPACE_KEY
17-
1814
impl Sptr {
1915
#[inline]
2016
pub fn as_slice(&self) -> &[u8] { &self.0 }

0 commit comments

Comments
 (0)