diff --git a/core/coreiface/options/unixfs.go b/core/coreiface/options/unixfs.go index f00fffb87b07..f6a392260443 100644 --- a/core/coreiface/options/unixfs.go +++ b/core/coreiface/options/unixfs.go @@ -101,8 +101,12 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, } } else { if options.CidVersion < 0 { - // Default to CIDv0 - options.CidVersion = 0 + // Defaults to CIDv0 unless RawLeaves is set to true. + if options.RawLeavesSet && options.RawLeaves { + options.CidVersion = 1 + } else { + options.CidVersion = 0 + } } }