Serialize rct sig
        :param ar:
        :type ar: x.Archive
        :param type:
        :param inputs:
        :param outputs:
        :param mixin:
        :return:

async def serialize_rctsig_prunable(self, ar, type, inputs, outputs, mixin):
        """
        Serialize rct sig
        :param ar:
        :type ar: x.Archive
        :param type:
        :param inputs:
        :param outputs:
        :param mixin:
        :return:
        """
        if type == RctType.Null:
            return True

        if type != RctType.Full and type != RctType.Bulletproof and \
                type != RctType.Simple and type != RctType.Bulletproof2:
            raise ValueError('Unknown type')

        if is_rct_bp(type):
            await ar.tag('bp')
            await ar.begin_array()
            bps = [0]
            if ar.writing:
                bps[0] = len(self.bulletproofs)

            if type == RctType.Bulletproof2:
                await ar.field(elem=eref(bps, 0), elem_type=x.UVarintType)
            else:
                await ar.field(elem=eref(bps, 0), elem_type=x.UInt32)

            await ar.prepare_container(bps[0], eref(self, 'bulletproofs'), elem_type=Bulletproof)

            for i in range(bps[0]):
                await ar.field(elem=eref(self.bulletproofs, i), elem_type=Bulletproof)
            await ar.end_array()

        else:
            await ar.tag('rangeSigs')
            await ar.begin_array()
            await ar.prepare_container(outputs, eref(self, 'rangeSigs'), elem_type=RangeSig)
            if len(self.rangeSigs) != outputs:
                raise ValueError('rangeSigs size mismatch')

            for i in range(len(self.rangeSigs)):
                await ar.field(elem=eref(self.rangeSigs, i), elem_type=RangeSig)
            await ar.end_array()

        await ar.tag('MGs')
        await ar.begin_array()

        # We keep a byte for size of MGs, because we don't know whether this is
        # a simple or full rct signature, and it's starting to annoy the hell out of me
        is_full = type == RctType.Full
        mg_elements = inputs if not is_full else 1
        await ar.prepare_container(mg_elements, eref(self, 'MGs'), elem_type=MgSig)
        if len(self.MGs) != mg_elements:
            raise ValueError('MGs size mismatch')

        for i in range(mg_elements):
            # We save the MGs contents directly, because we want it to save its
            # arrays and matrices without the size prefixes, and the load can't
            # know what size to expect if it's not in the data
            await ar.begin_object()
            await ar.tag('ss')
            await ar.begin_array()

            await ar.prepare_container(mixin + 1, eref(self.MGs[i], 'ss'), elem_type=KeyM)
            if ar.writing and len(self.MGs[i].ss) != mixin + 1:
                raise ValueError('MGs size mismatch')

            for j in range(mixin + 1):
                await ar.begin_array()
                mg_ss2_elements = 1 + (1 if not is_full else inputs)
                await ar.prepare_container(mg_ss2_elements, eref(self.MGs[i].ss, j), elem_type=KeyM.ELEM_TYPE)

                if ar.writing and len(self.MGs[i].ss[j]) != mg_ss2_elements:
                    raise ValueError('MGs size mismatch 2')

                for k in range(mg_ss2_elements):
                    await ar.field(eref(self.MGs[i].ss[j], k), elem_type=KeyV.ELEM_TYPE)
                await ar.end_array()

            await ar.tag('cc')
            await ar.field(eref(self.MGs[i], 'cc'), elem_type=ECKey)
            await ar.end_object()
        await ar.end_array()

        if type in (RctType.Bulletproof, RctType.Bulletproof2):
            await ar.begin_array()
            await ar.prepare_container(inputs, eref(self, 'pseudoOuts'), elem_type=KeyV)
            if ar.writing and len(self.pseudoOuts) != inputs:
                raise ValueError('pseudoOuts size mismatch')

            for i in range(inputs):
                await ar.field(eref(self.pseudoOuts, i), elem_type=KeyV.ELEM_TYPE)
            await ar.end_array()