Files
heartwood/radicle-cli/examples/rad-id-threshold-soft-fork.md
T
cloudhead 989edacd56 Include new rad/root in signed refs
We ensure that a `rad/root` ref is included in the signed refs file
under `rad/sigrefs` for all remotes. This prevents a certain kind of
"grafting" attack where signed refs can be copied between repositories,
by having the peer sign over the identity root together with the data refs.

When verifying signed refs, we ensure that the ref is present and points
to an identity branch root that matches the repository identity containing
the signed refs.

Alternatives: lots of alternatives were considered, but this one doesn't
introduce any changes to the signing. The `rad/id/root` name was
considered but is invalid due to `rad/id`.
2024-10-21 16:32:49 +02:00

2.3 KiB

In some cases, a peer can create references, which includes rad/sigrefs, without having pushed the canonical default branch. For example, Bob can create an issue in the repository:

$ rad issue open --title "Add Bob as a delegate" --description "We agreed to add me as a delegate, so I am creating an issue to track that work" --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
╭──────────────────────────────────────────────────────────────╮
│ Title   Add Bob as a delegate                                │
│ Issue   f12d512c51d30429f7916db038ae0360e2e938c2             │
│ Author  bob (you)                                            │
│ Status  open                                                 │
│                                                              │
│ We agreed to add me as a delegate, so I am creating an issue │
│ to track that work                                           │
╰──────────────────────────────────────────────────────────────╯
✓ Synced with 1 node(s)

and if we inspect Alice's references, then we will see the following:

$ rad inspect --refs
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
└── refs
    ├── cobs
    │   └── xyz.radicle.id
    │       └── 0656c217f917c3e06234771e9ecae53aba5e173e
    ├── heads
    │   └── master
    └── rad
        ├── id
        ├── root
        └── sigrefs
z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
└── refs
    ├── cobs
    │   └── xyz.radicle.issue
    │       └── f12d512c51d30429f7916db038ae0360e2e938c2
    └── rad
        ├── root
        └── sigrefs

Despite not having the canonical branch, Alice should still be able to add Bob as a delegate, since a threshold of 1 can still be reached:

$ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delegate did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk -q
7be665f9fccba97abb21b2fa85a6fd3181c72858