CCC Docs
    Preparing search index...

    Function buildMigrationWitness

    • Build the migration witness payload that authorizes a did:plc -> did:ckb import. Pure: takes a tx hash + signing material, returns a typed DidCkbWitness that the caller wraps in a WitnessArgs.outputType field.

      Per WIP-02 §3.1.1 we send only the genesis operation in history. The contract recomputes the genesis CID over the CBOR-encoded op, verifies the self-signature inside it, then verifies sig against history[0].rotationKeys[rotationKeyIndex].

      selfSigIndex defaults to 0 because PLC genesis ops are conventionally self-signed by the first rotation key; override if the genesis you're migrating used a different one.

      Parameters

      • props: {
            txHash: BytesLike;
            genesisOperation: PlcOperation;
            rotationKeyIndex: number;
            rotationPrivateKey: BytesLike;
            curve?: Curve;
            selfSigIndex?: number;
        }

      Returns DidCkbWitness