Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embrace new UCAN representation and invocation Spec #65

Open
vasco-santos opened this issue Jun 22, 2023 · 1 comment
Open

Embrace new UCAN representation and invocation Spec #65

vasco-santos opened this issue Jun 22, 2023 · 1 comment

Comments

@vasco-santos
Copy link
Contributor

We need to swap this all over the place in the specs repo.

we should embrace new UCAN representation and also embrace upcoming invocation spec

@vasco-santos
Copy link
Contributor Author

@Gozala already did a draft for aggregation spec in #62 (comment)

# Agency namespaces aggregate APIs by DID of the aggregator
type AgencyAPI {[AggregatorDID] AggregateAPI }

type AggregateAPI union {
  AggregateOffer      "aggregate/offer"
  AggregateGet         "aggregate/get"
  DealArrange            "deal/arrange" 
} representation representation inline {
  discriminantKey "op"
}

type AggregateOffer struct {
   # in
   rsc        AggregatorDID
   input     Offer
   # out
   out        OfferState
   # kicks off "deal/arrange" and makes aggregate state "queued"
   join        &DealArrange
}

type OfferState union {
  Unit "ok"
  Any  "error"
} type keyed

type Offer struct {
   offer &AggregateInfo
   # delegation allowing to `publish/piece` contained pieces and `deal/sign` offered aggregate
   ucan &UCAN
}

type AggregateInfo struct {
   link        &CommP
   size        Int
   pieces   [PieceInfo]
}

type AggregateGet struct {
    # in
   rsc        AggregatorDID
   input     AggregateRef
   # out
   out        AggregateGetResult
}

type DealArrange struct {
   # in
   rsc        AgencyDID
   input     DealInfo
   # out
   out         DealResult
}

type DealInfo struct {
  aggregate   &CommP
}

type DealResult union {
   | Unit   "ok"
   | Any    "error"
} representation keyed

type AggregateGetResult union {
  AggregateState  "ok"
} keyed

type AggregateState union {
  | &QueuedAggregate     "queued"
  | &AcceptedAggregate   "accepted"
  | &RejectedAggregate    "rejected"
} representation keyed


type AggregatorAPI union {
  | PublishPiece            "piece/publish"
  | DealSign                   "deal/offer"
}

type PiecePublish {
   # in
   rsc      AggregatorDID
   input   ContentPieceInfo      
   # out
   out      ContentLocation
}

type ContentPieceInfo {
  piece         &CommP
  content     &CAR 
}


type ContentLocation {
  url URL
}

type DealOffer {
   rsc      AggregatorDID
   input   DealInfo
   # out
   out      DealResult
}

type Deal {
   aggregate      &CommP
   // .... not sure what else goes in here
}

type DealResult union {
  | DealSignature   "ok"
  | Any                     "error"
} representation keyed

type DealSignature {
   iss         AggregatorDID
   sig         bytes
}

type URL string
type CAR bytes
type CommP bytes


type # https://github.com/filecoin-project/go-state-types/blob/1e6cf0d47cdda75383ef036fc2725d1cf51dbde8/abi/piece.go#L47-L50
type PieceInfo {
  # Size in nodes. For BLS12-381 (capacity 254 bits), must be >= 16. (16 * 8 = 128)
  size Int
  link Link
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant